versionCode error

Well, if editing the manifest is my last bet, would anyone be willing to use remote desktop to get it working on my pc?

I cannot for the life of me get my Manifest extracted. All I get is gibberish.

I would like to mention that you guys have been quick to respond and very helpful. [import]uid: 52847 topic_id: 12497 reply_id: 47353[/import]

cullenjweb - Sorry, just want to clarify, did use the apktool and follow uapo15’s directions in the above post http://developer.anscamobile.com/forum/2011/07/15/versioncode-error#comment-46027 on how to decompile your apk FIRST before trying to edit the manifest?

It sounds like you are trying to edit the manifest directly, prior to using the apktool. If you change the apk to a zip you can see the file structure but when you try and edit the manifest it’s garbled. You must decompile it in order to edit it.

The steps are (I am using my actual command lines below, with my file/keystore names, replace with the name for your own app):

  1. decompile the apk using the apktool command line looks like this "apktool d RedneckJellyfish.apk RedneckJellyfish

  2. go into the folder that the apktool just created and edit the line in the manifest so that it reads something like this:

xmlns:android=“http://schemas.android.com/apk/res/android”>

3. then recompile using apktool "apktool b RedneckJellyfish RedneckJellyfish_new.apk"

4. then resign your app using the jarsigner (comes with android SDK) “jarsigner -verbose -keystore mudstuffing.keystore
RedneckJellyfish_new.apk mykeyaliasname” where the keystore and the keystore alias is the same what you are using when you build in Corona

5. realign the apk file (this is optional) "zipalign -v 4 RedneckJellyfish_new.apk RedneckJellyfish_final.apk"

6. Submit the final version “RedneckJellyfish_final.apk” to the android market.

[import]uid: 29520 topic_id: 12497 reply_id: 47357[/import]

I follow the instructions which results with this in the cmd window. All I have in the output folder is a bunch of smali files.

[import]uid: 52847 topic_id: 12497 reply_id: 47364[/import]

Wierd… And zombieshooter.apk is in the same directory as apktool?

Sorry, I am not sure why it’s not working. [import]uid: 29520 topic_id: 12497 reply_id: 47369[/import]

Yes, it’s the same directory. I get an output, but it’s useless smali files.

[import]uid: 52847 topic_id: 12497 reply_id: 47371[/import]

cullenjwebb,

One possible thing wrong with your build.settings file is your line #27. I think it should have a comma after the brace. I say this because if you compare it to uapo15’s posted file, he has a comma at the end of the brace on line #15.
The only other things I can think of is a typo in the filename “build.settings” or it’s not in the correct folder (should be in the same place as main.lua).

[import]uid: 22492 topic_id: 12497 reply_id: 47608[/import]

Thanks for catching that. I have copied and pasted uapo’s build.settings into my own and changed only the portrait to landscapeRight.

Shouldn’t this make my app version appear as “1” and not “1.0” in manage applications? It’s still showing up as “1.0”. [import]uid: 52847 topic_id: 12497 reply_id: 47768[/import]

VERSIONCODE is “1” and VERSIONNAME is “1.0”. If it shows “1.0” in manage applications, it is right. You can not see VERSIONCODE in manage applications. Understant? :slight_smile: [import]uid: 18445 topic_id: 12497 reply_id: 47777[/import]

After countless days fixing one bug after another I finally figured out the problem. You need to use a Mac.

I got the JDK to work on my pc but the next thing you know the app does not install on my android device. If you fix one bug on a pc you end up having to fix a new bug and searching the forums to fix that new bug. Then the new bug creates problems with an old bug. It’s just not worth the time to do these work arounds.

Using corona on a Mac to build android game apps will save you a ton of time and stop the agonizing pain of finding work arounds. [import]uid: 77076 topic_id: 12497 reply_id: 49078[/import]

Thanks a bunch uapo15!

After copy-pasting your config.lua instead of mine it worked perfectly.

I would like to take the time, however, of suggesting a app for windows:
http://forum.xda-developers.com/showthread.php?t=890199

It works like a charm and lets your edit and decompile your app without any coding at all. It’s flippin amazing.

Later! [import]uid: 52847 topic_id: 12497 reply_id: 49828[/import]

I’m ran into the same problem, after having published two apps previously:
“Market requires versionCode to be set to a positive 32-bit integer in AndroidManifest.xml.”

