使用 Firebase Notification 时,Facebook 工具包会生成 VerifyError
When using Firebase Notification, Facebook kit makes VerifyError
我正在使用 Facebook Kit 登录。它工作正常但是当我将 firebase 消息添加到我的应用程序时,它在单击登录按钮时崩溃,Firebase 通知工作正常。谁能给我解决方案
错误日志:
FATAL EXCEPTION: main
Process: xyz.sheba.bondhu, PID: 20884
java.lang.VerifyError: Rejecting class com.google.android.gms.internal.zzasm because it failed compile-time verification (declaration of 'com.google.android.gms.internal.zzasm' appears in /data/app/xyz.sheba.bondhu-2/base.apk:classes20.dex)
at com.google.android.gms.auth.api.Auth.<clinit>(Unknown Source)
at com.facebook.accountkit.ui.AccountKitActivity.onCreate(AccountKitActivity.java:348)
at android.app.Activity.performCreate(Activity.java:6303)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2376)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2483)
at android.app.ActivityThread.access0(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5442)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
我的Gradle:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'de.hdodenhof:circleimageview:1.2.1'
compile 'com.facebook.android:account-kit-sdk:4.+'
compile 'com.github.stfalcon:smsverifycatcher:0.3.1'
compile 'cn.pedant.sweetalert:library:1.3'
// Retrofit
compile 'com.squareup.retrofit2:retrofit:2.1.0'
// JSON Parsing
compile 'com.google.code.gson:gson:2.6.1'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'pub.devrel:easypermissions:0.4.2'
compile 'org.jsoup:jsoup:1.8.3'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-messaging:11.0.4'
compile 'com.firebase:firebase-jobdispatcher:0.6.0'
compile 'com.android.support:multidex:1.0.0'
}
apply plugin: 'com.google.gms.google-services'
试了各种方法都解决不了这个问题。然后我阅读了他们所有的(facebook、firebase、google 地图)文档并找到了解决方案。
在那种情况下,当我单独使用compile 'com.google.firebase:firebase-messaging:11.0.4'
时,它工作正常。但是当我同时使用 compile 'com.facebook.android:account-kit-sdk:4.+'
和 com.google.firebase:firebase-messaging:11.0.4'
时,它会串通一气,因为 facebook kit 4.+ 不支持 firebase 11.0.4。它只支持 11.0.1。这就是问题所在。
所以使用
com.google.firebase:firebase-messaging:11.0.1'
这将解决问题。
我正在使用 Facebook Kit 登录。它工作正常但是当我将 firebase 消息添加到我的应用程序时,它在单击登录按钮时崩溃,Firebase 通知工作正常。谁能给我解决方案
错误日志:
FATAL EXCEPTION: main
Process: xyz.sheba.bondhu, PID: 20884
java.lang.VerifyError: Rejecting class com.google.android.gms.internal.zzasm because it failed compile-time verification (declaration of 'com.google.android.gms.internal.zzasm' appears in /data/app/xyz.sheba.bondhu-2/base.apk:classes20.dex)
at com.google.android.gms.auth.api.Auth.<clinit>(Unknown Source)
at com.facebook.accountkit.ui.AccountKitActivity.onCreate(AccountKitActivity.java:348)
at android.app.Activity.performCreate(Activity.java:6303)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2376)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2483)
at android.app.ActivityThread.access0(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5442)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
我的Gradle:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'de.hdodenhof:circleimageview:1.2.1'
compile 'com.facebook.android:account-kit-sdk:4.+'
compile 'com.github.stfalcon:smsverifycatcher:0.3.1'
compile 'cn.pedant.sweetalert:library:1.3'
// Retrofit
compile 'com.squareup.retrofit2:retrofit:2.1.0'
// JSON Parsing
compile 'com.google.code.gson:gson:2.6.1'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'pub.devrel:easypermissions:0.4.2'
compile 'org.jsoup:jsoup:1.8.3'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-messaging:11.0.4'
compile 'com.firebase:firebase-jobdispatcher:0.6.0'
compile 'com.android.support:multidex:1.0.0'
}
apply plugin: 'com.google.gms.google-services'
试了各种方法都解决不了这个问题。然后我阅读了他们所有的(facebook、firebase、google 地图)文档并找到了解决方案。
在那种情况下,当我单独使用compile 'com.google.firebase:firebase-messaging:11.0.4'
时,它工作正常。但是当我同时使用 compile 'com.facebook.android:account-kit-sdk:4.+'
和 com.google.firebase:firebase-messaging:11.0.4'
时,它会串通一气,因为 facebook kit 4.+ 不支持 firebase 11.0.4。它只支持 11.0.1。这就是问题所在。
所以使用
com.google.firebase:firebase-messaging:11.0.1'
这将解决问题。