我正在尝试启动一个带有 Intent 的选择帐户对话框,我通过 GoogleAccountCredential.newChooseAccountIntent 获得。
当我编译源代码时,发生错误 NoClassDefFoundError。
这是我的错误日志:
12-18 09:55:51.237: E/AndroidRuntime(25809): FATAL EXCEPTION: main
12-18 09:55:51.237: E/AndroidRuntime(25809): java.lang.NoClassDefFoundError: com.google.android.gms.common.AccountPicker
12-18 09:55:51.237: E/AndroidRuntime(25809): at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential.newChooseAccountIntent(GoogleAccountCredential.java:171)
12-18 09:55:51.237: E/AndroidRuntime(25809): at com.arcticcoding.study.OverView.onCreate(OverView.java:67)
12-18 09:55:51.237: E/AndroidRuntime(25809): at android.app.Activity.performCreate(Activity.java:4465)
12-18 09:55:51.237: E/AndroidRuntime(25809): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
最佳答案
您需要引用 google play 服务库。我遇到过同样的问题 并在此处解决:
java.lang.NoClassDefFoundError on Android with GoogleAccountCredential.newChooseAccountIntent()
关于android - GoogleAccountCredential chooseAccountIntent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13929651/