Monday, October 8, 2018

java.lang.VerifyError on Android Studio 3.2 Upgrade

Leave a Comment

I've looked around and tried to clean my build folders, invalidate cache & restart, and set android.enableR8=false

But I still can't get past this issue when I build a release apk and try running the app.

2018-09-26 23:07:19.428 19200-19200/? E/AndroidRuntime: FATAL EXCEPTION: main     Process: sic.nzb.app, PID: 19200     java.lang.VerifyError: Verifier rejected class com.google.firebase.FirebaseApp: void com.google.firebase.FirebaseApp.<clinit>() failed to verify: void com.google.firebase.FirebaseApp.<clinit>(): [0x33] register v1 has type Uninitialized Reference: java.lang.Object Allocation PC: 49 but expected Reference: java.lang.Object      void com.google.firebase.FirebaseApp.<init>(android.content.Context, java.lang.String, com.google.firebase.FirebaseOptions) failed to verify: void com.google.firebase.FirebaseApp.<init>(android.content.Context, java.lang.String, com.google.firebase.FirebaseOptions): [0x4B] 'this' arg must be initialized (declaration of 'com.google.firebase.FirebaseApp' appears in base.apk)         at com.google.firebase.FirebaseApp.a(SourceFile:274)         at com.google.firebase.provider.FirebaseInitProvider.onCreate(SourceFile:37)         at android.content.ContentProvider.attachInfo(ContentProvider.java:1917)         at android.content.ContentProvider.attachInfo(ContentProvider.java:1892)         at com.google.firebase.provider.FirebaseInitProvider.attachInfo(SourceFile:31)         at android.app.ActivityThread.installProvider(ActivityThread.java:6391)         at android.app.ActivityThread.installContentProviders(ActivityThread.java:5938)         at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5853)         at android.app.ActivityThread.access$1100(ActivityThread.java:199)         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)         at android.os.Handler.dispatchMessage(Handler.java:106)         at android.os.Looper.loop(Looper.java:193)         at android.app.ActivityThread.main(ActivityThread.java:6669)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 

gradle dependencies:

dependencies { implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.6'   implementation project(':oIFileManager') implementation project(':FullScreenActivity') implementation rootProject.ext.libraries.appcompatv7 implementation rootProject.ext.libraries.supportdesign implementation 'org.jsoup:jsoup:1.11.3' implementation project(path: ':unrar-native') implementation 'com.google.guava:guava:23.0-android'  implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5' implementation 'com.google.firebase:firebase-core:16.0.3' implementation 'com.google.firebase:firebase-messaging:17.3.2'  testImplementation 'junit:junit:4.12' testImplementation 'org.mockito:mockito-all:1.10.19' testImplementation 'org.powermock:powermock-module-junit4:1.6.2' testImplementation 'org.powermock:powermock-api-mockito:1.6.2' testImplementation group: 'org.apache.commons', name: 'commons-io', version: '1.3.2'  implementation 'com.android.support.constraint:constraint-layout:1.1.3' androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2', {     exclude group: 'com.android.support', module: 'support-annotations' } 

}

2 Answers

Answers 1

This is because your older firebase dependencies is being referenced and there must be some changes related to classes which cause the "VerifyError". So, you need to delete your .gradle folder under your home directory, e.g. ~/.gradle for Linux or macOS, as well as the .gradle under your project root directory. Also, try to delete all the cached .m2 folders under your home dir ~/ as well.

Answers 2

Try downgrade firebase-messaging

I am use com.google.firebase:firebase-messaging:11.6.2 and it is so old , so i don't think its a good idea to this much downgrade but it will fix by downgrading.

it is always happend on google library's

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment