本文介绍了AuthenticatorException:在AVD绑定失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个Android应用程序,使用谷歌的OAuth的图书馆,<一个href="http://$c$c.google.com/p/google-api-java-client/source/browse/tasks-android-sample/src/main/java/com/google/api/services/samples/tasks/android/TasksSample.java?repo=samples"相对=nofollow>这样的样本。

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

然而,当我打电话到getAuthTokenByFeatures我得到了这个打印出来LogCat中的异常:

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)

不过,这不会发生与实际的Andr​​oid设备。我模拟的Andr​​oid 4.0.3,并不能为我的生活中找到答案,这在任何地方。任何想法?

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?

推荐答案

这是通常出现,当你不申报清单中的身份验证。请参阅创建存根验证器。

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>

这篇关于AuthenticatorException:在AVD绑定失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 15:22