Alcuni altri suggerimenti utili per eseguire il debug di problemi come questo.
Abilita prima la registrazione dettagliata per alcuni tag:
$ adb shell setprop log.tag.AccountManagerService VERBOSE
$ adb shell setprop log.tag.Accounts VERBOSE
$ adb shell setprop log.tag.Account VERBOSE
$ adb shell setprop log.tag.PackageManager VERBOSE
Vedrai la registrazione in questo modo:
V/AccountManagerService: initiating bind to authenticator type com.example.account
V/Accounts: there is no service connection for com.example.account
V/Accounts: there is no authenticator for com.example.account, bailing out
D/AccountManagerService: bind attempt failed for Session: expectLaunch true, connected false, stats (0/0/0), lifetime 0.002, addAccount, accountType com.example.account, requiredFeatures null
Ciò significa che non esiste un autenticatore registrato per questo tipo di account. Per vedere quali autenticatori sono registrati, guarda il registro durante l'installazione del pacchetto:
D/PackageManager: encountered new type: ServiceInfo: AuthenticatorDescription {type=com.example.account}, ComponentInfo{com.example/com.example.android.AuthenticatorService}, uid 10028
D/PackageManager: notifyListener: AuthenticatorDescription {type=com.example.account} is added
Ho avuto il problema che il descrittore xml dell'autenticatore si riferisse a una risorsa stringa che non è stata risolta correttamente durante l'installazione:
android:accountType="@string/account_type"
I registri hanno mostrato
encountered new type: ServiceInfo: AuthenticatorDescription {type=@2131231194}, ...
Sostituendolo con una stringa normale (non risorsa) ha risolto il problema. Questo sembra essere specifico per Android 2.1.
android:accountType="com.example.account"