versionCode error

I am revved up and read to upload my app the Android Marketplace, but I get this error from their website:

“Market requires versionCode to be set to a positive 32-bit integer in AndroidManifest.xml.”

When I build the app, the version is set to 1. Am I missing something?

Thanks a bunch guys. You’re all awesome when it comes to support.

-Cullen [import]uid: 52847 topic_id: 12497 reply_id: 312497[/import]

What does your build.settings say? You may have to add this to your build.settings file:

android = { versionCode = "1" }, [import]uid: 14218 topic_id: 12497 reply_id: 45672[/import]

I added the code and it still says “1.0” on my phone and not “1”.

I thought that the version you put down during the build is what was signed to your app.

Any more input? Thanks! [import]uid: 52847 topic_id: 12497 reply_id: 45807[/import]

I can edit version code and version name with decompiling my game.
Use apktool to decompile your game: http://code.google.com/p/android-apktool/
Then edit version code and version name in AndroidManifest.xml (you can use texteditor for that). After that use apktool to recompile your game. Then just re-sign your game using same keystore when you build your game first time with Corona. And then you should be able to publish your game. [import]uid: 18445 topic_id: 12497 reply_id: 45809[/import]

Dang.

So you weren’t able to get your app to display a correct version number either?

I’d rather not use the apk tool every time I build an app. Any way past this?

Thanks though for the work around. [import]uid: 52847 topic_id: 12497 reply_id: 45813[/import]

I can set correct VERSION CODE with corona. VERSION CODE must be number like 1, 2, 3…
But i cant set correct VERSION NAME with Corona. VERSION NAME must be like 1.0, 1.1, 1.2 …
In android if you go to settings->applications->manage applications and select your game, you can see VERSION NAME (for example 1.0). There shouldnt read “1”.

If you build your game and only test it in real phone, it is same what version code and version number you have. But when you publish your game to market, you should use apk tool to set version code and version number what you like.

By the way, i am using corona windows version. [import]uid: 18445 topic_id: 12497 reply_id: 45818[/import]

When I go into “manage applications” my app is listed as “1.0”. I was under the impression, as a result of other threads here on Corona, that I needed a “1” without a decimal value.

I went into my build.settings and changed my version code to “1”. Is there any way at all that I can change the version NAME without using apktool? I’ve been looking online and cannot find a step by step guide in its use.

Thanks a bunch. [import]uid: 52847 topic_id: 12497 reply_id: 45832[/import]

I can’t even find out how to install the apk-tool O.o

I’m following the guide here for manifest editing:
http://www.base2solutions.com/walkabout/Corona%20Tips.html#7

I get along just fine until I have to place an .apk file in the apktool folder that doesn’t exist.

Help!
(thanks) [import]uid: 52847 topic_id: 12497 reply_id: 45973[/import]

http://www.base2solutions.com/walkabout/Corona%20Tips.html#7 guide is for APK MANAGER. I dont know why, but apk manager doesnt work for me with latest Corona sdk daily builds. I just get error when i try to decompile my game. So i started to use APK TOOL, which work well.
Step by step guide to use apktool:
Download http://android-apktool.googlecode.com/files/apktool1.4.1.tar.bz2
and http://android-apktool.googlecode.com/files/apktool-install-windows-r04-brut1.tar.bz2
Then extract both files to SAME FOLDER.
Then you should have “aapt.exe”, “apktool.bat” and “apktool.jar” files in SAME FOLDER.
Now copy your .apk file to same folder.
Then start cmd.exe application, you can start it with searching “cmd” in windows start menu.
Then put this code to cmd and press enter:
“cd C:\Users\YOURUSERNAME\Documents\apktool”
PATH must be to your apktool folder. Path i wrote previously is just example.
Then put this code to cmd: “apktool d YOURAPKNAME.apk OUTPUTFOLDER”
Now apktool decompiles your apk and creates new folder, in previous code it creates folder called OUTPUTFOLDER
Then go to new folder and edit AndroidManifest.xml
Then put this code to cmd: “apktool b OUTPUTFOLDER YOURNEWAPKNAME.apk”
Then apktool recompiles new apk from your folder
And you are almost done, to publish your game to market, you need to re-sign your game with keystore you used to build it with corona.

That all sounds really complicated, but when you do that couple times, it takes only few minutes. [import]uid: 18445 topic_id: 12497 reply_id: 46027[/import]

Thank you so much. I have apktool running now and it creates the output folder specified.

However there isn’t an .XML file in the folder, just a ton of sub-folders with .smali formats.

Is that supposed to happen? [import]uid: 52847 topic_id: 12497 reply_id: 46056[/import]

The .apk is nothing but a ZIP file, so if you rename it and unzip it, you can get to its resources inside and then you can edit/alter whatever you want and repackage it by zipping it and renaming the .zip to .apk

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 12497 reply_id: 46061[/import]

I would have loved for that to work. I got into the source, opened the .XML file and found that everything became garbled.

What would happen if I replaced it with my own .XML file?

Why doesn’t corona support correct versionCode and versionName editing?

Thanks a ton. [import]uid: 52847 topic_id: 12497 reply_id: 46065[/import]

Yes you can unzip apk, but then if you try to edit AndroiManifest.xml, you can see that it is in some kind of binary format or something. So you cant not edit it.
Apk tool decodes AndroidManifest.xml to editable mode.

cullenjwebb, i dont know why it is not working. For me it works perfectly, and i can see AndroidManifest.xml in folder. [import]uid: 18445 topic_id: 12497 reply_id: 46066[/import]