What is missleading is the error message: in AndroidManifest.xml. From my experienc, not true.

Add the versionCode to you build file, not your xml file. Of course, make sure all your version numbers are the same! Thanks to uapo15, that little bit of info helped.

M
[import]uid: 77730 topic_id: 12497 reply_id: 50941[/import]

Just a quick note. To use apk manager with the latest corona you need to update this file in the ‘Other’ folder:

http://www.mediafire.com/?f354aq5u71w5jp6

Apk manager actually uses apktool to do everything, however it also includes the android frameworks jar to verify the options you set in the manifest.

jayantv: the manifest is actually a java compressed xml, and you cant just edit it directly. [import]uid: 8872 topic_id: 12497 reply_id: 53556[/import]

Thanks. I updated with the file provided here. The apk will now decompile, but it will not compile, so I am unable to change any manifest items.

Is that just me? [import]uid: 28534 topic_id: 12497 reply_id: 56117[/import]

Hmm, thats odd. What error do you get?

Make sure you don’t ‘add’ any files to the directory where you’re editing the manifest. If the program you use to edit the manufest file creates a .bak file for example, compiing will fail [import]uid: 8872 topic_id: 12497 reply_id: 56585[/import]

All I was doing (as I was testing if it would work), was de-compile then recompile. No changes where made to any file.

The error from the log file:
I: Building resources…
invalid resource directory name: C:\Users\BenM\Downloads\apk_manager_4\apk_manager_4.9\other…\projects\SquishyFruit.apk\res/layout-xlarge
Exception in thread “main” brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\BenM\AppData\Local\Temp\APKTOOL8976243192328022059.tmp, -I, C:\Users\BenM\apktool\framework\1.apk, -S, C:\Users\BenM\Downloads\apk_manager_4\apk_manager_4.9\other…\projects\SquishyFruit.apk\res, -M, C:\Users\BenM\Downloads\apk_manager_4\apk_manager_4.9\other…\projects\SquishyFruit.apk\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\BenM\AppData\Local\Temp\APKTOOL8976243192328022059.tmp, -I, C:\Users\BenM\apktool\framework\1.apk, -S, C:\Users\BenM\Downloads\apk_manager_4\apk_manager_4.9\other…\projects\SquishyFruit.apk\res, -M, C:\Users\BenM\Downloads\apk_manager_4\apk_manager_4.9\other…\projects\SquishyFruit.apk\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
… 6 more
Could Not Find C:\Users\BenM\Downloads\apk_manager_4\apk_manager_4.9\place-apk-here-for-modding…/place-apk-here-for-modding/signedSquishyFruit.apk
Could Not Find C:\Users\BenM\Downloads\apk_manager_4\apk_manager_4.9\place-apk-here-for-modding…/place-apk-here-for-modding/unsignedSquishyFruit.apk
I: Baksmaling…
I: Loading resource table…
W: Skipping “android” package group
I: Loaded.
I: Loading resource table from file: C:\Users\BenM\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources…
I: Decoding values*/* XMLs…
I: Done.
I: Copying assets and libs…
The system cannot find the path specified.
The system cannot find the path specified.
Thanks,
Ben [import]uid: 28534 topic_id: 12497 reply_id: 56586[/import]

I found the compile problem. Posting here in case others have an issue similar to this.

The first error listed above show an invalid directory name:
“C:\Users\BenM\Downloads\apk_manager_4\apk_manager_4.9\other…\projects\SquishyFruit.apk\res/layout-xlarge”

The solution was actually as simple as deleting the directory and it then compiled successfully for the first time. I guess I can now fix some things, like the “versionName stuck on 1.0” problem that plagues us all.

Ben [import]uid: 28534 topic_id: 12497 reply_id: 60311[/import]

Everyone,

We’ve added version name support to the newest daily build, which is available to you if you are a paid subscriber. You cannot set the version name into the build window just yet (we’ll add it in the near future), but you can set the version name via the “build.settings” file as follows…

settings ={ android = { versionName = "2.0" }}[/code] [import]uid: 32256 topic_id: 12497 reply_id: 60906[/import]

Thanks Josh…

Yes, that works fine now.

Ben [import]uid: 28534 topic_id: 12497 reply_id: 60970[/import]