androidbuild.gradleamazon-appstorelogin-with-amazonamazon-device-messaging

Why are my Amazon Appstore submissions being rejected? How to get more info?


Since over a year I have a Russian multiplayer word game published at Amazon.

Now I have translated it to English and German languages, but have problems getting the 2 translated apps through the Amazon Appstore review -

screenshot

The response is always the same: "The app exits/ force closes/ freezes/ displays an error message after being launched."

But there is no information on which device they were tested (on my Fire 5 and Fire 7 tablets the game runs just fine) and there is no error log.

I have tried contacting developer support asking for any logs, but got no response.

My app uses LWA and ADM and is minSdk 16. My apps are also published at Google Store (they use Google Sign-In and FCM there) and Huawei AppGallery (they use HMS there).

I just need a little more information to fix any problems with my app. If I knew which device is being used for testing, I would just buy or loan it.

Is anyone maybe willing to sideload the APK files and give my game a try at her or his Amazon Fire devices?

Finally, below is my app/build.gradle - maybe someone can spot a problem with it?

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    defaultConfig {
        versionCode 168
        targetSdkVersion 29
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true

        javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
            }
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    signingConfigs {
        debug {
            keyAlias 'AndroidDebugKey'
            storeFile file('../../../../../.android/debug.keystore')
            keyPassword 'android'
            storePassword 'android'
        }
        release {
            keyAlias 'AndroidReleaseKey'
            storeFile file('../../../conf/release.keystore')
            keyPassword System.getenv('PASSPHRASE1')
            storePassword System.getenv('PASSPHRASE1')
        }
    }

    flavorDimensions "store", "language"
    productFlavors {
        google {
            dimension "store"
            versionName "$defaultConfig.versionCode-google"
            // min sdk version 16 needed for Firebase messaging
            minSdkVersion 16
        }
        huawei {
            dimension "store"
            versionName "$defaultConfig.versionCode-huawei"
            // min sdk version 17 needed for Huawei push
            minSdkVersion 17
            applicationIdSuffix ".huawei"
            resConfigs "en", "zh-rCN", "ru", "de", "fr", "pl", "nl"
        }
        amazon {
            dimension "store"
            versionName "$defaultConfig.versionCode-amazon"
            // min sdk version 15 needed for older Amazon Fire models, but is no more supported by the LWA
            minSdkVersion 16
            // ignore AdmService not extending android.app.Service
            lintOptions {
                checkReleaseBuilds false
            }
        }

        de {
            applicationId "de.wortefarbers"
            dimension "language"
            resConfigs "de"
        }
        en {
            applicationId "com.wordsbyfarber"
            dimension "language"
            resConfigs "en"
        }
        ru {
            applicationId "de.slova"
            dimension "language"
            resConfigs "ru"
        }
    }

    buildTypes {
        release {
            signingConfig signingConfigs.release
            debuggable false
            shrinkResources true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation 'androidx.multidex:multidex:2.0.1'

    // minSdkVersion 9 is only supported by the OkHttp 3.12.x branch
    implementation 'com.squareup.okhttp3:okhttp:3.12.2'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.neovisionaries:nv-websocket-client:2.10'

    implementation "androidx.room:room-common:$roomVersion"
    implementation "androidx.room:room-runtime:$roomVersion"
    annotationProcessor "androidx.room:room-compiler:$roomVersion"
    androidTestImplementation "androidx.room:room-testing:$roomVersion"

    implementation "androidx.lifecycle:lifecycle-extensions:$archVersion"
    annotationProcessor "androidx.lifecycle:lifecycle-common-java8:$archVersion"

    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.viewpager2:viewpager2:1.0.0'
    implementation 'com.google.android.material:material:1.3.0-alpha02'

    implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'
    implementation 'com.mikepenz:materialdrawer:6.1.2'
    implementation 'com.mikepenz:iconics-core:3.2.5'
    implementation 'com.mikepenz:fontawesome-typeface:5.3.1.1@aar'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0-alpha'
    implementation "com.facebook.android:facebook-core:$facebookVersion"
    implementation "com.facebook.android:facebook-login:$facebookVersion"

    googleImplementation 'com.google.android.gms:play-services-auth:18.1.0'
    googleImplementation 'com.google.firebase:firebase-messaging:20.2.4'
    googleImplementation 'com.android.billingclient:billing:3.0.0'

    huaweiImplementation "com.huawei.hms:base:$hmsVersion"
    huaweiImplementation "com.huawei.hms:hwid:$hmsVersion"
    huaweiImplementation "com.huawei.hms:push:$hmsVersion"
    huaweiImplementation "com.huawei.hms:iap:$hmsVersion"

    amazonCompileOnly files('libs/amazon-device-messaging-1.1.0.jar')
    amazonImplementation files('libs/login-with-amazon-sdk.jar')

    androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    testImplementation 'junit:junit:4.12'
}

if (getGradle().getStartParameter().getTaskRequests().toString().contains('Google')) {
    apply plugin: 'com.google.gms.google-services'
} else if (getGradle().getStartParameter().getTaskRequests().toString().contains('Huawei')) {
    apply plugin: 'com.huawei.agconnect'
}

P.S. I have also asked my question at Amazon Developer Forum.

UPDATE after a week of trying:

In the App Testing Service I have noticed that my app rarely crashes when using WebView (some internal crash, not caused by my app), so I have removed all usages of it (used the embedded browser to display Help, Privacy Policy, Terms of Service, etc.) and removed the optional Facebook login too.

Now my app in English and German languages passes the "App Testing Service":

en app

de app

But is still rejected by Amazon reviewers and I cannot get any human reply by them or any logs.

And at the same time the Russian version of my app passes Update review...

UPDATE:

Finally I've got an error log from Amazon saying:

09-09 15:21:39.253: E/AndroidRuntime(19217): FATAL EXCEPTION: main
09-09 15:21:39.253: E/AndroidRuntime(19217): Process: de.wortefarbers, PID: 19217
09-09 15:21:39.253: E/AndroidRuntime(19217): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/amazon/device/messaging/development/ADMManifest;
09-09 15:21:39.253: E/AndroidRuntime(19217):    at de.slova.SlovaApplication.c(SlovaApplication.java:1)
09-09 15:21:39.253: E/AndroidRuntime(19217):    at de.slova.MainActivity.onCreate(MainActivity.java:3)
09-09 15:21:39.253: E/AndroidRuntime(19217):    at android.app.Activity.performCreate(Activity.java:6672)
09-09 15:21:39.253: E/AndroidRuntime(19217):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1140)
09-09 15:21:39.253: E/AndroidRuntime(19217):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2612)
09-09 15:21:39.253: E/AndroidRuntime(19217):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)
09-09 15:21:39.253: E/AndroidRuntime(19217):    at android.app.ActivityThread.-wrap12(ActivityThread.java)
09-09 15:21:39.253: E/AndroidRuntime(19217):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
09-09 15:21:39.253: E/AndroidRuntime(19217):    at android.os.Handler.dispatchMessage(Handler.java:102)
09-09 15:21:39.253: E/AndroidRuntime(19217):    at android.os.Looper.loop(Looper.java:154)
09-09 15:21:39.253: E/AndroidRuntime(19217):    at android.app.ActivityThread.main(ActivityThread.java:6123)
09-09 15:21:39.253: E/AndroidRuntime(19217):    at java.lang.reflect.Method.invoke(Native Method)
09-09 15:21:39.253: E/AndroidRuntime(19217):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
09-09 15:21:39.253: E/AndroidRuntime(19217):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
09-09 15:21:39.253: E/AndroidRuntime(19217): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.amazon.device.messaging.development.ADMManifest" on path: DexPathList[[zip file "/data/app/de.wortefarbers-1/base.apk"],nativeLibraryDirectories=[/data/app/de.wortefarbers-1/lib/arm, /system/lib, /vendor/lib]]
09-09 15:21:39.253: E/AndroidRuntime(19217):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
09-09 15:21:39.253: E/AndroidRuntime(19217):    at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
09-09 15:21:39.253: E/AndroidRuntime(19217):    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
09-09 15:21:39.253: E/AndroidRuntime(19217):    ... 14 more
09-09 15:21:39.255: W/ActivityManager(1385):   Force finishing activity de.wortefarbers/de.slova.MainActivity

