Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWSMobileClient not working on Android 4.3 #964

Closed
luanalbineli opened this issue May 17, 2019 · 8 comments
Closed

AWSMobileClient not working on Android 4.3 #964

luanalbineli opened this issue May 17, 2019 · 8 comments
Assignees
Labels
bug Something isn't working core Issues with the AWS Android Core library

Comments

@luanalbineli
Copy link

Describe the bug
When we tries to run the AWSMobileClient on 4.2 and 4.3 Android devices, a NoSuchMethodError raises:

java.lang.NoSuchMethodError: android.security.KeyPairGeneratorSpec$Builder.setKeySize at com.amazonaws.internal.keyvaluestore.KeyProvider18.a(KeyProvider18.java:154) at com.amazonaws.internal.keyvaluestore.KeyProvider18.a(KeyProvider18.java:72) at com.amazonaws.internal.keyvaluestore.AWSKeyValueStore.a(AWSKeyValueStore.java:138) at com.amazonaws.internal.keyvaluestore.AWSKeyValueStore.<init>(AWSKeyValueStore.java:108) at com.amazonaws.mobile.client.AWSMobileClientStore.<init>(AWSMobileClient.java:3462) at com.amazonaws.mobile.client.AWSMobileClient$2.run(AWSMobileClient.java:477) at com.amazonaws.mobile.client.internal.InternalCallback$1.run(InternalCallback.java:101) at java.lang.Thread.run(Thread.java:841)

To Reproduce
Just tries to run the AWSMobileClient on specific 4.3 devices.

Expected behavior
Run on Android 4.3, because accordingly with the documentation, the minSdkVersion is 15.

Environment Information (please complete the following information):

  • AWS Android SDK Version: 2.13.4
  • Device: I've tested in Samsung Galaxy S3 (4.3), Sony Xperia Z (4.3)
  • Android Version: 4.3
  • Specific to simulators: No
@rodrigoarias
Copy link

I'm having the same issue.

@rodrigoarias
Copy link

That's not the only one.
I'm getting this crashes, mostly in Android 4, some on Android 5:

KeyProvider18.java line 154
Fatal Exception: java.lang.NoSuchMethodError: android.security.KeyPairGeneratorSpec$Builder.setKeySize at com.amazonaws.internal.keyvaluestore.KeyProvider18.initializeRSAKeyFromKeyStore(KeyProvider18.java:154) at com.amazonaws.internal.keyvaluestore.KeyProvider18.getKey(KeyProvider18.java:72) at com.amazonaws.internal.keyvaluestore.AWSKeyValueStore.setPersistenceEnabled(AWSKeyValueStore.java:138) at com.amazonaws.internal.keyvaluestore.AWSKeyValueStore.<init>(AWSKeyValueStore.java:108) at com.amazonaws.auth.CognitoCachingCredentialsProvider.initialize(CognitoCachingCredentialsProvider.java:425) at com.amazonaws.auth.CognitoCachingCredentialsProvider.<init>(CognitoCachingCredentialsProvider.java:190) at ar.com.bancar.b.b.a.<init>(AWSToolsManager.java:34) at ar.com.bancar.b.b.a.a(AWSToolsManager.java:51) at ar.com.bancar.uala.application.UalaApplication.onCreate(UalaApplication.java:83) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4702) at android.app.ActivityThread.access$1400(ActivityThread.java:168) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1389) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:176) at android.app.ActivityThread.main(ActivityThread.java:5493) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1225) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1041) at dalvik.system.NativeStart.main(NativeStart.java)

KeyProvider18.java line 80
Caused by java.lang.IllegalStateException: Error in initializing the CognitoCachingCredentialsProvider. at com.amazonaws.auth.CognitoCachingCredentialsProvider.initialize(CognitoCachingCredentialsProvider.java:434) at com.amazonaws.auth.CognitoCachingCredentialsProvider.<init>(CognitoCachingCredentialsProvider.java:190) at ar.com.bancar.b.b.a.<init>(AWSToolsManager.java:34) at ar.com.bancar.b.b.a.a(AWSToolsManager.java:51) at ar.com.bancar.uala.application.UalaApplication.onCreate(UalaApplication.java:83) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1014) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4747) at android.app.ActivityThread.access$1500(ActivityThread.java:166) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1343) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5584) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084) at dalvik.system.NativeStart.main(NativeStart.java)

KeyProvider18.java line 160
Caused by java.lang.IllegalStateException: Error in initializing the CognitoCachingCredentialsProvider. at com.amazonaws.auth.CognitoCachingCredentialsProvider.initialize(CognitoCachingCredentialsProvider.java:434) at com.amazonaws.auth.CognitoCachingCredentialsProvider.<init>(CognitoCachingCredentialsProvider.java:190) at ar.com.bancar.b.b.a.<init>(AWSToolsManager.java:34) at ar.com.bancar.b.b.a.a(AWSToolsManager.java:51) at ar.com.bancar.uala.application.UalaApplication.onCreate(UalaApplication.java:83) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1017) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4837) at android.app.ActivityThread.access$1500(ActivityThread.java:177) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1530) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5616) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)

@mutablealligator mutablealligator self-assigned this May 17, 2019
@mutablealligator mutablealligator added bug Something isn't working core Issues with the AWS Android Core library Investigating labels May 17, 2019
@mutablealligator
Copy link
Contributor

mutablealligator commented May 19, 2019

