2017-07-29 63 views
0

我收到以下錯誤升級依賴的NoSuchMethodError SmsRetrieverClient

java.lang.NoSuchMethodError: No direct method <init>(Landroid/content/Context;Lcom/google/android/gms/common/api/Api;Lcom/google/android/gms/common/api/Api$ApiOptions;Lcom/google/android/gms/internal/zzbel;)V in class Lcom/google/android/gms/common/api/GoogleApi; or its super classes (declaration of 'com.google.android.gms.common.api.GoogleApi' appears in /data/app/com.gifme-1/split_lib_dependencies_apk.apk:classes30.dex) 
             at com.google.android.gms.auth.api.phone.SmsRetrieverClient.<init>(Unknown Source) 
             at com.google.android.gms.internal.zzash.<init>(Unknown Source) 
             at com.google.android.gms.auth.api.phone.SmsRetriever.getClient(Unknown Source) 
             at com.facebook.accountkit.internal.PhoneLoginController.createSmsToken(PhoneLoginController.java:250) 
             at com.facebook.accountkit.internal.PhoneLoginController.logIn(PhoneLoginController.java:188) 
             at com.facebook.accountkit.internal.LoginManager.logInWithPhoneNumber(LoginManager.java:372) 
             at com.facebook.accountkit.internal.AccountKitController.logInWithPhoneNumber(AccountKitController.java:627) 
             at com.facebook.accountkit.ui.PhoneLoginFlowManager.logInWithPhoneNumber(PhoneLoginFlowManager.java:57) 
             at com.facebook.accountkit.ui.ActivityPhoneHandler.onPhoneLoginComplete(ActivityPhoneHandler.java:189) 
             at com.facebook.accountkit.ui.AccountKitActivity$1.onReceive(AccountKitActivity.java:176) 
             at android.support.v4.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:308) 
             at android.support.v4.content.LocalBroadcastManager.access$000(LocalBroadcastManager.java:46) 
             at android.support.v4.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:118) 
             at android.os.Handler.dispatchMessage(Handler.java:102) 
             at android.os.Looper.loop(Looper.java:158) 
             at android.app.ActivityThread.main(ActivityThread.java:7225) 
             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) 

後我使用Facebook的AccountKit,然後點擊「下一步」按鈕,查看短信驗證崩潰的應用程序。

問候

回答

1

添加依賴

compile "com.google.android.gms:play-services-auth-api-phone:11.0.2"

0

即使我有同樣的問題。 Rachit Mishra的回答爲我工作。添加依賴項。

compile "com.google.android.gms:play-services-auth-api-phone:11.0.2" 

似乎我們還必須明確提及谷歌auth api。