0

I am uploading the APK using python code, when I check for status after create_upload and uploading the actual file then I keep getting FAILED with android_app_aapt_debug_badging_failed. Any Idea why ?

Sam
  • 31
  • 4

2 Answers2

1

Sorry to hear that you are running into issues with the upload. For the error code you are facing, i am pasting the debugging steps below

Debugging Steps During the upload validation process, AWS Device Farm parses out information from the output of an "aapt debug badging " 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:

$ aapt debug badging app-debug.apk A valid Android application package should produce output like the following:

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'

Hongda Zhao
  • 101
  • 2
  • It turned out that the upload was bad, python code was not reading the full file. – Sam Dec 07 '16 at 21:48
  • @Sam I'm running into the same issue here. Can you let me know how did you upload the file? Did you use Requests or PyCurl? – solidak Oct 04 '17 at 11:17
  • I was missing content-length header I was using requests I believe. I think you should use fastlane's plugin tho. – Sam Nov 30 '17 at 01:33
0

I was having this exact issue, and none of the suggestions were doing any good.

The fix was to assign the file to data instead of files.

def upload_app(path):
    url, arn = create_signed_upload('ANDROID_APP')
    headers = {'content-type': 'application/octet-stream'}
    with open(path, 'rb') as app:
        requests.put(url, data=app, headers=headers)
    success = wait_on_upload(arn)
    return success