question

benoit-lacelle avatar image
benoit-lacelle asked

NoSuchAlgorithmException in com.amazon.insights.AmazonInsights

I get the following exception for 2 users (up to now). Insights: 2.1.16 Model: S221i and KFTT (Kindle) Android Version: 4.0.3 and 4.0.4 Just like in the Mobile Ads API, thanks for not letting your SDK break in Developper Application. This feeling of unstability prevent many developpers from using your tools. Thanks, Benoit ps: I put this ticket in Mobile Ads, as I can't find an Insights section 0 java.lang.RuntimeException: Unable to create application blasd.wishset.WishSetApplication: java.lang.IllegalArgumentException: java.security.NoSuchAlgorithmException: Cipher AES implementation not found 1 at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4092) 2 at android.app.ActivityThread.access$1300(ActivityThread.java:127) 3 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1219) 4 at android.os.Handler.dispatchMessage(Handler.java:99) 5 at android.os.Looper.loop(Looper.java:137) 6 at android.app.ActivityThread.main(ActivityThread.java:4558) 7 at java.lang.reflect.Method.invokeNative(Native Method) 8 at java.lang.reflect.Method.invoke(Method.java:511) 9 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 10 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 11 at dalvik.system.NativeStart.main(Native Method) 12 Caused by: java.lang.IllegalArgumentException: java.security.NoSuchAlgorithmException: Cipher AES implementation not found 13 at com.amazon.insights.core.io.EncryptedBufferedReader. (SourceFile:37) 14 at com.amazon.insights.session.FileSessionStore.tryOpenReader(SourceFile:154) 15 at com.amazon.insights.session.FileSessionStore.getSession(SourceFile:183) 16 at com.amazon.insights.session.client.DefaultSessionClient. (SourceFile:147) 17 at com.amazon.insights.session.client.DefaultSessionClient.newInstance(SourceFile:82) 18 at com.amazon.insights.AmazonInsights$DefaultAmazonInsights. (SourceFile:345) 19 at com.amazon.insights.AmazonInsights.newInstance(SourceFile:267) 20 at com.amazon.insights.AmazonInsights.newInstance(SourceFile:238) 21 at com.amazon.insights.AmazonInsights.newInstance(SourceFile:212)
mobile ads
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Benoit, Thank you for reporting this. I have forwarded the issue to appropriate team. I will post back shortly after getting response from them.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Benoit, We are looking into the cause of this exception and would like to gather some information regarding the build process for the app that throws this exception. - Is Proguard being used? If so, what settings are you using? - Is JarJar being used? If so, how are you using it? - Is the BouncyCastle (BC) crypto library being removed and/or modified? - Are any additional Crypto or Security packages being included or removed? - Is the exception being thrown on a custom distribution of Android? - Any other build settings that have potential to exclude libraries from the .apk? Providing this information will help us identify the cause of this issue. You can provide these through ContactUs ( https://developer.amazon.com/help/contactus.html) with the app detail. Please mention there that you are directed from this thread. Message was edited by: Sujoy@Amazon
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

benoit-lacelle avatar image
benoit-lacelle answered
- Is Proguard being used? If so, what settings are you using? Yes # Amazon Insights -keep class com.amazon.insights.** { *; } -dontwarn com.amazon.insights.** -dontwarn java.lang.AutoCloseable - Is JarJar being used? If so, how are you using it? No - Is the BouncyCastle (BC) crypto library being removed and/or modified? No - Are any additional Crypto or Security packages being included or removed? No - Is the exception being thrown on a custom distribution of Android? No - Any other build settings that have potential to exclude libraries from the .apk? No
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Benoit, Thank you for the information. I will post back shortly.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Benoit, Can you please supply us with the following additional information: - On how many devices has this exception been thrown? We saw there were 2 different device types, but is this happening on hundreds of devices, etc, or just specifically these two? - Are the devices development devices or customer devices? - Would it be possible to run code on these devices to output a list of available Java Security Providers? (Snippet below) - Do these errors occur consistently on the devices or are they seemingly random? Log.i("CRYPTO", "****************** ENCRYPTION PROVIDERS ******************"); Provider[] providers = Security.getProviders(); for(Provider provider : providers) { Log.i("CRYPTO","provider: "+provider.getName()); Set services = provider.getServices(); for(Provider.Service service : services) { Log.i("CRYPTO"," algorithm: "+service.getAlgorithm()); } } Log.i("CRYPTO", "********************** END PROVIDERS **********************”);
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

benoit-lacelle avatar image
benoit-lacelle answered
It happened 300 times on 140 different users, on at least 20 different customer devices. It does not occur on any of my tested devices, and I would say it happenes randomly
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
We have still not been able to reproduce this error using the Amazon Money Saver app from the Amazon App Store across several different devices. Can you please supply us with the following information: How are you obtaining the app crash reports? Are you able to tell if the error occurs every time the app runs on a single device, or is the error intermittent? How/where are you initializing the Amazon Insights SDK in you app's lifecycle? Are you recording any custom events? If so, how are you using them? Have you verified that you are seeing data in the Amazon Analytics dashboard for your app? Does this error occur in a specific version of your app? Thank You
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

snapdishdev avatar image
snapdishdev answered
Same problem here. We see thousands of errors being thrown. - Is Proguard being used? If so, what settings are you using? Yes. >-dontskipnonpubliclibraryclassmembers >-allowaccessmodification >-keepattributes SourceFile,LineNumberTable >-dontwarn >-ignorewarnings > >-keep public class * extends android.app.Application >-keep public class * extends android.app.Service >-keep public class * extends android.content.BroadcastReceiver >-keep public class * extends android.content.ContentProvider > ># configuration for Compatibility library ># http://stackoverflow.com/a/6973112/472262 >-keep public class * extends android.app.Fragment >-keep public class * extends android.support.v4.** > >-keep class * extends android.view.View { > public (android.content.Context); > public (android.content.Context, android.util.AttributeSet); > public (android.content.Context, android.util.AttributeSet, int); > public void set*(...); >} > >-keep class * extends android.preference.Preference { > public (android.content.Context); > public (android.content.Context, android.util.AttributeSet); > public (android.content.Context, android.util.AttributeSet, int); > public void set*(...); >} > >##------------------------------ >## Libraries and 3rd party tools >##----------------------------## >## Relevant for Gson, Facebook,... >-keepattributes Signature > >## Action bar compat >-keep class android.support.v4.app.** { *; } >-keep class android.support.v4.content.Loader { *; } >-keep interface android.support.v4.app.** { *; } >## Gson specific classes >-keep class com.google.gson.stream.** { *; } > >-keepclassmembers enum * { > public static **[] values(); > public static ** valueOf(java.lang.String); > } >##------------------------------ >## GOOGLE PLAY SERVICES >## http://developer.android.com/google/play-services/setup.html >##----------------------------## >-keep class * extends java.util.ListResourceBundle { > protected Object[][] getContents(); >} > >-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable { > public static final *** NULL; >} > >-keepnames @com.google.android.gms.common.annotation.KeepName class * >-keepclassmembernames class * { > @com.google.android.gms.common.annotation.KeepName *; >} > >-keepnames class * implements android.os.Parcelable { > public static final ** CREATOR; >} - Is JarJar being used? If so, how are you using it? No - Is the BouncyCastle (BC) crypto library being removed and/or modified? No. - Are any additional Crypto or Security packages being included or removed? No. - Is the exception being thrown on a custom distribution of Android? No. We currently have a list of 2.3.4, 2.3.5, 2.3.6, 2.3.7, 4.0.4, 4.0.3, 4.1.1, 4.1.2 - Any other build settings that have potential to exclude libraries from the .apk? No. Here is the stackstrace Reported Name Reason App Version Download 02-Apr-14 08:42:30 PM java.security.NoSuchAlgorithmException java.security.NoSuchAlgorithmException: Cipher AES implementation not found 3.0.2 Crashed Thread 0 java.lang.IllegalArgumentException: java.security.NoSuchAlgorithmException: Cipher AES implementation not found 1 at com.amazon.insights.b.d.b. (EncryptedBufferedReader.java:37) 2 at com.amazon.insights.h.a.b(FileSessionStore.java:154) 3 at com.amazon.insights.h.a.a(FileSessionStore.java:183) 4 at com.amazon.insights.h.a.b. (DefaultSessionClient.java:147) 5 at com.amazon.insights.h.a.b.a(DefaultSessionClient.java:82) 6 at com.amazon.insights.c. (AmazonInsights.java:345) 7 at com.amazon.insights.b.a(AmazonInsights.java:267) 8 at com.amazon.insights.b.a(AmazonInsights.java:238) 9 at com.amazon.insights.b.a(AmazonInsights.java:226) 10 at com.amazon.insights.b.a(AmazonInsights.java:186) 11 at com.namespace.libs.ABTesting.initialize(ABTesting.java:71) 12 at com.namespace.App.w(App.java:1044) 13 at com.namespace.App.onCreate(App.java:959) 14 at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969) 15 at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3994) 16 at android.app.ActivityThread.access$1300(ActivityThread.java:136) 17 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1198) 18 at android.os.Handler.dispatchMessage(Handler.java:99) 19 at android.os.Looper.loop(Looper.java:137) 20 at android.app.ActivityThread.main(ActivityThread.java:4464) 21 at java.lang.reflect.Method.invokeNative(Native Method) 22 at java.lang.reflect.Method.invoke(Method.java:511) 23 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:822) 24 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:589) 25 at dalvik.system.NativeStart.main(Native Method) 26 Caused by: java.security.NoSuchAlgorithmException: Cipher AES implementation not found 27 at org.apache.harmony.security.fortress.Engine.notFound(Engine.java:177) 28 at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:151) 29 at javax.crypto.Cipher.getCipher(Cipher.java:270) 30 at javax.crypto.Cipher.getInstance(Cipher.java:174) 31 at com.amazon.insights.b.d.b. (EncryptedBufferedReader.java:33) 32 ... 24 more 33 java.security.NoSuchAlgorithmException: Cipher AES implementation not found 34 at org.apache.harmony.security.fortress.Engine.notFound(Engine.java:177) 35 at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:151) 36 at javax.crypto.Cipher.getCipher(Cipher.java:270) 37 at javax.crypto.Cipher.getInstance(Cipher.java:174) 38 at com.amazon.insights.b.d.b. (EncryptedBufferedReader.java:33) 39 at com.amazon.insights.h.a.b(FileSessionStore.java:154) 40 at com.amazon.insights.h.a.a(FileSessionStore.java:183) 41 at com.amazon.insights.h.a.b. (DefaultSessionClient.java:147) 42 at com.amazon.insights.h.a.b.a(DefaultSessionClient.java:82) 43 at com.amazon.insights.c. (AmazonInsights.java:345) 44 at com.amazon.insights.b.a(AmazonInsights.java:267) 45 at com.amazon.insights.b.a(AmazonInsights.java:238) 46 at com.amazon.insights.b.a(AmazonInsights.java:226) 47 at com.amazon.insights.b.a(AmazonInsights.java:186) 48 at com.namespace.libs.ABTesting.initialize(ABTesting.java:71) 49 at com.namespace.App.w(App.java:1044) 50 at com.namespace.App.onCreate(App.java:959) 51 at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969) 52 at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3994) 53 at android.app.ActivityThread.access$1300(ActivityThread.java:136) 54 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1198) 55 at android.os.Handler.dispatchMessage(Handler.java:99) 56 at android.os.Looper.loop(Looper.java:137) 57 at android.app.ActivityThread.main(ActivityThread.java:4464) 58 at java.lang.reflect.Method.invokeNative(Native Method) 59 at java.lang.reflect.Method.invoke(Method.java:511) 60 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:822) 61 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:589) 62 at dalvik.system.NativeStart.main(Native Method)
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Snapdishdev , Thank you for the information. I am providing all these information to the concerned team here. I will respond asap. Please stay tuned.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

snapdishdev avatar image
snapdishdev answered
Thank you. As additional info, it seems that no devices with an Android version greater than 4.1.2 are affected
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.