AuthenticatorException: bind failure on AVD

耗尽温柔 提交于 2019-12-30 07:01:11

问题


I'm trying to create an Android App that uses Google's OAuth library, like this sample.

However, when I make a call to getAuthTokenByFeatures I get an exception that prints this out on LogCat:

05-24 10:56:58.224: W/System.err(557): android.accounts.AuthenticatorException: bind failure
05-24 10:56:58.236: W/System.err(557):  at android.accounts.AccountManager.convertErrorToException(AccountManager.java:1563)
05-24 10:56:58.236: W/System.err(557):  at android.accounts.AccountManager.access$400(AccountManager.java:140)
05-24 10:56:58.236: W/System.err(557):  at android.accounts.AccountManager$AmsTask$Response.onError(AccountManager.java:1409)
05-24 10:56:58.236: W/System.err(557):  at android.accounts.IAccountManagerResponse$Stub.onTransact(IAccountManagerResponse.java:69)
05-24 10:56:58.236: W/System.err(557):  at android.os.Binder.execTransact(Binder.java:338)
05-24 10:56:58.236: W/System.err(557):  at dalvik.system.NativeStart.run(Native Method)

However, this does not happen with an actual Android device. I'm emulating Android 4.0.3 and could not for the life of me find an answer to this anywhere. Any ideas?


回答1:


This is usually seen when you don't declare the Authenticator in the manifest. See Creating a Stub Authenticator.

<service
        android:name="com.example.android.syncadapter.AuthenticatorService">
    <intent-filter>
        <action android:name="android.accounts.AccountAuthenticator"/>
    </intent-filter>
    <meta-data
        android:name="android.accounts.AccountAuthenticator"
        android:resource="@xml/authenticator" />
</service>


来源:https://stackoverflow.com/questions/10736245/authenticatorexception-bind-failure-on-avd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!