gpt4 book ai didi

android - 无法实例化 GoogleApiClient

转载 作者:行者123 更新时间:2023-11-29 15:42:17 24 4
gpt4 key购买 nike

这是我尝试实例化它的代码:

gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.build();
mGoogleApiClient = new GoogleApiClient.Builder(PSSignInFlowActivity.this)
.enableAutoManage(this/* FragmentActivity */, new GoogleApiClient.OnConnectionFailedListener() {
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {

}
} /* OnConnectionFailedListener */)
.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
.build();

这是我的 build.gradle 中的内容:

 compile 'com.google.android.gms:play-services-maps:+'
compile 'com.google.android.gms:play-services-location:+'
compile 'com.google.android.gms:play-services-gcm:+'
compile 'com.google.android.gms:play-services-analytics:+'
compile 'com.google.android.gms:play-services-auth:9.0.2'

我收到这个错误:

07-19 11:23:47.668: E/AndroidRuntime(2275): FATAL EXCEPTION: main
07-19 11:23:47.668: E/AndroidRuntime(2275): Process: nl.hgrams.passenger, PID: 2275
07-19 11:23:47.668: E/AndroidRuntime(2275): java.lang.NoSuchMethodError: No virtual method zztw()Ljava/util/Set; in class Lcom/google/android/gms/common/internal/zzg; or its super classes (declaration of 'com.google.android.gms.common.internal.zzg' appears in /data/app/nl.hgrams.passenger-1/base.apk)
07-19 11:23:47.668: E/AndroidRuntime(2275): at com.google.android.gms.auth.api.signin.internal.zzd.<init>(Unknown Source)
07-19 11:23:47.668: E/AndroidRuntime(2275): at com.google.android.gms.auth.api.Auth$4.zza(Unknown Source)
07-19 11:23:47.668: E/AndroidRuntime(2275): at com.google.android.gms.auth.api.Auth$4.zza(Unknown Source)
07-19 11:23:47.668: E/AndroidRuntime(2275): at com.google.android.gms.common.api.GoogleApiClient$Builder.zza(Unknown Source)
07-19 11:23:47.668: E/AndroidRuntime(2275): at com.google.android.gms.common.api.GoogleApiClient$Builder.zzaof(Unknown Source)
07-19 11:23:47.668: E/AndroidRuntime(2275): at com.google.android.gms.common.api.GoogleApiClient$Builder.build(Unknown Source)
07-19 11:23:47.668: E/AndroidRuntime(2275): at nl.hgrams.passenger.activities.PSSignInFlowActivity.onCreate(PSSignInFlowActivity.java:75)
07-19 11:23:47.668: E/AndroidRuntime(2275): at android.app.Activity.performCreate(Activity.java:6251)
07-19 11:23:47.668: E/AndroidRuntime(2275): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
07-19 11:23:47.668: E/AndroidRuntime(2275): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
07-19 11:23:47.668: E/AndroidRuntime(2275): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
07-19 11:23:47.668: E/AndroidRuntime(2275): at android.app.ActivityThread.-wrap11(ActivityThread.java)
07-19 11:23:47.668: E/AndroidRuntime(2275): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
07-19 11:23:47.668: E/AndroidRuntime(2275): at android.os.Handler.dispatchMessage(Handler.java:102)
07-19 11:23:47.668: E/AndroidRuntime(2275): at android.os.Looper.loop(Looper.java:148)
07-19 11:23:47.668: E/AndroidRuntime(2275): at android.app.ActivityThread.main(ActivityThread.java:5417)
07-19 11:23:47.668: E/AndroidRuntime(2275): at java.lang.reflect.Method.invoke(Native Method)
07-19 11:23:47.668: E/AndroidRuntime(2275): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
07-19 11:23:47.668: E/AndroidRuntime(2275): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

最佳答案

查看相似 issue ,

'com.google.android.gms:play-services-auth:9.0.2' 更改为

'com.google.android.gms:play-services-auth:9.2.0'

将正常工作。

关于android - 无法实例化 GoogleApiClient,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38454516/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com