question

sreekant avatar image
sreekant asked tucker-simon answered

Getting issue while uploading APK on sandbox account.

Hi

I used android studio Arctic Fox |2020.3.1 patch 3 to create APK for sandbox account. I did not find V1 scheme to choose while creating APK. Hence I used appsigner to create the build with V1 signature. I used below command in command prompt and then try to install the APK on sandbox but getting the error.

E:\Android_SDK\Sdk\build-tools\30.0.3>apksigner sign --ks E:\EWMerchants-ENRG\EBTAutoSplit_JKS_FILE\EBT_Auto_Split.jks --v1-signing-enabled=true --v2-signing-enabled=false --v3-signing-enabled=false E:\EWMerchants-ENRG\release_apk\release\ewt_auto_split.apk

Error image attached.clover_upload_error.png

I also try to verify the APK with appsigner and print certificate also. All looks fine to me kindly suggest me to fix this issue. Previously i never faced this kind of issue while uploading the APK on sandbox.

Appsigner verify command screenshot attached.

appsigner print certificate.png

Please suggest how I can overcome this situation.


Sandbox
10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered

Try running zipalign BEFORE you sign your APK - https://developer.android.com/studio/command-line/zipalign.

10 |2000

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

sreekant avatar image
sreekant answered David Marginian Deactivated commented

Hi David,

Thanks for your reply. I tried zipalign below commands but each time i after compressing some files it shows "Verification FAILED".

zipalign -p -f -v 4 E:\EWMerchants-ENRG\release_apk\release\app-release.apk E:\EWMerchants-ENRG\release_apk\release\outfile.apk

zipalign -f -v 4 E:\EWMerchants-ENRG\release_apk\release\app-release.apk E:\EWMerchants-ENRG\release_apk\release\outfile.apk

zipalign -c -v 4 E:\EWMerchants-ENRG\release_apk\release\outfile.apk

Kindly suggest where I am doing mistake.

Attached the output of zipalign command.

zipalign error.png


zipalign-error.png (107.7 KiB)
1 comment
10 |2000

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

David Marginian avatar image David Marginian ♦♦ commented ·
You will need to research and resolve these errors on your end.
0 Likes 0 ·
jonahwills avatar image
jonahwills answered

If you're facing challenges while uploading your android app to your sandbox account, it could be due to compatibility issues, misconfigurations, or restrictions within the sandbox environment. I recommend double-checking the APK file to ensure it meets all requirements, verifying that your sandbox account settings are correctly configured for app uploads, and reaching out to the platform's support team for further assistance if needed.







10 |2000

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

brynn avatar image
brynn answered brynn edited

It seems like you’re encountering an issue with the APK signing process, specifically related to the V1 signature scheme. Since you mentioned using the apksigner tool with only V1 signing enabled, yet facing issues when uploading to the sandbox, here are a few steps you can take to troubleshoot and resolve the issue:

1. Verify APK Signature

  • You can use the following command to verify the APK signature and ensure it's correctly signed:
    bashCopy codeapksigner verify --verbose --print-certs ewt_auto_split.apk
    
  • Make sure that the output confirms the APK is signed with the V1 signature.

2. Check Minimum SDK Version

  • Ensure that the minSdkVersion in your build.gradle file is set correctly. The V1 signature scheme is mandatory for Android versions prior to Android 7.0 (API level 24). If the minimum SDK version is 24 or higher, you might not need V1 signing.

3. Ensure APK is Not Already Signed

  • Double-check that the APK you're signing with apksigner hasn't already been signed by Android Studio. If it has, signing it again might cause issues.
  • To confirm, you can check the APK's signing information with:
    bashCopy codejarsigner -verify -verbose -certs ewt_auto_split.apk
    

4. Try Rebuilding the APK

  • Rebuild the APK in Android Studio, ensuring no other signing configurations interfere with the process. You can do this by going to:
    • Build -> Clean Project
    • Build -> Rebuild Project

5. Use Android Studio to Sign the APK

  • If possible, try using Android Studio’s built-in signing process instead of the command line:
    • Go to Build -> Generate Signed Bundle / APK... and follow the steps.
    • Ensure both V1 and V2 signature schemes are selected.

6. Verify JKS File and Passwords

  • Ensure that the .jks file and the passwords provided are correct and match what’s needed to sign the APK.

7. Check the Error Log

  • Look into the exact error message in the sandbox or during installation. It might provide more insights into what is going wrong.

8. Review Android SDK and Tools Versions

  • Ensure that the build-tools version and the Android SDK used are compatible and updated. You can update your build-tools using the Android SDK Manager.

9. Consult Documentation or Forums

  • Look for similar issues in Android or sandbox-specific forums. It might be a common problem with a well-documented solution.

If you can share the specific error message or more details from the log, that could help pinpoint the issue further.

10 |2000

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

tucker-simon avatar image
tucker-simon answered

It looks like you're having trouble with APK signing and upload. Make sure to run the zipalign tool on your APK before signing it. Use the following command to align your APK: zipalign -p -f -v 4 input.apk output.apk, where input.apk is your original unaligned APK and output.apk is the aligned APK. After aligning, verify the APK with apksigner using the command apksigner verify --verbose output.apk to ensure it’s properly signed.


Additionally, ensure that your APK signing configuration matches the requirements of your sandbox environment, which might have specific needs for V1 or V2 signatures. If you’re still facing issues, check for any sandbox-specific restrictions or settings that might be affecting the upload. Rebuilding the APK from Android Studio with correct settings might also help resolve the issue.

10 |2000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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

Welcome to the
Clover Developer Community