Forum Xamarin.Android

Multiple issues with library project and multidex

In order to have multiple app sharing the same functionality I have moved all code to a separate library project but still have a doubt If I did everything correct and the issue with running app on devices which do not support multidex natively.

So basically my questions are:

  • What is the proper location and build action for AndroidManifest.xml in library?
  • Is it enough to reference required libraries (say, Play Services, Facebook etc) only in this library and leave application references clear? The thing is it kind of works either way but if I don't reference say Xamarin.GooglePlayServices.Ads in application it won't build because of missing resource references.
  • Somehow enabling ProGuard doesn't help much, it decreases number from 88k to 84k only. Is there any other step required?
  • On devices which do not support multidex I'm getting an error
[AndroidRuntime] Caused by: java.lang.ClassNotFoundException: Didn't find class "TestApp" on path: /data/app/com.test-1.apk
[AndroidRuntime]    at dalvik.system.BaseDexClassLoader.findClass(
[AndroidRuntime]    at java.lang.ClassLoader.loadClass(
[AndroidRuntime]    at java.lang.ClassLoader.loadClass(
[AndroidRuntime]    at
[AndroidRuntime]    at

and inspection of apk shows that MutiDexApplication is packaged to the second dex, when I assume it should present in the main dex as it is a base class for my application:


So if this is the issue then how to make Xamarin / Android SDK to properly allocate classes?


Sign In or Register to comment.