web-dev-qa-db-ja.com

次の解決に失敗しました:Lcom / google / Android / gms / common / api / Api $ zzf;

アプリケーションのapkファイルを実行すると、このエラーが発生しました。 build.gradle multidexを設定し、multidexをコンパイルしてGradleファイルに保存します。 Firebaseのバージョンを上下に変更しましたが、うまくいきませんでした。これは、実行コンソールの完全なログです。

D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: ir.parsinteam.ojoobe, PID: 5141
                  Java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/Android/gms/common/api/Api$zzf;
                      at com.google.Android.gms.location.LocationServices.<clinit>(Unknown Source)
                      at ir.adad.client.LocationMethods.callAndroidLocationService(LocationMethods.Java:101)
                      at ir.adad.client.LocationMethods.<init>(LocationMethods.Java:40)
                      at ir.adad.client.LocationMethods.getInstance(LocationMethods.Java:45)
                      at ir.adad.client.AdadScript.urlParameters(AdadScript.Java:390)
                      at ir.adad.client.AdadScript.downloadClient(AdadScript.Java:148)
                      at ir.adad.client.AdadScript.initializeInternal(AdadScript.Java:134)
                      at ir.adad.client.AdadScript.initializeClient(AdadScript.Java:110)
                      at ir.adad.client.Adad.initialize(Adad.Java:22)
                      at ir.parsinteam.ojoobe.activities.MainActivity.onCreate(MainActivity.Java:62)
                      at Android.app.Activity.performCreate(Activity.Java:6662)
                      at Android.app.Instrumentation.callActivityOnCreate(Instrumentation.Java:1118)
                      at Android.app.ActivityThread.performLaunchActivity(ActivityThread.Java:2599)
                      at Android.app.ActivityThread.handleLaunchActivity(ActivityThread.Java:2707)
                      at Android.app.ActivityThread.-wrap12(ActivityThread.Java)
                      at Android.app.ActivityThread$H.handleMessage(ActivityThread.Java:1460)
                      at Android.os.Handler.dispatchMessage(Handler.Java:102)
                      at Android.os.Looper.loop(Looper.Java:154)
                      at Android.app.ActivityThread.main(ActivityThread.Java:6077)
                      at Java.lang.reflect.Method.invoke(Native Method)
                      at com.Android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.Java:866)
                      at com.Android.internal.os.ZygoteInit.main(ZygoteInit.Java:756)
                   Caused by: Java.lang.ClassNotFoundException: Didn't find class "com.google.Android.gms.common.api.Api$zzf" on path: DexPathList[[Zip file "/data/app/ir.parsinteam.ojoobe-2/base.apk", Zip file "/data/app/ir.parsinteam.ojoobe-2/split_lib_dependencies_apk.apk", Zip file "/data/app/ir.parsinteam.ojoobe-2/split_lib_slice_0_apk.apk", Zip file "/data/app/ir.parsinteam.ojoobe-2/split_lib_slice_1_apk.apk", Zip file "/data/app/ir.parsinteam.ojoobe-2/split_lib_slice_2_apk.apk", Zip file "/data/app/ir.parsinteam.ojoobe-2/split_lib_slice_3_apk.apk", Zip file "/data/app/ir.parsinteam.ojoobe-2/split_lib_slice_4_apk.apk", Zip file "/data/app/ir.parsinteam.ojoobe-2/split_lib_slice_5_apk.apk", Zip file "/data/app/ir.parsinteam.ojoobe-2/split_lib_slice_6_apk.apk", Zip file "/data/app/ir.parsinteam.ojoobe-2/split_lib_slice_7_apk.apk", Zip file "/data/app/ir.parsinteam.ojoobe-2/split_lib_slice_8_apk.apk", Zip file "/data/app/ir.parsinteam.ojoobe-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/ir.parsinteam.ojoobe-2/lib/x86, /data/app/ir.parsinteam.ojoobe-2/base.apk!/lib/x86, /data/app/ir.parsinteam.ojoobe-2/split_lib_dependencies_apk.apk!/lib/x86, /data/app/ir.parsinteam.ojoobe-2/split_lib_slice_0_apk.apk!/lib/x86, /data/app/ir.parsinteam.ojoobe-2/split_lib_slice_1_apk.apk!/lib/x86, /data/app/ir.parsinteam.ojoobe-2/split_lib_slice_2_apk.apk!/lib/x86, /data/app/ir.parsinteam.ojoobe-2/split_lib_slice_3_apk.apk!/lib/x86, /data/app/ir.parsinteam.ojoobe-2/split_lib_slice_4_apk.apk!/lib/x86, /data/app/ir.parsinteam.ojoobe-2/split_lib_slice_5_apk.apk!/lib/x86, /data/app/ir.parsinteam.ojoobe-2/split_lib_slice_6_apk.apk!/lib/x86, /data/app/ir.parsinteam.ojoobe-2/split_lib_slice_7_apk.apk!/lib/x86, /data/app/ir.parsinteam.ojoobe-2/split_lib_slice_8_apk.apk!/lib/x86, /data/app/ir.parsinteam.ojoobe-2/split_lib_slice_9_apk.apk!/lib/x86, /system/lib, /vendor/lib]]
                      at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.Java:56)
                      at Java.lang.ClassLoader.loadClass(ClassLoader.Java:380)
                      at Java.lang.ClassLoader.loadClass(ClassLoader.Java:312)
                      at com.google.Android.gms.location.LocationServices.<clinit>(Unknown Source) 
                      at ir.adad.client.LocationMethods.callAndroidLocationService(LocationMethods.Java:101) 
                      at ir.adad.client.LocationMethods.<init>(LocationMethods.Java:40) 
                      at ir.adad.client.LocationMethods.getInstance(LocationMethods.Java:45) 
                      at ir.adad.client.AdadScript.urlParameters(AdadScript.Java:390) 
                      at ir.adad.client.AdadScript.downloadClient(AdadScript.Java:148) 
                      at ir.adad.client.AdadScript.initializeInternal(AdadScript.Java:134) 
                      at ir.adad.client.AdadScript.initializeClient(AdadScript.Java:110) 
                      at ir.adad.client.Adad.initialize(Adad.Java:22) 
                      at ir.parsinteam.ojoobe.activities.MainActivity.onCreate(MainActivity.Java:62) 
                      at Android.app.Activity.performCreate(Activity.Java:6662) 
                      at Android.app.Instrumentation.callActivityOnCreate(Instrumentation.Java:1118) 
                      at Android.app.ActivityThread.performLaunchActivity(ActivityThread.Java:2599) 
                      at Android.app.ActivityThread.handleLaunchActivity(ActivityThread.Java:2707) 
                      at Android.app.ActivityThread.-wrap12(ActivityThread.Java) 
                      at Android.app.ActivityThread$H.handleMessage(ActivityThread.Java:1460) 
                      at Android.os.Handler.dispatchMessage(Handler.Java:102) 
                      at Android.os.Looper.loop(Looper.Java:154) 
                      at Android.app.ActivityThread.main(ActivityThread.Java:6077) 
                      at Java.lang.reflect.Method.invoke(Native Method) 
                      at com.Android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.Java:866) 
                      at com.Android.internal.os.ZygoteInit.main(ZygoteInit.Java:756) 
