Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

am getting error after i created amazon coginto in android

Hi am doing a project which syncs the data to amazon coginto and its working fine, and successfully signed apk too.

Now the problem is am getting error after debug

"Unrecognized suffix for the AWS http client class name b"

like image 552
Hanifa Avatar asked Feb 18 '16 11:02

Hanifa


2 Answers

You probably turn on Proguard and have class name obfuscated. The SDK does reflection based on the class name. Without it some feature may not work correctly. Please see the instruction https://github.com/aws/aws-sdk-android/blob/master/Proguard.md for configuration.

like image 74
Yangfan Avatar answered Nov 15 '22 00:11

Yangfan


Girdhar G. Patel's solution works for version 1 of the aws sdk and the source for the answer is here: https://aws.amazon.com/blogs/mobile/using-proguard-with-the-aws-sdk-for-android/

If you're using version two you'll need a different proguard configuration to get it working: (source: https://github.com/krschultz/android-proguard-snippets/blob/master/libraries/proguard-aws-2.1.5.pro)

# These options are the minimal options for a functioning application
# using Proguard and the AWS SDK 2.1.5 for Android

-keep class org.apache.commons.logging.**               { *; }
-keep class com.amazonaws.org.apache.commons.logging.** { *; }
-keep class com.amazonaws.services.sqs.QueueUrlHandler  { *; }
-keep class com.amazonaws.javax.xml.transform.sax.*     { public *; }
-keep class com.amazonaws.javax.xml.stream.**           { *; }
-keep class com.amazonaws.services.**.model.*Exception* { *; }
-keep class com.amazonaws.internal.**                   { *; }
-keep class org.codehaus.**                             { *; }
-keep class org.joda.time.tz.Provider                   { *; }
-keep class org.joda.time.tz.NameProvider               { *; }
-keepattributes Signature,*Annotation*,EnclosingMethod
-keepnames class com.fasterxml.jackson.** { *; }
-keepnames class com.amazonaws.** { *; }

-dontwarn com.fasterxml.jackson.databind.**
-dontwarn javax.xml.stream.events.**
-dontwarn org.codehaus.jackson.**
-dontwarn org.apache.commons.logging.impl.**
-dontwarn org.apache.http.conn.scheme.**
-dontwarn org.apache.http.annotation.**
-dontwarn org.ietf.jgss.**
-dontwarn org.joda.convert.**
-dontwarn com.amazonaws.org.joda.convert.**
-dontwarn org.w3c.dom.bootstrap.**

#SDK split into multiple jars so certain classes may be referenced but not used
-dontwarn com.amazonaws.services.s3.**
-dontwarn com.amazonaws.services.sqs.**

-dontnote com.amazonaws.services.sqs.QueueUrlHandler
like image 34
Braden Holt Avatar answered Nov 14 '22 23:11

Braden Holt