Kilka innych przydatnych wskazówek dotyczących debugowania takich problemów.
Najpierw włącz szczegółowe rejestrowanie niektórych tagów:
$ 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
Zobaczysz takie rejestrowanie:
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
Co oznacza, że nie ma zarejestrowanego wystawcy uwierzytelnienia dla tego typu konta. Aby zobaczyć, które uwierzytelniacze są zarejestrowane, obejrzyj dziennik podczas instalowania pakietu:
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
Miałem problem polegający na tym, że deskryptor xml elementu uwierzytelniającego odnosił się do zasobu ciągu, który nie został poprawnie rozwiązany podczas instalacji:
android:accountType="@string/account_type"
Dzienniki pokazały
encountered new type: ServiceInfo: AuthenticatorDescription {type=@2131231194}, ...
Zastąpienie go zwykłym ciągiem (nie zasobem) rozwiązało problem. Wydaje się, że jest to specyficzne dla Androida 2.1.
android:accountType="com.example.account"