Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error XA0009: Error while loading assembly: /Users/Projects/monodroid-samples/FragmentsWalkthrough/SupportLibFragments/obj/Release/android/assets/supportlibfragmentssample.dll #31

Closed
jpotts18 opened this issue Jul 2, 2013 · 3 comments

Comments

@jpotts18
Copy link

jpotts18 commented Jul 2, 2013

I have been trying to build the Support Lib Fragments inside the FragmentWalkthrough on a Mac. I have done the following.

  1. Added a new android-support-v4.jar file to the SupportLib folder.
  2. Set the build action of the new JAR as Android Java Library.
  3. Added the launcher images that were missing.
  4. I got this error.

Warnings:

/Users/developer/Projects/monodroid-samples/FragmentsWalkthrough/SupportLibFragments/SupportLibFragments.csproj (Build) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets (_ResolveSatellitePaths target) ->

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets:  warning : Reference 'Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' not resolved
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets:  warning : Reference 'Mono.Android.Support.v4, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' not resolved
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets:  warning : Reference 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' not resolved

Errors:

/Users/developer/Projects/monodroid-samples/FragmentsWalkthrough/SupportLibFragments/SupportLibFragments.csproj (Build) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets (_GenerateJavaStubs target) ->

: error XA0009: Error while loading assembly: /Users/developer/Projects/monodroid-samples/FragmentsWalkthrough/SupportLibFragments/obj/Release/android/assets/supportlibfragmentssample.dll

 3 Warning(s)
 1 Error(s)

I tried the same thing on windows and I was able to build to a phone. I have also had some problem with my phones ABI, so I went into the Project Settings and I added the (armeabi-v7a).

Deploying in Debug mode works on mac with the same configuration.
Differences between release and debug build

Linker was set to

  • link sdk's only in release mode
  • dont link in Debug mode.

General

  • Enable optimzations was selected for release mode
@jpotts18
Copy link
Author

jpotts18 commented Jul 2, 2013

Resolved by the following project options

  • Android Build -> Linker (tab) -> Link behavior as Link all assemblies
  • Android Build -> Packaging (tab) -> Use Shared Run time
  • On the file system remove your bin and obj folders on the file system.

@topgenorth
Copy link
Contributor

ALso, you don't need to add android-support-v4.jar in the current versions of Xamarin.Android.

@DrTJ2066
Copy link

DrTJ2066 commented Sep 5, 2017

Thank you @jpotts18
Your solution worked for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants