java.lang.NoClassDefFoundError: com.google.android.gms.internal.zzmp - android

Receiving this error on Android 4.4 device when starting my app. App immediately crashes. However I don't have this error on Android 5.1 device. Any clue?
10-15 22:35:06.306 14072-14072/com D/dalvikvm﹕ VFY: replacing opcode 0x71 at 0x0000
10-15 22:35:06.306 14072-14072/com D/AndroidRuntime﹕ Shutting down VM
10-15 22:35:06.306 14072-14072/com W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x4304b160)
10-15 22:35:06.306 14072-14072/com E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process:com., PID: 14072
java.lang.NoClassDefFoundError: com.google.android.gms.internal.zzmp
at com.google.android.gms.measurement.internal.zzz.zzj(Unknown Source)
at com.google.android.gms.measurement.internal.zzv.(Unknown Source)
at com.google.android.gms.measurement.internal.zzz.zzAq(Unknown Source)
at com.google.android.gms.measurement.internal.zzv.zzaL(Unknown Source)
at com.google.android.gms.measurement.AppMeasurementContentProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1591)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1562)
at android.app.ActivityThread.installProvider(ActivityThread.java:4830)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4425)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4365)
at android.app.ActivityThread.access$1500(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1296)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:149)
at android.app.ActivityThread.main(ActivityThread.java:5061)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:603)
at dalvik.system.NativeStart.main(Native Method)

needed to add this in class that extends Application:
#Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
EDIT: I noticed this answer is becoming more popular so please note my comment on the question:
"ATTENTION To anybody reading this though! The real problem was that I was using the ENTIRE google play services framework which was forcing me into multi dex. Avoid multi dex if you can because it slows down builds. Only bring in what you need from google play services. So instead of putting "compile 'com.google.android.gms:play-services:8.1.0'", put "compile 'com.google.android.gms:play-services-location:8.1.0'" for example."

For those who have already activated MultiDex and still get this exception, it's just a stupid Android Studio / Gradle issue.
Try cleaning project, toggling Instant Run in settings, and rebuilding the project.

I had the error and i resolved it by updating the gms play-service to the latest version.

Related

java.lang.NoClassDefFoundError: com.google.android.gms.R$string at com.google.android.gms.common.internal.zzam.<init>(Unknown Source)

I am building an Android App and everything works correctly for Android 5.+. However, for Android 4.x, I am getting the following error when I try to compile using Android Studio:
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.google.android.gms.R$string
at com.google.android.gms.common.internal.zzam.<init>(Unknown Source)
at com.google.firebase.FirebaseOptions.fromResource(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1064)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5181)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4733)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4666)
at android.app.ActivityThread.access$1300(ActivityThread.java:166)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1439)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5455)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:966)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:733)
at dalvik.system.NativeStart.main(Native Method)
In my dependencies, I already tried both compile 'com.google.android.gms:play-services:+'
and also compile 'com.google.android.gms:play-services:9.8.0'.
I have been trying to find solutions online and people recommend to add Google Play Services dependencies, but I already did that. I had also tried compile 'com.android.support:multidex:1.0.0' but I do not think that would make any difference because in any case, I saw this message popping up in Android Studio:
"Instant Run does not support deploying build variants with multidex enabled, to a target with API level 20 or below.
To use Instant Run with a multidex enabled build variant, deploy to a target with API level 21 or higher."
Any hints? Thank you.
The solution was simply adding the following code in my class that extended Application:
#Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
The solution was at java.lang.NoClassDefFoundError: com.google.android.gms.internal.zzmp, so this question could be marked as duplicate.

UnsatisfiedLinkError: dlopen failed: cannot locate symbol "strtof" referenced by "libsupportjni.so" on API <20

I'm getting the following error immediately on launch, but only for devices running API <20.
**edit: I initially reported this in Android Studio 2.4, and it's still an issue in Android Studio 3.0 stable
D/dalvikvm: Trying to load lib /mnt/asec/[[packagename]]-1/lib/libsupportjni.so 0x41b13f30
E/dalvikvm: dlopen("/mnt/asec/[[packagename]]-1/lib/libsupportjni.so") failed: dlopen failed: cannot locate symbol "strtof" referenced by "libsupportjni.so"...
W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/android/tools/profiler/support/ProfilerService;
D/AndroidRuntime: Shutting down VM
W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41659ce0)
E/AndroidRuntime: FATAL EXCEPTION: main
Process: [[packagename]], PID: 7500
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "strtof" referenced by "libsupportjni.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:364)
at java.lang.System.loadLibrary(System.java:526)
at com.android.tools.profiler.support.ProfilerService.<clinit>(ProfilerService.java:44)
at [[packagename]].App.<init>(App.kt:25)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1208)
at android.app.Instrumentation.newApplication(Instrumentation.java:990)
at android.app.Instrumentation.newApplication(Instrumentation.java:975)
at android.app.LoadedApk.makeApplication(LoadedApk.java:509)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4446)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5146)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
at dalvik.system.NativeStart.main(Native Method)
Go to Run -> Edit Configurations -> Profiling, and disable "Enable advanced profiling". This feature is not currently compatible with API <20, and will cause this or similar crashes. This may be fixed in the future, but as of Android Studio 2.4 preview 7, it's an open issue. Related issue

Could not find class 'com.google.firebase.FirebaseOptions'

I have a working app and everything was working well, but when I updated it with MoPub app and generated a new signed APK and uploaded it to the play store some users reported a crash while it works well on other users' devices.
I tested the app a lot on different devices and finally found a device that it crashed on.
I debugged the app and found this error code in the android monitor
06-18 16:17:51.665 17951-17951/akhbar4all.com.akhbar4all W/dalvikvm:
VFY: unable to find class referenced in signature
(Lcom/google/firebase/auth/FirebaseUser;) 06-18 16:17:51.665
17951-17951/akhbar4all.com.akhbar4all E/dalvikvm: Could not find class
'com.google.firebase.FirebaseApp$zza', referenced from method
com.google.firebase.FirebaseApp.zza 06-18 16:17:51.665
17951-17951/akhbar4all.com.akhbar4all W/dalvikvm: VFY: unable to
resolve check-cast 9003 (Lcom/google/firebase/FirebaseApp$zza;) in
Lcom/google/firebase/FirebaseApp; 06-18 16:17:51.665
17951-17951/akhbar4all.com.akhbar4all D/dalvikvm: VFY: replacing
opcode 0x1f at 0x0019 06-18 16:17:51.665
17951-17951/akhbar4all.com.akhbar4all D/dalvikvm: DexOpt: unable to
opt direct call 0xec65 at 0x0b in
Lcom/google/firebase/FirebaseApp;.getToken 06-18 16:17:51.665
17951-17951/akhbar4all.com.akhbar4all D/AndroidRuntime: Shutting down
VM 06-18 16:17:51.665 17951-17951/akhbar4all.com.akhbar4all
W/dalvikvm: threadid=1: thread exiting with uncaught exception
(group=0x41bdc700) 06-18 16:17:51.685
17951-17951/akhbar4all.com.akhbar4all E/AndroidRuntime: FATAL
EXCEPTION: main
java.lang.NoClassDefFoundError: com.google.firebase.FirebaseOptions
at com.google.firebase.FirebaseApp.zzbu(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown
Source)
at
android.content.ContentProvider.attachInfo(ContentProvider.java:1214)
at
android.content.ContentProvider.attachInfo(ContentProvider.java:1189)
at
com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown
Source)
at
android.app.ActivityThread.installProvider(ActivityThread.java:5119)
at
android.app.ActivityThread.installContentProviders(ActivityThread.java:4725)
at
android.app.ActivityThread.handleBindApplication(ActivityThread.java:4665)
at android.app.ActivityThread.access$1400(ActivityThread.java:159)
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1376)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5419)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
at dalvik.system.NativeStart.main(Native Method)
But I was shocked because I didn't use any Firebase api so why is this happening and what is the solution? I'd be happy for any help from someone.
I resolved the problem.
The problem was that their is an error in firebase including latest google play services 9.0.2
So i choose only the google play services that i need and not the whole services excluding (firebase) and everything works well
To setup google services by what you need and don't include the whole services visit this link
Thanks, I had also compiled the multidex class to solve my problem but it made my application a little heavier, now it is better optimized!
This is to compile only the google services that you are going to use and not all with the compile statement 'com.google.android.gms: play-services: 9.0.0'
Now my gradle file looks like this
//compile 'com.android.support:multidex:1.0.0'
//compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.firebase:firebase-messaging:9.0.0'
compile 'com.google.firebase:firebase-core:9.0.0'
compile 'com.google.firebase:firebase-database:9.0.0'
compile 'com.google.android.gms:play-services-location:9.0.0'

Unable to extract the trust manager on a.a.k#... - PayPal-Android-SDK 2.13.3

