Menu
AWS Device Farm
Developer Guide (API Version 2015-06-23)

Troubleshooting Android Application Tests in AWS Device Farm

The following topic lists error messages that occur during the upload of Android application tests and recommends workarounds to resolve each error.

Note

The instructions below are based on Linux x86_64 and Mac.

ANDROID_APP_UNZIP_FAILED

If you see the following message, follow these steps to fix the issue.

Warning

We could not open your application. Please verify that the file is valid and try again.

Make sure that you can unzip the application package without errors. In the following example, the package's name is app-debug.apk.

  1. Copy your test package to your working directory, and then run the following command:

    Copy
    $ unzip app-debug.apk
  2. After you successfully unzip the package, you can find the working directory tree structure by running the following command:

    Copy
    $ tree .

    A valid Android application package should produce output like the following:

    Copy
    . |-- AndroidManifest.xml |-- classes.dex |-- resources.arsc |-- assets (directory) |-- res (directory) `-- META-INF (directory)

    For more information, see Working with Android Tests in AWS Device Farm.

ANDROID_APP_AAPT_DEBUG_BADGING_FAILED

If you see the following message, follow these steps to fix the issue.

Warning

We could not extract information about your application. Please verify that the application is valid by running the command aapt debug badging <path to your test package>, and try again after the command does not print any error.

During the upload validation process, AWS Device Farm parses out information from the output of an aapt debug badging <path to your package> command.

Make sure that you can run this command on your Android application successfully. In the following example, the package's name is app-debug.apk.

  • Copy your application package to your working directory, and then run the command:

    Copy
    $ aapt debug badging app-debug.apk

    A valid Android application package should produce output like the following:

    Copy
    package: name='com.amazon.aws.adf.android.referenceapp' versionCode='1' versionName='1.0' platformBuildVersionName='5.1.1-1819727' sdkVersion:'9' application-label:'ReferenceApp' application: label='ReferenceApp' icon='res/mipmap-mdpi-v4/ic_launcher.png' application-debuggable launchable-activity: name='com.amazon.aws.adf.android.referenceapp.Activities.MainActivity' label='ReferenceApp' icon='' uses-feature: name='android.hardware.bluetooth' uses-implied-feature: name='android.hardware.bluetooth' reason='requested android.permission.BLUETOOTH permission, and targetSdkVersion > 4' main supports-screens: 'small' 'normal' 'large' 'xlarge' supports-any-density: 'true' locales: '--_--' densities: '160' '213' '240' '320' '480' '640'

    For more information, see Working with Android Tests in AWS Device Farm.

ANDROID_APP_PACKAGE_NAME_VALUE_MISSING

If you see the following message, follow these steps to fix the issue.

Warning

We could not find the package name value in your application. Please verify that the application is valid by running the command aapt debug badging <path to your test package>, and try again after finding the package name value behind the keyword "package: name."

During the upload validation process, AWS Device Farm parses out the package name value from the output of an aapt debug badging <path to your package> command.

Make sure that you can run this command on your Android application and find the package name value successfully. In the following example, the package's name is app-debug.apk.

  • Copy your application package to your working directory, and then run the following command:

    Copy
    $ aapt debug badging app-debug.apk | grep "package: name="

    A valid Android application package should produce output like the following:

    Copy
    package: name='com.amazon.aws.adf.android.referenceapp' versionCode='1' versionName='1.0' platformBuildVersionName='5.1.1-1819727'

    For more information, see Working with Android Tests in AWS Device Farm.

ANDROID_APP_SDK_VERSION_VALUE_MISSING

If you see the following message, follow these steps to fix the issue.

Warning

We could not find the SDK version value in your application. Please verify that the application is valid by running the command aapt debug badging <path to your test package>, and try again after finding the SDK version value behind the keyword sdkVersion.

During the upload validation process, AWS Device Farm parses out the SDK version value from the output of an aapt debug badging <path to your package> command.

Make sure that you can run this command on your Android application and find the package name value successfully. In the following example, the package's name is app-debug.apk.

  • Copy your application package to your working directory, and then run the following command:

    Copy
    $ aapt debug badging app-debug.apk | grep "sdkVersion"

    A valid Android application package should produce output like the following:

    Copy
    sdkVersion:'9'

    For more information, see Working with Android Tests in AWS Device Farm.

ANDROID_APP_AAPT_DUMP_XMLTREE_ FAILED

If you see the following message, follow these steps to fix the issue.

Warning

We could not find the valid AndroidManifest.xml in your application. Please verify that the test package is valid by running the command aapt dump xmltree <path to your test package> AndroidManifest.xml, and try again after the command does not print any error.

During the upload validation process, AWS Device Farm parses out information from the XML parse tree for an XML file contained within the package using the command aapt dump xmltree <path to your package> AndroidManifest.xml.

Make sure that you can run this command on your Android application successfully. In the following example, the package's name is app-debug.apk.

  • Copy your application package to your working directory, and then run the following command:

    Copy
    $ aapt dump xmltree app-debug.apk. AndroidManifest.xml

    A valid Android application package should produce output like the following:

    Copy
    N: android=http://schemas.android.com/apk/res/android E: manifest (line=2) A: android:versionCode(0x0101021b)=(type 0x10)0x1 A: android:versionName(0x0101021c)="1.0" (Raw: "1.0") A: package="com.amazon.aws.adf.android.referenceapp" (Raw: "com.amazon.aws.adf.android.referenceapp") A: platformBuildVersionCode=(type 0x10)0x16 (Raw: "22") A: platformBuildVersionName="5.1.1-1819727" (Raw: "5.1.1-1819727") E: uses-sdk (line=7) A: android:minSdkVersion(0x0101020c)=(type 0x10)0x9 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x16 E: uses-permission (line=11) A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET") E: uses-permission (line=12) A: android:name(0x01010003)="android.permission.CAMERA" (Raw: "android.permission.CAMERA")

    For more information, see Working with Android Tests in AWS Device Farm.

ANDROID_APP_DEVICE_ADMIN_PERMISSIONS

If you see the following message, follow these steps to fix the issue.

Warning

We found that your application requires device admin permissions. Please verify that the permissions are not required by run the command aapt dump xmltree <path to your test package> AndroidManifest.xml, and try again after making sure that output does not contain the keyword android.permission.BIND_DEVICE_ADMIN.

During the upload validation process, AWS Device Farm parses out permission information from the xml parse tree for an xml file contained within the package using the command aapt dump xmltree <path to your package> AndroidManifest.xml.

Make sure that your application does not require device admin permission. In the following example, the package's name is app-debug.apk.

  • Copy your application package to your working directory, and then run the following command:

    Copy
    $ aapt dump xmltree app-debug.apk. AndroidManifest.xml

    You should find output like the following:

    Copy
    N: android=http://schemas.android.com/apk/res/android E: manifest (line=2) A: android:versionCode(0x0101021b)=(type 0x10)0x1 A: android:versionName(0x0101021c)="1.0" (Raw: "1.0") A: package="com.amazonaws.devicefarm.android.referenceapp" (Raw: "com.amazonaws.devicefarm.android.referenceapp") A: platformBuildVersionCode=(type 0x10)0x16 (Raw: "22") A: platformBuildVersionName="5.1.1-1819727" (Raw: "5.1.1-1819727") E: uses-sdk (line=7) A: android:minSdkVersion(0x0101020c)=(type 0x10)0xa A: android:targetSdkVersion(0x01010270)=(type 0x10)0x16 E: uses-permission (line=11) A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET") E: uses-permission (line=12) A: android:name(0x01010003)="android.permission.CAMERA" (Raw: "android.permission.CAMERA") ……

    If the Android application is valid, the output should not contain the following: A: android:name(0x01010003)="android.permission.BIND_DEVICE_ADMIN" (Raw: "android.permission.BIND_DEVICE_ADMIN").

    For more information, see Working with Android Tests in AWS Device Farm.