However I do have the following in the app/build.gradle (and both jar files are indeed there):

amazonCompileOnly files('libs/amazon-device-messaging-1.1.0.jar')
amazonImplementation files('libs/login-with-amazon-sdk.jar')

And I do have xmlns:amazon="http://schemas.amazon.com/apk/res/android" in the AndroidManifest.xml. And my entire proguard-rules.pro is listed below:

-libraryjars libs/login-with-amazon-sdk.jar
-libraryjars libs/amazon-device-messaging-1.1.0.jar

-include okhttp3.pro

# -ignorewarning

-dontwarn org.conscrypt.**
-dontwarn com.amazon.device.messaging.**
-dontwarn com.huawei.**

-keep class com.amazon.device.messaging.** { *; }
-keep class androidx.multidex.** { *; }
-keep public class * extends com.amazon.device.messaging.ADMMessageReceiver
-keep public class * extends com.amazon.device.messaging.ADMMessageHandlerBase
-keep class android.support.v7.widget.SearchView { *; }

-keepattributes *Annotation*
-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes Signature

-keep class com.huawei.**{*;}
-keep class com.hianalytics.android.**{*;}

Solution

  • If they gave you an error log, they should also give you a list of the devices it failed on.

    The log says it cannot find the class com.amazon.device.messaging.development.ADMManifest

    I assume you've followed these instructions to set up ADM: https://developer.amazon.com/docs/adm/set-up.html

    Your gradle dependency and proguard file doesn't look exactly like their example. For example, yours is missing -keep public class * extends com.amazon.device.messaging.ADMMessageHandlerJobBase

    You might try to remove it and set it up again, and follow their example as closely as possible. Good luck