Java.Interop.IJavaPeerable error

MJ_AhmedMJ_Ahmed BHMember ✭✭

Hi all;
Any idea how to get rid of this error :( , I get this when I run my PCL project in iPAD air 2 ?

Severity Code Description Project File Line Suppression State Tool
Error Failed to resolve "Java.Interop.IJavaPeerable" reference from "Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065" App1.iOS C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets 777

Answers

  • MariusBloemhofMariusBloemhof USMember ✭✭

    Hi, did you manage to resolve this issue? I have encountered the same problem and cannot seem to find a solution

  • NigelWebberNigelWebber USMember ✭✭
    edited April 11

    Me too - sigh. Happened after I updated to latest visual studio (mac and pc end, updated the NuGets etc). Now I can no longer build for iOS.

    I my case it occurs during build just after the Provisioning Profile:, Bundle Id: and App Id: lines

    Appears to be related to Xamarin.iOS.Common.Targets specifically the branch

    Unfortunately, I have no clue how to resolve so I guess I give up with iOS for now. The Android stuff works fine.

    By way of a test, for iOS, I set linker behaviour to 'Don't Link' from its previous setting of 'Link Framework SDKs Only' - the error changes, which might give more clues as to why the build fails on latest xamarin

    C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(786,3): warning : The dependency 'Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' of the assembly 'Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' was not found. Please review the project's references.
    3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(786,3): warning : Could not compute a complete dependency map for the project. This will result in slower build times because Xamarin.iOS can't properly detect what needs to be rebuilt (and what does not need to be rebuilt). Please review previous warnings for more details.
    3>  AOT Compilation exited with code 1, command:
    3>  MONO_PATH=/Users/hwbuild/Library/Caches/Xamarin/mtbs/builds/ProteusPatientApp.iOS/c4035b7119fd18b66fba678d6d53ddbe/obj/iPhone/Debug/mtouch-cache/Build /Library/Frameworks/Xamarin.iOS.framework/Versions/11.9.1.24/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt -O=-float32  --aot=mtriple=arm64-ios,data-outfile=/Users/hwbuild/Library/Caches/Xamarin/mtbs/builds/ProteusPatientApp.iOS/c4035b7119fd18b66fba678d6d53ddbe/obj/iPhone/Debug/mtouch-cache/arm64/Mono.Android.aotdata.arm64,static,asmonly,direct-icalls,full,soft-debug,dwarfdebug,no-direct-calls,outfile=/Users/hwbuild/Library/Caches/Xamarin/mtbs/builds/ProteusPatientApp.iOS/c4035b7119fd18b66fba678d6d53ddbe/obj/iPhone/Debug/mtouch-cache/arm64/Mono.Android.dll.s "/Users/hwbuild/Library/Caches/Xamarin/mtbs/builds/ProteusPatientApp.iOS/c4035b7119fd18b66fba678d6d53ddbe/obj/iPhone/Debug/mtouch-cache/Build/Mono.Android.dll"
    3>  Failed to load method 0x6000007 from '/Users/hwbuild/Library/Caches/Xamarin/mtbs/builds/ProteusPatientApp.iOS/c4035b7119fd18b66fba678d6d53ddbe/obj/iPhone/Debug/mtouch-cache/Build/Mono.Android.dll' due to Could not load file or assembly 'Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' or one of its dependencies. assembly:Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065 type:<unknown type> member:<none>.
    3>  Run with MONO_LOG_LEVEL=debug for more information.
    3>  Mono Ahead of Time compiler - compiling assembly /Users/hwbuild/Library/Caches/Xamarin/mtbs/builds/ProteusPatientApp.iOS/c4035b7119fd18b66fba678d6d53ddbe/obj/iPhone/Debug/mtouch-cache/Build/Mono.Android.dll
    3>  AOTID 6B60A8FD-FF1C-2AA1-ADB8-1CDC02B251AB
    3>  AOT of image /Users/hwbuild/Library/Caches/Xamarin/mtbs/builds/ProteusPatientApp.iOS/c4035b7119fd18b66fba678d6d53ddbe/obj/iPhone/Debug/mtouch-cache/Build/Mono.Android.dll failed.
    3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(786,3): error : Could not AOT the assembly '/Users/hwbuild/Library/Caches/Xamarin/mtbs/builds/ProteusPatientApp.iOS/c4035b7119fd18b66fba678d6d53ddbe/obj/iPhone/Debug/mtouch-cache/Build/Mono.Android.dll'
    ========== Rebuild All: 2 succeeded, 1 failed, 0 skipped ==========
    

    Everything breaking left right and center appears to be the norm with VS and Xamarin updates unfortunately. Guess I will go back to a hello world project and see if the build for that is also broken and if so wait for Xamarin to fix the newly introduced bugs.

    I also note that the constant disconnects with the MAC build box have still not been resolved!

    Nigel

  • NigelWebberNigelWebber USMember ✭✭

    Hi

    In my case, this was an errant reference to 'Android' in the Forms UI code - nothing to do with the Xamarin/VS version update. I do so wish that silly stuff like this got parsed and highlighted during UI build for a multi-platform app though.

    If you see any 'Java' errors during iOS build, search your UI code for '.Android' and 'Android.' and stick it in #ifdefs, or get rid of it. In my case it was a quick test of something on Android that I then forgot having ever done.

    Hope this helps someone else keep their hair!

    Nigel

Sign In or Register to comment.