About replacing xml with your own, it might be possible. But apps made with corona, has some corona stuff in AndroidManifest.xml
Here is example AndroidManifest.xml from app made with corona:

<?xml version="1.0" encoding="utf-8"?>  
<manifest package="PUT_YOUR_PACKAGE_IDENTIFIER_HERE" android:versioncode="1" android:versionname="1.0" android:installlocation="auto"> xmlns:android="http://schemas.android.com/apk/res/android"&gt;<br> <uses-sdk android:minsdkversion="8"></uses-sdk><br> <uses-permission android:name="android.permission.INTERNET"></uses-permission><br> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission><br> <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission><br> <uses-feature android:glesversion="65537"></uses-feature><br> <application android:label="YOUR_GAME_NAME" android:icon="@drawable/icon" android:debuggable="true"><br> <activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:label="YOUR_GAME_NAME" android:name="com.ansca.corona.CoronaActivity" android:launchmode="singleTask" android:screenorientation="landscape"><br> <intent-filter><br> <action android:name="android.intent.action.MAIN"></action><br> <category android:name="android.intent.category.LAUNCHER"></category><br> </intent-filter><br> </activity><br> <provider android:name="com.ansca.corona.FileContentProvider" android:authorities="YOUR_PACKAGE_IDENTIFIER.files"></provider><br> <activity android:theme="@style/OFNestedWindow" android:label="IntroFlow" android:name="com.openfeint.internal.ui.IntroFlow" android:configchanges="keyboardHidden|orientation"></activity><br> <activity android:theme="@style/OFNestedWindow" android:label="Dashboard" android:name="com.openfeint.api.ui.Dashboard" android:configchanges="keyboardHidden|orientation"></activity><br> <activity android:theme="@style/OFNestedWindow" android:label="Settings" android:name="com.openfeint.internal.ui.Settings" android:configchanges="keyboardHidden|orientation"></activity><br> <activity android:theme="@style/OFNestedWindow" android:label="NativeBrowser" android:name="com.openfeint.internal.ui.NativeBrowser" android:configchanges="keyboardHidden|orientation"></activity><br> <activity android:name="com.adknowledge.superrewards.ui.activities.SRPaymentMethodsActivity" android:screenorientation="portrait"></activity><br> <activity android:name="com.adknowledge.superrewards.ui.activities.SRDirectPaymentActivity" android:screenorientation="portrait"></activity><br> <activity android:name="com.adknowledge.superrewards.ui.activities.SROfferPaymentActivity" android:screenorientation="portrait"></activity><br> <activity android:name="com.adknowledge.superrewards.ui.activities.SRWebViewActivity" android:screenorientation="portrait"></activity><br> <activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:name="com.zong.android.engine.web.ZongWebView" android:screenorientation="portrait"><br> <intent-filter><br> <action android:name="com.adknowledge.superrewards.ui.activities.SRZongPaymentActivity"></action><br> <category android:name="android.intent.category.DEFAULT"></category><br> </intent-filter><br> </activity><br> <uses-library android:name="com.google.android.maps"></uses-library><br> <service android:name="com.zong.android.engine.process.ZongServiceProcess" android:enabled="true" android:exported="false"></service><br> </application><br></manifest>  

[import]uid: 18445 topic_id: 12497 reply_id: 46071[/import]

Dang uapo15! You are one step ahead of figuring out every road block I am running into with my Android build. Thank you so much for your instructions above, worked like a charm!

Was able to edit save and re-sign and zip align my binary. Just got uploaded to android market.

Thanks again! [import]uid: 29520 topic_id: 12497 reply_id: 46088[/import]

uapo15, I am having the same problem with not being able to update my versionCode. Since it works for you, can you post your entire build.settings file as well as the version number of Corona you are running? Also, are you running the Mac or Windows version of Corona?

Thanks in advance. [import]uid: 22492 topic_id: 12497 reply_id: 46148[/import]

Here is my build.settings

settings =  
{  
 orientation =  
 {  
 default = "portrait",  
 supported =  
 {  
 "portrait"  
 },  
 },  
  
 android =  
 {  
 versionCode = "3"  
 },  
  
  
}  

With that you can edit VERSION CODE, not VERSION NAME.

I am running daily build 570 in Windows. [import]uid: 18445 topic_id: 12497 reply_id: 46185[/import]

Awesome, that got it working!

Thanks uapo15 for posting your build.settings file. I guess I had a goofy comma missing or something. [import]uid: 22492 topic_id: 12497 reply_id: 46191[/import]

Here is my build.settings file. Even with this I cannot upload my app the the Android Market because of the versionCode error.

settings =  
{  
  
 orientation =  
 {  
 default = "landscapeRight",  
 supported =  
 {  
 "landscapeRight", "landscapeLeft"  
 },  
 },  
   
 android =  
 {  
 versionCode = "1"  
 },  
  
 iphone =  
 {  
 plist =  
 {  
 UIStatusBarHidden=true,  
 UIPrerenderedIcon = true  
 },  
 }  
  
  
}  

Notice anything wrong? Trying to edit the manifest file after building has turned out so well for me, and this is my last idea.

Thanks a bunch.
-Cullen [import]uid: 52847 topic_id: 12497 reply_id: 47347[/import]

That is very strange. I dont see any problems in build.settings.
If you cant get it working, you could try to edit manifest after building. That should work. [import]uid: 18445 topic_id: 12497 reply_id: 47350[/import]