I recently updated my Song Scrapbook app to the latest version and also made sure to update all third-party APIs used by the app. One such third-party tool is the PayPal Android SDK which I use to monetize my app since I live in a country where the Google Wallet Merchant service is currently not supported - which means I cannot use the Play Store in-app or once-off purchase systems in my app.
However, after updating the PayPal SDK to the latest version in my app (via mavenCentral) I get the following error in Android Studio (version: 1.5.1) everytime I want to execute a PayPal transaction:
debug W/paypal.sdk: PayPalService created. API:19 PayPalSDK/PayPal-Android-SDK 2.13.3 (Android 4.4.4; samsung GT-I9060I; )
03-20 16:58:45.540 7804-7804/com.whitsoft.songscrapbook.debug W/ApplicationPackageManager: getCSCPackageItemText()
03-20 16:58:45.550 7804-7804/com.whitsoft.songscrapbook.debug W/ApplicationPackageManager: getCSCPackageItemText()
03-20 16:58:45.550 7804-7804/com.whitsoft.songscrapbook.debug I/dalvikvm: Could not find method com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable, referenced from method com.paypal.android.sdk.at.a
03-20 16:58:45.550 7804-7804/com.whitsoft.songscrapbook.debug W/dalvikvm: VFY: unable to resolve static method 10405: Lcom/google/android/gms/common/GooglePlayServicesUtil;.isGooglePlayServicesAvailable (Landroid/content/Context;)I
03-20 16:58:45.610 7804-7804/com.whitsoft.songscrapbook.debug I/dalvikvm: Could not find method io.card.payment.CardIOActivity.checkSelfPermission, referenced from method io.card.payment.CardIOActivity.onCreate
03-20 16:58:45.610 7804-7804/com.whitsoft.songscrapbook.debug W/dalvikvm: VFY: unable to resolve virtual method 13172: Lio/card/payment/CardIOActivity;.checkSelfPermission (Ljava/lang/String;)I
03-20 16:58:45.820 7804-7843/com.whitsoft.songscrapbook.debug I/System: Loaded time zone names for "en" in 132ms (127ms in ICU)
03-20 16:58:45.840 7804-7804/com.whitsoft.songscrapbook.debug W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x4168cbc0)
03-20 16:58:45.840 7804-7804/com.whitsoft.songscrapbook.debug E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.whitsoft.songscrapbook.debug, PID: 7804
java.lang.RuntimeException: Unable to start service com.paypal.android.sdk.payments.PayPalService#41e9c5a0 with Intent { cmp=com.whitsoft.songscrapbook.debug/com.paypal.android.sdk.payments.PayPalService (has extras) }: java.lang.IllegalStateException: Unable to extract the trust manager on a.a.k#41ff61a0, sslSocketFactory is class com.paypal.android.sdk.bn
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2987)
at android.app.ActivityThread.access$2100(ActivityThread.java:166)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1380)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5584)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: Unable to extract the trust manager on a.a.k#41ff61a0, sslSocketFactory is class com.paypal.android.sdk.bn
at a.ak.<init>(Unknown Source)
at a.ak.<init>(Unknown Source)
at a.am.b(Unknown Source)
at com.paypal.android.sdk.bt.<init>(Unknown Source)
at com.paypal.android.sdk.payments.PayPalService.a(Unknown Source)
at com.paypal.android.sdk.payments.PayPalService.onStartCommand(Unknown Source)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2970)
at android.app.ActivityThread.access$2100(ActivityThread.java:166) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1380) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5584) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084) 
at dalvik.system.NativeStart.main(Native Method) 
03-20 17:03:46.103 7804-7804/? I/Process: Sending signal. PID: 7804 SIG: 9
I know this problem is not caused by the device on which I tested the app - as I have tested this app on two very different devices (Samsung Grand Neo and Cubot X15) and both devices produced similar errors. I tried googling the problem to try and solve the problem but after hours of searching found no solution.
Any assistance will be much appreciated.
SilSur.
So it took me roughly 5 hours to figure this one out - which I achieved through a step-by-step elimination of possible causes of the problem.
Turns out the real problem was my haste in trying to update the app. The reason being that the PayPal SDK 2.13.3 version has a new rule in the 'proguard-rules.pro' file that is very important to include:
Rule as follows:
# This is added for okhttp 3.1.2 bug fix as shown at https://github.com/square/okhttp/issues/2323
-keepclassmembers class * implements javax.net.ssl.SSLSocketFactory {
private javax.net.ssl.SSLSocketFactory delegate;
}
This prevents the minify (obfuscation) process of Gradle from removing IMPORTANT code from a previous bug-fix in the PayPal SDK that caused problems with the secure layer socket factory. So yeah - that was the fix: the updated app now works perfectly (just as required).
Lesson learnt: make sure your 'proguard-rules' are exactly as they are suppose to be!
Over & Out, SilSur.

Errors related to Android NDK

Running this in my android device gives me these errors.
Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lffvideolivewallpaper/frankandrobot/com/NativeCalls;
Shutting down VM
threadid=1: thread exiting with uncaught exception (group=0x40ed42a0)
FATAL EXCEPTION: main
java.lang.ExceptionInInitializerError
at ffvideolivewallpaper.frankandrobot.com.VideoLiveWallpaper.onSharedPreferenceChanged(VideoLiveWallpaper.java:144)
at ffvideolivewallpaper.frankandrobot.com.VideoLiveWallpaper.onCreate(VideoLiveWallpaper.java:78)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2404)
at android.app.ActivityThread.access$1600(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1309)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load avcore: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:365)
at java.lang.System.loadLibrary(System.java:535)
at ffvideolivewallpaper.frankandrobot.com.NativeCalls.(NativeCalls.java:42)
... 13 more
I think these errors are related to Android NDK. Can anyone guide me on this, keeping in mind that I have no prior knowledge of Android NDK and how it works.
This may happen if we install the app on a device where the previous version was already installed we always get this kind of error:
Just look at this similar problem : https://groups.google.com/d/topic/android-ndk/YmKly4zEMQ0/discussion
I found the reason why I was getting this error, because I did not build the native libraries. I used ndk-build and the errors got resolved.

Categories

Resources