Sorry for the inconvenience caused. Submitted a PR #967 to fix the issue. You may build from the PR and test before the official release if necessary.

@mutablealligator mutablealligator added pending-release Code has been merged but pending release and removed Investigating labels May 19, 2019
@hvar90
Copy link

hvar90 commented May 22, 2019

i have this error on android 4.4
aws sdk 2.13.4

java.lang.IllegalStateException: 
  at com.amazonaws.auth.CognitoCachingCredentialsProvider.initialize (CognitoCachingCredentialsProvider.java:434)
  at com.amazonaws.auth.CognitoCachingCredentialsProvider.<init> (CognitoCachingCredentialsProvider.java:163)
  at schan.main.HandlerUploads.uploadFile (HandlerUploads.java:38)
  at schan.main.ChatActivity.lambda$processImage$0$ChatActivity (ChatActivity.java:1512)
  at schan.main.-$$Lambda$ChatActivity$Tr6b7j3xhWhRARXk28YIBNdFtaE.invoke (lambda)
  at pyxis.uzuki.live.mediaresizer.data.ResizeOption$Builder$setCallback$$inlined$apply$lambda$1.invoke (ResizeOption.kt:78)
  at pyxis.uzuki.live.mediaresizer.data.ResizeOption$Builder$setCallback$$inlined$apply$lambda$1.invoke (ResizeOption.kt:17)
  at pyxis.uzuki.live.mediaresizer.MediaResizer$executeCallback$1.invoke (MediaResizer.kt:39)
  at pyxis.uzuki.live.mediaresizer.MediaResizer$executeCallback$1.invoke (MediaResizer.kt:17)
  at pyxis.uzuki.live.richutilskt.utils.RichUtils__RThreadKt$sam$Runnable$f44beeba.run (RThread.kt)
  at android.os.Handler.handleCallback (Handler.java:733)
  at android.os.Handler.dispatchMessage (Handler.java:95)
  at android.os.Looper.loop (Looper.java:136)
  at android.app.ActivityThread.main (ActivityThread.java:5584)
  at java.lang.reflect.Method.invokeNative (Native Method)
  at java.lang.reflect.Method.invoke (Method.java:515)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1268)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1084)
  at dalvik.system.NativeStart.main (Native Method)
Caused by: java.lang.IllegalStateException: 
  at com.amazonaws.internal.keyvaluestore.KeyProvider18.getKey (KeyProvider18.java:98)
  at com.amazonaws.internal.keyvaluestore.AWSKeyValueStore.setPersistenceEnabled (AWSKeyValueStore.java:138)
  at com.amazonaws.internal.keyvaluestore.AWSKeyValueStore.<init> (AWSKeyValueStore.java:108)
  at com.amazonaws.auth.CognitoCachingCredentialsProvider.initialize (CognitoCachingCredentialsProvider.java:425)
Caused by: java.lang.IllegalArgumentException: 
  at javax.crypto.spec.SecretKeySpec.<init> (SecretKeySpec.java:59)
  at com.amazonaws.internal.keyvaluestore.KeyProvider18.getKey (KeyProvider18.java:80)

@mutablealligator
Copy link
Contributor

@luanalbineli @rodrigoarias This issue has been fixed and released in 2.13.5. Please upgrade and test on Android API Level 18 and let us know if you have any feedback.

@mutablealligator mutablealligator added closing soon Issue will auto-close if there is no additional activity within 7 days. and removed pending-release Code has been merged but pending release labels May 27, 2019
@stale stale bot removed the closing soon Issue will auto-close if there is no additional activity within 7 days. label May 27, 2019
@mutablealligator mutablealligator added the closing soon Issue will auto-close if there is no additional activity within 7 days. label May 28, 2019
@rodrigoarias
Copy link

@kvasukib I've released the app with version 2.13.5 and we've already getting reports of the following:
Caused by java.lang.IllegalStateException: java.lang.IllegalArgumentException: key == null at com.amazonaws.internal.keyvaluestore.KeyProvider18.getKey(KeyProvider18.java:108) at com.amazonaws.internal.keyvaluestore.AWSKeyValueStore.setPersistenceEnabled(AWSKeyValueStore.java:138) at com.amazonaws.internal.keyvaluestore.AWSKeyValueStore.<init>(AWSKeyValueStore.java:108) at com.amazonaws.auth.CognitoCachingCredentialsProvider.initialize(CognitoCachingCredentialsProvider.java:425) at com.amazonaws.auth.CognitoCachingCredentialsProvider.<init>(CognitoCachingCredentialsProvider.java:190) at ar.com.bancar.b.b.a.<init>(AWSToolsManager.java:34) at ar.com.bancar.b.b.a.a(AWSToolsManager.java:51) at ar.com.bancar.uala.application.UalaApplication.onCreate(UalaApplication.java:83) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1030) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4409) at android.app.ActivityThread.access$1500(ActivityThread.java:139) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1270) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5086) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) at dalvik.system.NativeStart.main(NativeStart.java)

@stale stale bot removed the closing soon Issue will auto-close if there is no additional activity within 7 days. label May 29, 2019
@mutablealligator
Copy link
Contributor

@rodrigoarias This GitHub issue only covers the crash which appears in the issue description iwhich was fixed in version 2.13.5. However the crash you are experiencing will be addressed as part of #937

@rodrigoarias
Copy link

@kvasukib , ok, then yes, the other issues seems to been fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core Issues with the AWS Android Core library
Projects
None yet
Development

No branches or pull requests

4 participants