应用程序在模拟器/真实模式下崩溃,Api $ zzf错误?

时间:2018-11-29 11:02:05

标签: java android android-studio

我正在尝试完成我的应用程序,它可以导出到android studio中的APK,但是在模拟器手机上打开该应用程序时,它说GAME已停止。我以下是在手机上对其进行测试时android studio日志中的错误红色文本。

E/MultiWindowProxy: getServiceInstance failed!
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: PACKAGEID, PID: NUMBER
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/Api$zzf;
        at com.google.android.gms.plus.Plus.<clinit>(Unknown Source)
        at com.secrethq.utils.PTServicesBridge.initBridge(PTServicesBridge.java:84)
        at PACKAGEID.PTPlayer.onCreate(PTPlayer.java:48)
        at android.app.Activity.performCreate(Activity.java:6309)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2615)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2750)
        at android.app.ActivityThread.-wrap11(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1579)
        at android.os.Handler.dispatchMessage(Handler.java:111)
        at android.os.Looper.loop(Looper.java:207)
        at android.app.ActivityThread.main(ActivityThread.java:5893)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.api.Api$zzf" on path: DexPathList[[zip file "/data/app/PACKAGEID-1/base.apk", zip file "/data/app/PACKAGEID-1/split_lib_dependencies_apk.apk", zip file "/data/app/PACKAGEID-1/split_lib_slice_0_apk.apk", zip file "/data/app/PACKAGEID-1/split_lib_slice_1_apk.apk", zip file "/data/app/PACKAGEID-1/split_lib_slice_2_apk.apk", zip file "/data/app/PACKAGEID-1/split_lib_slice_3_apk.apk", zip file "/data/app/PACKAGEID-1/split_lib_slice_4_apk.apk", zip file "/data/app/PACKAGEID-1/split_lib_slice_5_apk.apk", zip file "/data/app/PACKAGEID-1/split_lib_slice_6_apk.apk", zip file "/data/app/PACKAGEID-1/split_lib_slice_7_apk.apk", zip file "/data/app/PACKAGEID-1/split_lib_slice_8_apk.apk", zip file "/data/app/PACKAGEID-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/PACKAGEID-1/lib/arm, /data/app/PACKAGEID-1/base.apk!/lib/armeabi-v7a, /data/app/PACKAGEID-1/split_lib_dependencies_apk.apk!/lib/armeabi-v7a, /data/app/PACKAGEID-1/split_lib_slice_0_apk.apk!/lib/armeabi-v7a, /data/app/PACKAGEID-1/split_lib_slice_1_apk.apk!/lib/armeabi-v7a, /data/app/PACKAGEID-1/split_lib_slice_2_apk.apk!/lib/armeabi-v7a, /data/app/PACKAGEID-1/split_lib_slice_3_apk.apk!/lib/armeabi-v7a, /data/app/PACKAGEID-1/split_lib_slice_4_apk.apk!/lib/armeabi-v7a, /data/app/PACKAGEID-1/split_lib_slice_5_apk.apk!/lib/armeabi-v7a, /data/app/PACKAGEID-1/split_lib_slice_6_apk.apk!/lib/armeabi-v7a, /data/app/PACKAGEID-1/split_lib_slice_7_apk.apk!/lib/armeabi-v7a, /data/app/PACKAGEID-1/split_lib_slice_8_apk.apk!/lib/armeabi-v7a, /data/app/PACKAGEID-1/split_lib_slice_9_apk.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
        at com.google.android.gms.plus.Plus.<clinit>(Unknown Source) 
        at com.secrethq.utils.PTServicesBridge.initBridge(PTServicesBridge.java:84) 
        at PACKAGEID.PTPlayer.onCreate(PTPlayer.java:48) 
        at android.app.Activity.performCreate(Activity.java:6309) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2615) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2750) 
        at android.app.ActivityThread.-wrap11(ActivityThread.java) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1579) 
        at android.os.Handler.dispatchMessage(Handler.java:111) 
        at android.os.Looper.loop(Looper.java:207) 
        at android.app.ActivityThread.main(ActivityThread.java:5893) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679) 
        Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.common.api.Api$zzf
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
                ... 16 more
     Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
Application terminated.

我正在使用buildbox导出我的游戏,并且已经将APP ID和admob ID(我正在使用admob)输入到androidmanifest中,但是仍然显示此错误。 我的build.gradle是:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId "PACKAGEID"
        minSdkVersion 14
        targetSdkVersion 28
        multiDexEnabled true

        ndk {
            moduleName "player_shared"
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
    productFlavors {
    }
}
allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}
dependencies {
    implementation 'com.google.android.gms:play-services:+'
    implementation 'com.android.support:multidex:1.0.3'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.google.android.gms:play-services-ads:16.0.0'
    implementation 'com.google.firebase:firebase-database:16.0.5'
    implementation 'com.google.firebase:firebase-auth:16.0.5'
    implementation 'com.google.android.gms:play-services-auth:16.0.0'
    // More deps here //
}

我尝试将所有版本更改为相同,+和各种版本,但是id不起作用。有谁知道我该如何解决这个问题?谢谢。

0 个答案:

没有答案