Android Studio - BaseGameActivity App启动失败

时间:2017-06-30 20:09:23

标签: java android helper

一切都还可以,但应用程序无法启动。我在等你的帮忙。

build.gradle:

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.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.balysv:material-ripple:1.0.2'
compile 'com.github.Todd-Davies:ProgressWheel:1.2'
compile files('android-support-v4.jar')
compile 'com.google.android.gms:play-services-ads:11.0.1'
compile 'com.google.android.gms:play-services:11.0.2'
compile 'com.github.traex.rippleeffect:library:1.3'
compile 'com.google.android.gms:play-services-appstate:7.8.0'

错误讯息:

06-30 23:00:31.833 18360-18360/********************************.quiz E/AndroidRuntime: FATAL EXCEPTION: main                                                                                       Process: ********************************.quiz, PID: 18360
java.lang.NoSuchMethodError: No direct method <init>(Ljava/lang/String;Lcom/google/android/gms/common/api/Api$zza;Lcom/google/android/gms/common/api/Api$zzc;)V in class Lcom/google/android/gms/common/api/Api; or its super classes (declaration of 'com.google.android.gms.common.api.Api' appears in /data/app/********************************.quiz-1/base.apk:classes29.dex)                                                                                               at com.google.android.gms.appstate.AppStateManager.<clinit>(Unknown Source)
   at ********************************.quiz.game.GameHelper.createApiClientBuilder(GameHelper.java:169)
   at ********************************.quiz.game.GameHelper.setup(GameHelper.java:189)
   at ********************************.quiz.game.BaseGameActivity.onCreate(BaseGameActivity.java:98)
   at ********************************.quiz.ActivityHome.onCreate(ActivityHome.java:115)
   at android.app.Activity.performCreate(Activity.java:6876)
   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3207)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)
   at android.app.ActivityThread.access$1100(ActivityThread.java:222)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:158)
   at android.app.ActivityThread.main(ActivityThread.java:7229)
   at java.lang.reflect.Method.invoke(Native Method)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

1 个答案:

答案 0 :(得分:1)

Gms版本应该是相同的:

compile 'com.google.android.gms:play-services-ads:11.0.2'
compile 'com.google.android.gms:play-services:11.0.2'