Issue when trying to publish multiple APKs to the Google Play Store


#1

Firstly, I’m sorry for the English translated by Google

Good afternoon people

I developed an application with Ionic using the crosswalk plugin. When compiling, two .apk files are generated, one for arm7 architecture and one for x86 architecture. Until then, everything ok. I tested both apks on compatible smartphones and both worked.

I performed the signature and alignment steps described in the Ionic Framework documentation.

My question is when you try to publish to the Google Play Console.

There is the following Google documentation that tells you that you can submit more than one apk to the same app. In this same documentation, it says that this is only possible when Advanced Mode is enabled.

To publish multiple APKs for the same application, you must enable Advanced mode in your application’s APK files tab (as discussed in the previous section). Once in advanced mode, you can upload, activate, then publish multiple APKs for the same application.

And in the above mentioned topic, it is written:

The Google Play Console provides two modes for managing the APKs associated with your application: simple mode and advanced mode. You can switch between these by clicking the link at the top-right corner of the APK files tab.

The problem is, where is this blessed link in the upper right corner, I’m looking for the hours and I can not find it.

Thanks for listening.




#2

Are you sure this still exists? Have you tried the normal buttons (last screenshot) to upload both files?


#3

Actually, it looks like Google documentation, refers to an earlier version of the Google Play Console.

Anyway, when trying to upload the second APK file, I get the message:

Upload failed
Use another version code for your APK. You already have an APK with version code 100002.


#4

Look inside the “biblioteca de artefatos” if this is true. You can delete them there as well.


#5

Good morning, thank you for the response.
I accessed the “Artifact Library” session and deleted the only existing APK.
But when I try to upload the two APK files again, I keep getting the message:

"Failed to send
Use another version code for your APK. You already have an APK with version code 100002 "


#6

Do both APKs you are uploading have the same version code?
Normally when building with crosswalk these get different version codes…

What is the command you used to build?


#7

I do not know how to check the APK version code after it has been compiled. But I think so, because I ran the command to build and both files were generated at the same time.

I used the command:

ionic build android –release


#8

You wrote you tested them on device. You should be able to check in the app info I think… or with some thrid party “apk extractor” tool, these tend to show information about the installed APKs quite well.


#9

Yesterday I finished publishing, only apk with the arm7 architecture. I installed it on my smartphone (which is arm7) and it worked fine.
When I go to analyze the information of the app installed on the mobile, android informs the version “1.0.0”.
But on a smartphone from a friend of mine (which is x86). After the installation, it receives that classic error of incompatibility (Mismath of CPU Architecture … The Crosswalk Project Service must be updated to math the CPU architecture …)


#10

That is expected when you only upload the arm7 version, right?

You have to find out if your both builds have different build numbers. They should have, otherwise you get the error you are currently getting when uploading the second file.


#11

Dude, for now I thank you immensely for all your dedication to helping me with this problem.
Today at 21:00 (Brazil Time) I will try this solution that seems to have something to do with what you said.
I’ll come back here to say whether it worked or not.


#12

Hey @silvairsoares - Crosswalk by default outputs two APKs which have different version numbers so this issue should not occur. It won’t accept a new APK on the Play Store if it has the same version number as you encountered - are you sure the original APK was removed before you started uploading the new ones?

As you have already published it, I don’t think you can now remove the APKs. You can try:

  1. Bump the version number to 1.0.1 or above and try rebuilding then uploading both APKs in the same release

  2. Disable XWALK_MULTIPLEAPK mode in config.xml by entering:

inside of your crosswalk plugin declaration. Make sure you delete your platforms/android/build folder and then rebuild after setting this, then you should get a single android-release.apk file which works for both architectures.


#13

@CookieCooksoon also mentioned in Slack how you can check your current 2 APKs if the do have the same build number:

cookiecookson [3:24 PM]
oh right, yeah they need to have different numbers - you can get its details with aapt dump badging your_apk.apk
[3:25]
might need to add aapt to your command line path
[3:25]
it should be in the sdk/build-tools folder somewhere
[3:26]
Are there two APKs with the same version because of crosswalk? Because that shifts the version code slightly to avert this situation
[3:27]
alternatively you can do some good old fashioned digging and open up the APK as as zip and find the androidmanifest.xml file which could contain the value (not 100% on this though!)

I would go with the latter - rename both .apk files to .zip, extract them and look for the AndroidManifest.xml file. It should contain the versionCode value.


#14

And another, even easier option:

jcesarmobile [4:04 PM]
With Android Studio you can see the .apk content without unzipping
[4:04]
Build -> Analize APK


#15

Bad news for now. Even if you change an XWALK_MULTIPLEAPK option to false, two APK files continue to be generated.


#16

I was able to solve it, thanks to the tips posted here.

What I did was:

1-I ran a build, which generated the APKs with the internal version 100012, signed, aligned and uploaded the arm7 version and despised the x86 generated in this same compilation.

1-I ran a new build, which generated the APKs with the internal version 100014, signed, aligned and uploaded the x86 version and despised the arm7 generated in this same compilation.

By submitting the two apks to the Google Play Store, they are usually accepted.

I have no words to thank you all for using your precious time to help me.

God bless you a lot!

Thank you so much.


#17

Haha, that is an interesting workaround.

So your two APKs are indeed generated with the same versionCode. The question is: Why?
Did you always define the versoinCode manually in your config.xm?


#18

Well, very strange, I still can not identify why two apks with equal internal versions in the same compilation. But I followed this solution and for now everything is ok.

What about setting the versionCode in config.xml. No, I have never changed this information manually. The only thing I changed was the version name (“1.0.0”, “1.0.1”, “1.0.2” …)

<widget id="com.example.hello" version="1.0.2">

Here is the published application link (now available for x86 and arm7)

Thanks for everything.