Application terminated.
8
Mister X

Build.gradleで、play-services-gcmとplay-services-locationを15.0.1にアップグレードします。

com.google.Android.gms:play-services-gcm:15.0.1
com.google.Android.gms:play-services-location:15.0.1
14
Brad Pitcher

これは、AccountKitFirebaseAuthのような認証サービスでユーザーを認証しようとしたときに発生し、それらのサービスはplay-services-authだから、追加

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

build.gradleの依存関係

10

この問題を修正しました。以下のコードに従ってください。以下をAndroid/build.gradleに追加しました

allprojects {
    repositories {
    //start here
    configurations.all {
 resolutionStrategy.eachDependency { DependencyResolveDetails details ->
   def requested = details.requested
       if (requested.group == 'com.google.Android.gms') {
          details.useVersion '12.0.1'
       }
       if (requested.group == 'com.google.firebase') {
          details.useVersion '12.0.1'
         }
       }
     }
    //end
     jcenter()
       maven {
         url "https://maven.google.com"
       }
     }
 }
6
Harika

まあ、私はFacebookからアカウントキットを使用しています。 play-services-authを追加した後、問題は解決しました。

implementation 'com.facebook.Android:account-kit-sdk:4.39.0'

implementation 'com.google.Android.gms:play-services-auth:17.0.0'
2
Shihab Uddin

反応するネイティブパッケージを使用していた

react-native-facebook-account-kit

追加することにより解決

implementation 'com.google.Android.gms:play-services-auth:16.0.1'
0
RodneyO