# There was a problem parsing the package....



## Jmoney4769

Hey guys,

I am attempting to port the MIUI messaging apk to other roms so that I can still use the messaging app in AOKP. The challenge is that I want to keep the theme that I have on it. I copied the files from the theme into the apk and I resigned it using the signapk.jar file, but when I try to install it, it says "there was a problem parsing the package." How can I fix this?

Some observation revealed that the original Mms.apk app from the MIUI rom would not install in place of the default Mms.apk on my phone. I tried both just selecting it and choosing and selecting install and manually copying the file to /system/app/Mms.apk and rebooting. That apk will not install as a data app with my little testing. Does anyone have any ideas?

If anyone is interested, here are the files I am using:

Orignial Mms.apk: https://www.box.com/s/e2cb206de30d727818c8

Modified Messaging app: https://www.box.com/s/8dd91f5b2421a83f5493

Theme file (as a zip): https://www.box.com/s/eddbd817cd2941678711


----------



## yarly

Probably requires core framework modifications that Miui adds elsewhere or the app uses code from Android that is newer than the version your device has.


----------



## JBirdVegas

yarly said:


> Probably requires core framework modifications that Miui adds elsewhere or the app uses code from Android that is newer than the version your device has.


This ^^

Also check that you don't have any derps in your resource declarations. Parsing errors are generally thrown when attempting to get usable values from XML, JSON or some other platform independent language, in this case I would guess XML, maybe check the manifest and attrs to see if they reference something miui dependant, or if they are just improperly formatted.


----------



## yarly

Also try logcat when you install it and try using package manager (pm) directly to install it to see if it's any more verbose


----------



## JBirdVegas

yarly said:


> Also try logcat when you install it and try using package manager (pm) directly to install it to see if it's any more verbose


I'm not sure pm will let you install system apps but I know you can use:

adb remount
adb push localPath /system/app/.

Either way yarly is correct your going to get the most info when you try to install even if it places the app somewhere other than /system/app

Show us what adb logcat tells you when you attempt to install maybe we can give you more direction


----------



## yarly

Oh, you might also need to make sure it uses the proper framework library to compile/decompile.

See here for more details: http://code.google.com/p/android-apktool/wiki/FrameworkFiles


----------



## Jmoney4769

Hey guys, sorry it's taken so long for me to reply. I am on vacation and right now wifi is only working on the Windows part of my laptop and since I got it last week I don't have adb on the linux part yet :x I should be able to get it all done on Tuesday night or Wednesday


----------



## Jmoney4769

Alright guys, here is the logcat from installing the app in /system/app

