Contacts created with Android emulator (2.0) not b

2019-08-17 15:47发布

问题:

I created contacts with the emulator for v 2.0. However, I am unable to see these contacts. One of the errors I get even before my code that executes read contacts is:

Cannot determine the default account for contacts compatibility

See below for full stack:

E/ContactsProvider(  109): Cannot determine the default account for contacts compatibility
E/ContactsProvider(  109): android.accounts.AuthenticatorException: bind failure
E/ContactsProvider(  109):      at android.accounts.AccountManager.convertErrorToException(AccountManager.java:659)
E/ContactsProvider(  109):      at android.accounts.AccountManager.access$500(AccountManager.java:53)
E/ContactsProvider(  109):      at android.accounts.AccountManager$BaseFutureTask$Response.onError(AccountManager.java:566)
E/ContactsProvider(  109):      at android.accounts.IAccountManagerResponse$Stub.onTransact(IAccountManagerResponse.java:69)
E/ContactsProvider(  109):      at android.os.Binder.execTransact(Binder.java:287)
E/ContactsProvider(  109):      at dalvik.system.NativeStart.run(Native Method)

回答1:

You're getting this error because you don't have any accounts registered on your virtual device.

Unfortunately, solving this is a bit difficult, since the SDK doesn't come bundled with Google Accounts support. As a result, there's no account types available on your device that you could use to register a new account.

Unless you can find a third-party application that registers itself as an contact provider (I'm not aware of any yet), I can't think of a solution here other than to develop on an actual phone.



回答2:

Please check this link.It looks related . http://groups.google.com/group/android-developers/browse_thread/thread/72fcf849c092b219/8b83e5d1580a7d45?lnk=raot&pli=1