I'm getting an error on initializing map, when I try to use map as a external library and tried to make secondary, the apk is created and when I tried to launch map it crashes. But when I tried the same thing without dex it works fine (stacktrace is below).
How can I resolve this issue? I'm facing 65536 limit exceed error. So, it's only way to create apk, and I'm using ant.
java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
10-06 22:20:24.374: E/AndroidRuntime(17015): at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
10-06 22:20:24.374: E/AndroidRuntime(17015): at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
10-06 22:20:24.374: E/AndroidRuntime(17015): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:291)
10-06 22:20:24.374: E/AndroidRuntime(17015): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
It seems you use google-play-services.jar. The jar file does not include some resources.
Link the google-play-services_lib to your project.
java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable in android
If you use eclipce import Google Play Services from your SDK to workspace and add as library. If you use Android Studio add gradle to this as dependecies. compile 'com.google.android.gms:play-services:6.1.+'
Here is link for developing with Google Play Services: http://developer.android.com/google/play-services/setup.html
You cannot use jar file for google play services.
You can find further information about 64k Limit at Jake Wharton's blog ; http://jakewharton.com/play-services-is-a-monolith/
Also with Android 5.0 Lolipop release google release a MultiDexApplication library. You should try it. http://developer.android.com/reference/android/support/multidex/MultiDexApplication.html
Note: With API v21, this feature supported natively by Android.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With