Einige andere nützliche Tipps zum Debuggen solcher Probleme.
Aktivieren Sie zunächst die ausführliche Protokollierung für einige Tags:
$ 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
Sie sehen die Protokollierung folgendermaßen:
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
Dies bedeutet, dass für diesen Kontotyp kein Authentifikator registriert ist. Um zu sehen, welche Authentifikatoren registriert sind, überprüfen Sie das Protokoll bei der Installation des Pakets:
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
Ich hatte das Problem, dass der XML-Deskriptor des Authentifikators auf eine Zeichenfolgenressource verwies, die während der Installation nicht ordnungsgemäß aufgelöst wurde:
android:accountType="@string/account_type"
Die Protokolle zeigten
encountered new type: ServiceInfo: AuthenticatorDescription {type=@2131231194}, ...
Das Ersetzen durch eine normale Zeichenfolge (keine Ressource) löste das Problem. Dies scheint Android 2.1-spezifisch zu sein.
android:accountType="com.example.account"