Facebook帐户工具包:NoClassDefFoundError

时间:2018-07-25 16:25:34

标签: java android facebook account-kit

我在android studio Facebook帐户工具包中遇到此错误

Failed resolution of: Lcom/google/android/gms/common/api/Api$zzf;

详细日志

  

07-25 16:23:41.683 20088-20088 / com.nazir.shopping E / AndroidRuntime:   致命异常:主要       流程:com.nazir.shopping,PID:20088       java.lang.NoClassDefFoundError:无法解决以下问题:Lcom / google / android / gms / common / api / Api $ zzf;           在com.google.android.gms.auth.api.Auth。(未知来源:0)           在com.facebook.accountkit.ui.AccountKitActivity.onCreate(AccountKitActivity.java:281)           在android.app.Activity.performCreate(Activity.java:7117)           在android.app.Activity.performCreate(Activity.java:7108)           在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1262)           在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2867)           在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3027)           在android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)           在android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:101)           在android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:73)           在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1786)           在android.os.Handler.dispatchMessage(Handler.java:106)           在android.os.Looper.loop(Looper.java:164)           在android.app.ActivityThread.main(ActivityThread.java:6656)           在java.lang.reflect.Method.invoke(本机方法)           在com.android.internal.os.RuntimeInit $ MethodAndArgsCaller.run(RuntimeInit.java:438)           在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)        原因:java.lang.ClassNotFoundException:在路径:DexPathList [[zip]中找不到类“ com.google.android.gms.common.api.Api $ zzf”   文件“ /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/base.apk”,   压缩文件   “ /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_dependencies_apk.apk”,   压缩文件   “ /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_resources_apk.apk”,   压缩文件   “ /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_0_apk.apk”,   压缩文件   “ /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_1_apk.apk”,   压缩文件   “ /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_2_apk.apk”,   压缩文件   “ /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_3_apk.apk”,   压缩文件   “ /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_4_apk.apk”,   压缩文件   “ /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_5_apk.apk”,   压缩文件   “ /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_6_apk.apk”,   压缩文件   “ /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_7_apk.apk”,   压缩文件   “ /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_8_apk.apk”,   压缩文件   “ /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.nazir.shopping-VZh5unWKQWN/7d8SWHtJb   /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/base.apk!/lib/x86,   /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_dependencies_apk.apk!/lib/x86,   /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_resources_apk.apk!/lib/x86,   /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_0_apk.apk!/lib/x86,   /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_1_apk.apk!/lib/x86,   /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_2_apk.apk!/lib/x86,   /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_3_apk.apk!/lib/x86,   /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_4_apk.apk!/lib/x86,   /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_5_apk.apk!/lib/x86,   /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_6_apk.apk!/lib/x86,   /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_7_apk.apk!/lib/x86,   /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_8_apk.apk!/lib/x86,   /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_slice_9_apk.apk!/lib/x86,   / system / lib]]           在dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)           在java.lang.ClassLoader.loadClass(ClassLoader.java:379)           在java.lang.ClassLoader.loadClass(ClassLoader.java:312)             ...另外17个         禁止:java.io.IOException:找不到用于dex位置的原始dex文件   /data/app/com.nazir.shopping-VZh5unWKQWN7d8SWHtKjbw==/split_lib_resources_apk.apk           在dalvik.system.DexFile.openDexFileNative(本机方法)           在dalvik.system.DexFile.openDexFile(DexFile.java:356)           在dalvik.system.DexFile。(DexFile.java:103)           在dalvik.system.DexFile。(DexFile.java:77)           在dalvik.system.DexPathList.loadDexFile(DexPathList.java:374)           在dalvik.system.DexPathList.makeDexElements(DexPathList.java:337)           在dalvik.system.DexPathList。(DexPathList.java:157)           在dalvik.system.BaseDexClassLoader。(BaseDexClassLoader.java:65)           在dalvik.system.PathClassLoader。(PathClassLoader.java:64)           在com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)           在com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)           在android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:72)           在android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:38)           在android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:713)           在android.app.LoadedApk.getClassLoader(LoadedApk.java:747)           在android.app.LoadedApk.getResources(LoadedApk.java:969)           在android.app.ContextImpl.createAppContext(ContextImpl.java:2298)           在android.app.ActivityThread.handleBindApplication(ActivityThread.java:5754)           在android.app.ActivityThread.access $ 1100(ActivityThread.java:193)           在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1623)                 ...还有6个

2 个答案:

答案 0 :(得分:9)

当我们尝试使用AccountKit FirebaseAuth之类的身份验证服务对用户进行身份验证并且这些服务取决于play-services-auth时,就会发生这种情况,因此,添加

implementation 'com.google.android.gms:play-services-auth:16.0.0'

将此添加到依赖项中。

答案 1 :(得分:3)

implementation 'com.facebook.android:account-kit-sdk:4.37.0'
implementation "com.google.android.gms:play-services-auth-api-phone:16.0.0"
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.android.gms:play-services-base:16.0.1'

只需更新即可使用。