W/PackageManager( 1787): Application package com.android.mms already installed. Skipping duplicate.
D/dalvikvm(12662): GC_CONCURRENT freed 618K, 30% free 5774K/8195K, paused 7ms+6ms
D/dalvikvm(12662): GC_FOR_ALLOC freed 201K, 23% free 6383K/8195K, paused 26ms
I/dalvikvm-heap(12662): Grow heap (frag case) to 6.759MB for 138256-byte allocation
D/dalvikvm(12662): GC_FOR_ALLOC freed 0K, 23% free 6518K/8387K, paused 25ms
D/dalvikvm(12662): GC_FOR_ALLOC freed 13K, 23% free 6530K/8387K, paused 23ms
I/dalvikvm-heap(12662): Grow heap (frag case) to 6.903MB for 138256-byte allocation
D/dalvikvm(12662): GC_FOR_ALLOC freed <1K, 23% free 6665K/8579K, paused 25ms
D/dalvikvm(12662): GC_FOR_ALLOC freed 466K, 24% free 6603K/8579K, paused 24ms
D/dalvikvm(12462): GC_CONCURRENT freed 735K, 30% free 2930K/4163K, paused 3ms+3ms
D/dalvikvm(12462): GC_CONCURRENT freed 391K, 28% free 3032K/4163K, paused 2ms+2ms
W/PackageParser(12662): Unknown element under <manifest>: meta-data at /system/app/ICERed.apk Binary XML file line #43
W/PackageParser(12662): Unknown element under <manifest>: meta-data at /system/app/ICEOrange.apk Binary XML file line #43
W/PackageParser(12662): Unknown element under <manifest>: meta-data at /system/app/ICEGreen.apk Binary XML file line #43
W/PackageParser(12662): Unknown element under <manifest>: meta-data at /system/app/ICEBlu.apk Binary XML file line #43
I/ActivityManager( 1787): START {act=android.intent.action.VIEW dat=file:///system/app/Messaging.apk typ=application/vnd.android.package-archive cmp=com.android.packageinstaller/.PackageInstallerActivity} from pid 12662
W/ResourceType(12662): Failure getting entry for 0x7f02004b (t=1 e=75) in package 0 (error -75)
D/dalvikvm( 1787): JIT code cache reset in 4 ms (1048448 bytes 48/0)
D/dalvikvm( 1787): GC_FOR_ALLOC freed 1302K, 5% free 82769K/86531K, paused 669ms
I/ActivityManager( 1787): Process com.google.android.gsf.login (pid 13162) has died.
I/ActivityManager( 1787): Start proc com.android.packageinstaller for activity com.android.packageinstaller/.PackageInstallerActivity: pid=13461 uid=10034 gids={}
W/InputManagerService( 1787): Window already focused, ignoring focus gain of: [email protected]
D/dalvikvm(13461): GC_FOR_ALLOC freed 49K, 20% free 2254K/2816K, paused 17ms
I/dalvikvm-heap(13461): Grow heap (frag case) to 3.595MB for 1048592-byte allocation
D/dalvikvm(13461): GC_CONCURRENT freed 12K, 17% free 3266K/3907K, paused 2ms+1ms
I/ActivityManager( 1787): Process com.google.android.apps.docs (pid 13299) has died.
D/dalvikvm(13461): GC_CONCURRENT freed 269K, 18% free 3440K/4163K, paused 2ms+1ms
D/dalvikvm(13461): GC_FOR_ALLOC freed 259K, 18% free 3589K/4355K, paused 14ms
I/Process ( 1787): Sending signal. PID: 13461 SIG: 3
I/dalvikvm(13461): threadid=3: reacting to signal 3
D/dalvikvm(12662): GC_CONCURRENT freed 2015K, 31% free 5973K/8579K, paused 3ms+19ms
D/dalvikvm(13461): GC_CONCURRENT freed 272K, 18% free 3753K/4547K, paused 4ms+4ms
I/dalvikvm(13461): Wrote stack traces to '/data/anr/traces.txt'
D/dalvikvm(13461): GC_FOR_ALLOC freed <1K, 18% free 3753K/4547K, paused 14ms
I/dalvikvm-heap(13461): Grow heap (frag case) to 5.134MB for 1127536-byte allocation
D/dalvikvm(13461): GC_FOR_ALLOC freed 2K, 15% free 4851K/5699K, paused 15ms
D/dalvikvm(13461): GC_FOR_ALLOC freed 0K, 15% free 4851K/5699K, paused 14ms
I/dalvikvm-heap(13461): Grow heap (frag case) to 5.738MB for 635812-byte allocation
D/dalvikvm(13461): GC_FOR_ALLOC freed 0K, 14% free 5472K/6339K, paused 17ms
I/Process ( 1787): Sending signal. PID: 13461 SIG: 3
I/dalvikvm(13461): threadid=3: reacting to signal 3
I/dalvikvm(13461): Wrote stack traces to '/data/anr/traces.txt'
D/dalvikvm( 1787): GC_EXPLICIT freed 1163K, 4% free 83080K/86531K, paused 9ms+150ms
I/Process ( 1787): Sending signal. PID: 13461 SIG: 3
I/dalvikvm(13461): threadid=3: reacting to signal 3
I/dalvikvm(13461): Wrote stack traces to '/data/anr/traces.txt'
I/ActivityManager( 1787): Displayed com.android.packageinstaller/.PackageInstallerActivity: +1s818ms (total +5m9s19ms)
W/PackageParser(12662): No actions in intent filter at /system/app/Contacts.apk Binary XML file line #538
I/ActivityManager( 1787): Process com.android.providers.calendar (pid 13148) has died.
W/InputManagerService( 1787): Starting input on non-focused client [email protected] (uid=10080 pid=12662)
I/ActivityManager( 1787): START {dat=file:///system/app/Messaging.apk cmp=com.android.packageinstaller/.InstallAppProgress (has extras)} from pid 13461
D/dalvikvm(13461): GC_CONCURRENT freed 1601K, 29% free 4972K/6979K, paused 1ms+3ms
W/InstallAppProgress(13461): Replacing package:com.android.mms
I/ActivityManager( 1787): Displayed com.android.packageinstaller/.InstallAppProgress: +450ms
I/ActivityManager( 1787): Start proc com.android.defcontainer for service com.android.defcontainer/.DefaultContainerService: pid=13474 uid=10013 gids={1015, 2001}
W/ActivityManager( 1787): No content provider found for permission revoke: file:///system/app/Messaging.apk
W/ActivityManager( 1787): No content provider found for permission revoke: file:///system/app/Messaging.apk
I/ActivityManager( 1787): Process com.google.android.apps.plus (pid 13256) has died.
D/dalvikvm( 1787): GC_CONCURRENT freed 2284K, 5% free 82844K/86531K, paused 7ms+187ms
D/dalvikvm( 1787): GC_CONCURRENT freed 2159K, 5% free 82730K/86531K, paused 8ms+152ms
D/dalvikvm( 1787): GC_CONCURRENT freed 2027K, 5% free 82745K/86531K, paused 7ms+149ms
W/PackageParser( 1787): Exception reading resources.arsc in /data/app/vmdl1906402705.tmp
W/PackageParser( 1787): java.lang.SecurityException: META-INF/MANIFEST.MF has invalid digest for resources.arsc in /data/app/vmdl1906402705.tmp
W/PackageParser( 1787): at java.util.jar.JarVerifier.invalidDigest(JarVerifier.java:131)
W/PackageParser( 1787): at java.util.jar.JarVerifier.access$100(JarVerifier.java:53)
W/PackageParser( 1787): at java.util.jar.JarVerifier$VerifierEntry.verify(JarVerifier.java:123)
W/PackageParser( 1787): at java.util.jar.JarFile$JarFileInputStream.read(JarFile.java:119)
W/PackageParser( 1787): at java.io.BufferedInputStream.read(BufferedInputStream.java:304)
W/PackageParser( 1787): at android.content.pm.PackageParser.loadCertificates(PackageParser.java:390)
W/PackageParser( 1787): at android.content.pm.PackageParser.collectCertificates(PackageParser.java:577)
W/PackageParser( 1787): at com.android.server.pm.PackageManagerService.installPackageLI(PackageManagerService.java:6769)
W/PackageParser( 1787): at com.android.server.pm.PackageManagerService.access$1500(PackageManagerService.java:154)
W/PackageParser( 1787): at com.android.server.pm.PackageManagerService$5.run(PackageManagerService.java:5229)
W/PackageParser( 1787): at android.os.Handler.handleCallback(Handler.java:605)
W/PackageParser( 1787): at android.os.Handler.dispatchMessage(Handler.java:92)
W/PackageParser( 1787): at android.os.Looper.loop(Looper.java:137)
W/PackageParser( 1787): at android.os.HandlerThread.run(HandlerThread.java:60)
E/PackageParser( 1787): Package com.android.mms has no certificates at entry resources.arsc; ignoring!
D/dalvikvm( 1787): GC_EXPLICIT freed 681K, 5% free 82692K/86531K, paused 9ms+170ms
D/InstallAppProgress(13461): Installation error code: -103


----------



## JBirdVegas

Whatever is on line #43 of you AndfoidManifest.xml is wrong and throwing the parsing error. Post you AndroidManifest.xml or at least the blocks relevant to line #43


----------



## Jmoney4769

Here's the file. Kinda weird though: I can read it completely fine on my phone, but on my laptop it will just display a bunch of random characters (I tried through Firefox, eclipse, and gedit). I have to ask though, how could you possibly know that??? Is there somewhere that I can look up those error codes???


----------



## yarly

Jmoney4769 said:


> I have to ask though, how could you possibly know that??? Is there somewhere that I can look up those error codes???


Because it says so in your log?







lol:



> W/PackageParser(12662): Unknown element under <manifest>: meta-data at /system/app/ICERed.apk Binary XML file line #43
> W/PackageParser(12662): Unknown element under <manifest>: meta-data at /system/app/ICEOrange.apk Binary XML file line #43
> W/PackageParser(12662): Unknown element under <manifest>: meta-data at /system/app/ICEGreen.apk Binary XML file line #43
> W/PackageParser(12662): Unknown element under <manifest>: meta-data at /system/app/ICEBlu.apk Binary XML file line #43


No special place to look things up, you just have to read logs and figure out what they mean.


----------



## Jmoney4769

Lol I missed that :x.


----------



## JBirdVegas

If its in odd characters then your not working from source try decompiling the app with apktool then try to look at it... I don't know anything about that part but there are lots of experienced devs here that can probably help you. Or use a guide. If you do have the source available then post the AndroidManifest.xml from there


----------



## Jmoney4769

Seeing as it is a MIUI system app, I do not currently have the source. I will look into that though. Thanks


----------



## yarly

Jmoney4769 said:


> Seeing as it is a MIUI system app, I do not currently have the source. I will look into that though. Thanks


Most of MIUI is open sourced now. You have to apply it as a patch to the original matching Android source though.

https://github.com/MiCode


----------



## veskostoev

Hi i solve the problem MIUi ROM 3.1.11 go to Developer options and Disable the PROTECT USB STORAGE and install all .ARK files.


----------

