question

andymx51 avatar image
andymx51 asked lorenzo edited

APK Upload fails with "Failed to sign APK file"

Hi,

I'm trying to upload my first APK file to the sandbox. I've followed the instructions but I get the following error when I do the upload.

I've made sure I'm using v1 of the jar spec, my file size is 13MB, I can see the CERT.RSA inside my apk file, its a release build not a debug one. The package name starts with io.mx51, the minSdk is 21 (we're targeting Flex devices), the targetSdk is 25.


Does anyone have any suggestions as to why this APK file doesn't get resigned when I upload it to the portal?


Thanks.

App Market
14 comments
10 |2000

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

andymx51 avatar image andymx51 commented ·

I've tried building the APK both on the command line, and through Android Studio, the versionCode of my app is 1 and the versionName is "3.0.0".

I'm using Android Studio 4.1.0-alpha-06, and the Gradle version in my gradle-wrapper.properties is gradle-6.3-all.zip

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ andymx51 commented ·

Assuming your app id is ...NPJR, the error I see in the logs is:

Caused by: java.util.zip.ZipException: duplicate entry: 
at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:233)
0 Likes 0 ·
andymx51 avatar image andymx51 David Marginian ♦♦ commented ·

Ah, ok....yes my application id ends with NPJR.


The apk itself works fine when side-loaded onto a device, does the error message give any details as to which file is duplicated? Is there a way that I can see that error log?

0 Likes 0 ·
Show more comments
andymx51 avatar image
andymx51 answered

It looks like the apk files generated by Android Studio 4.1 using Gradle 6.3 aren't compatible with the Clover upload. If I fallback to Android Studio 3.6.3 and Gradle 5.6.4 the exact same sample project uploads successfully.


There are features of the new Android Studio and Gradle that we rely on in our actual app desugaring of newer features onto older APIs using the new D8 and R8.


Will your team be able to investigate the differences between the apk output from these 2 AS and Gradle versions to work out a fix for the Clover upload process?

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 ·

Interesting, this is really outside of my area of expertise. I need to ask around, I'll get back to you when I get an answer.

0 Likes 0 ·
lorenzo avatar image
lorenzo answered lorenzo edited

Check if the APK file is signed properly in the first place. If the file is not signed or signed incorrectly, it may not get resigned when uploaded to the portal.

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