Skip to content
This repository has been archived by the owner on Oct 10, 2019. It is now read-only.

Android 9 (API 28): android.os.ServiceSpecificException: (code 7) gets logged #3

Closed
mreichelt opened this issue Sep 7, 2018 · 4 comments

Comments

@mreichelt
Copy link

When running the sample code on an emulator running Android 9.0 Pie (API 28) and clicking on 'create' and 'sign', the app will log an exception - though it will continue to run fine.

The exception:

09-07 14:35:37.535 16583-16583/com.example.android.basicandroidkeystore W/KeyStore: KeyStore exception
    android.os.ServiceSpecificException:  (code 7)
        at android.os.Parcel.createException(Parcel.java:1956)
        at android.os.Parcel.readException(Parcel.java:1910)
        at android.os.Parcel.readException(Parcel.java:1860)
        at android.security.IKeystoreService$Stub$Proxy.get(IKeystoreService.java:786)
        at android.security.KeyStore.get(KeyStore.java:195)
        at android.security.keystore.AndroidKeyStoreSpi.engineGetCertificateChain(AndroidKeyStoreSpi.java:118)
        at java.security.KeyStoreSpi.engineGetEntry(KeyStoreSpi.java:484)
        at java.security.KeyStore.getEntry(KeyStore.java:1560)
        at com.example.android.basicandroidkeystore.BasicAndroidKeyStoreFragment.signData(BasicAndroidKeyStoreFragment.java:234)
        at com.example.android.basicandroidkeystore.BasicAndroidKeyStoreFragment.onOptionsItemSelected(BasicAndroidKeyStoreFragment.java:102)
        at android.support.v4.app.Fragment.performOptionsItemSelected(Fragment.java:2394)
        at android.support.v4.app.FragmentManagerImpl.dispatchOptionsItemSelected(FragmentManager.java:3326)
        at android.support.v4.app.FragmentController.dispatchOptionsItemSelected(FragmentController.java:344)
        at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:386)
        at com.android.internal.policy.PhoneWindow.onMenuItemSelected(PhoneWindow.java:1237)
        at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:776)
        at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:148)
        at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:923)
        at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:913)
        at android.widget.ActionMenuView.invokeItem(ActionMenuView.java:617)
        at com.android.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:147)
        at android.view.View.performClick(View.java:6597)
        at android.view.View.performClickInternal(View.java:6574)
        at android.view.View.access$3100(View.java:778)
        at android.view.View$PerformClick.run(View.java:25885)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

The culprit seems to be this code (also exists in verifyData method):
https://github.com/googlesamples/android-BasicAndroidKeyStore/blob/5070deacbd8f85cb7a49aad022cadf4f8a15d22e/Application/src/main/java/com/example/android/basicandroidkeystore/BasicAndroidKeyStoreFragment.java#L233-L234

@ber4444
Copy link

ber4444 commented Apr 10, 2019

This is still happening on Android Q, beta 2.
Related bugs:

@anthonymonori
Copy link

This issue has been fixed in Beta 4/final SDK release of Android 10: https://issuetracker.google.com/issues/74355119

Can be closed IMHO

@ber4444
Copy link

ber4444 commented Jul 30, 2019

It's still an issue on the latest Android 10 update, but nice to see the fix is scheduled to come in "a future version".

@codingjeremy
Copy link
Contributor

This sample has been deprecated/archived (check README for more information on newer samples related to this technology).

As recommended by GitHub, we are closing all issues and pull requests.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants