• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

I need to remove "air." from package name. I'm get a Layout xml error when repackaging android app..

Guest
Aug 30, 2012 Aug 30, 2012

Copy link to clipboard

Copied

So, i'm doing this on my own app. I made an update for an older app that was build using Native Android. But this time, i used Adobe AIR... The catch is Adobe likes to append a "air." to the front of your package name without asking you. So basically I can't upload my update because it has a new package name is now "air.com.mycompany.myapp" rather than the original "com.mycompany.myapp"

Basically I'm going through this guide..

http://helpx.adobe.com/air/kb/opt-out-air-application-analytics.html

I followed all the steps, made all the adjustments to the androidmanifest.xml like it asks.

But after going along with the above guide, with no issues when i get to the step that says

"Run the following command to create the resource file for the updated AndroidManifest.xml:"

I run this..

    "/Users/brybam/Documents/eclipse/android-sdk-mac_x86/platform-tools/aapt" package -f -M AndroidManifest.xml -F resources.arsc -I "/Users/brybam/Documents/eclipse/android-sdk-mac_x86/platforms/android-8/android.jar" -S ./res

But I keep getting the same error regarding the xml files in res/layout

    ./res/layout/expandable_chooser_row.xml:1: error: Error parsing XML: not well-formed (invalid token)

    ./res/layout/expandable_multiple_chooser_row.xml:1: error: Error parsing XML: not well-formed (invalid token)

    ./res/layout/main.xml:1: error: Error parsing XML: not well-formed (invalid token)

    ./res/layout/multiple_file_selection_panel.xml:1: error: Error parsing XML: not well-formed (invalid token)

    ./res/layout/ssl_certificate_warning.xml:1: error: Error parsing XML: not well-formed (invalid token)

The guide doesn't say anything about these xml files, and im not sure what to do with these or how to handle them.

If i go into the res/layout folder, and just delete these (i know they're necessary. But i just deleted them as a test, to get through the rest of the guide...)

I was able to get through the rest of the steps in the guide fine, make an apk, and put it on my phone...only to find out the app will crash the moment you try to run it. Probably because i deleted the layout xml files...But i cant get the command i need to run above to accept them!

So, earlier in the guide they have me use thing thing called the "AXMLPrinter2.jar" to make the AndroidManifest.xml readable so i can edit it.

I run something like this:

    java -jar "/Users/brybam/Desktop/repackage/AXMLPrinter2.jar" AndroidManifest.xml > AndroidManifest.xml.bk

This makes a new file "AndroidManifest.xml.bk" and i can edit that.

So, I was thinking with all of these layout xml files, maybe I could run this "AXMLPrinter2.jar" on them and then edit them. Because right now if you open them they're not human readable, and its hard for me to work on them if they're not...

I tried this thinking i could do the same thing...

    java -jar "/Users/brybam/Desktop/repackage/AXMLPrinter2.jar" main.xml > main.xml.bk

Just get a blank file and a console erorr when trying to use the AXMLPrinter2.jar on the layout xml files...

    java.lang.ArrayIndexOutOfBoundsException: 67

              at android.content.res.StringBlock.getShort(StringBlock.java:231)

              at android.content.res.StringBlock.getString(StringBlock.java:91)

              at android.content.res.AXmlResourceParser.getName(AXmlResourceParser.java:140)

              at test.AXMLPrinter.main(AXMLPrinter.java:56)

So, I think my whole issue is based around these XML files not being converted to human readable before i try and re-package....

EDIT:::

Ok, so I found a site that talks about the error I'm getting but it's in chinese, and even after translating the page...I'm still not well versed with terminal and this stuff to get it.

It reads:

"Error.

Final conclusion:

In minSdkVersion <= 7, AXMLPrinter2.jar can normally decompile xml file

Greater than 7 can not be normal decompile xml file (AndroidManifest.xml except)

Give way to share a batch decompile xml file:

First, create a *. Txt file

Stresses inside the content authoring

for / r layout%% a in (*. xml) do @ java-jar AXMLPrinter2.jar "%% a" >> "%% a". txt

Then this txt file extension into bat form, and this BAT the file and AXMLPrinter2.jar on the same directory will be decompiled xml into the layout directory

Decompilation results can be generated by executing the bat file multiple xml files."

- http://hi.baidu.com/ghcghc/item/ecbaa1ce997cb225a0b50ac2

Maybe someone with more know-how could explain what they're explaining? I get that he's saying the issue im seeing appears when you're using minSdK <=7 but I need to use minSdk 8. Does anyone understand this work around? And how I might go about it on a Mac with terminal?

I wish adobe would make it easy to remove the "air." from the package name. If they want to convert old Native devs to AIR devs...the transition needs to be seamless. But now I'm about to have to go back to Native because I can't update an app I already have out on the market with an air app.

TOPICS
Development

Views

2.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 03, 2013 Jan 03, 2013

Copy link to clipboard

Copied

LATEST

Hello~
     I also tried to remove "air." package name in air application. And i encounter the same problem.
     I do not find any solution to decode the xml inside res folder by AXMLPrinter2.jar. And those xml inside is compressed which is unreadable.
     However, what you can do is copying the structure of res folder. And go to your air sdk file path -  adobeair-sdk-folder/lib/android/lib/resources/

     Replace those file exists in your res folder. And copy "values" folder to your res folder.

     Hope this solve your problem~

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines