我正在尝试创建一个使用 Google 的 OAuth 库的 Android 应用程序,like this sample .
但是,当我调用 getAuthTokenByFeatures 时,我得到一个异常,在 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)
但是,这不会发生在实际的 Android 设备上。我正在模拟 Android 4.0.3 并且无法在我的生活中找到任何地方的答案。有什么想法吗?
最佳答案
当您没有在 list 中声明 Authenticator 时,通常会看到这种情况。参见 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>
关于java - validator 异常 : bind failure on AVD,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10736245/