“Parse Error : There is a problem parsing the pack

2019-01-01 00:41发布

I got this error while installing the android application (Parse Error : There is a problem parsing the package.). I did the following steps.

  1. First time I installed the application and it works fine.

  2. I made changes to the existing application and change the version no in Manifest file.

    <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.openintents.samples.BasicOpenARDemo" android:versionCode="2" android:versionName="1.0.1">
    
  3. Then I export the application and finish the code signing process. For this, Right Click your Project node > select Export. There you will see a wizard. Follow the steps and finish the code signing also.

  4. I got the ARDemo.apk file, Then I changed it’s name to ARDemo1.apk

  5. Then I shipped this apk file to mobiles SD Card and started the installation I got the above error.

I googled, they say that problem with unpacking manifest file.

Can anyone tell me what could be wrong with me?

标签: android
22条回答
只靠听说
2楼-- · 2019-01-01 01:17

One reason could be, that your activity'name is not defined in the manifest

    <activity
          android:name=""
          ...>
</activity>

above code was creating the same issue with me

查看更多
梦寄多情
3楼-- · 2019-01-01 01:18

You said that the first time you installed the application it worked fine.

The only difference in the steps you outlined between the two versions are:

  1. The version number (I'm assume that this did not participate in breaking anything)
  2. The code
  3. The name of the .apk file

Try renaming the ARDemo1.apk file back to ARDemo.apk (make sure to back up the older version) and see if that helps. My guess is that it has something to do with the name of the apk.

If it still does not work, then you can eliminate the name of the apk file as the source of the problem and start investigating 2) by rebuilding your old version and see if you have same problem again. If the problem does not exists with the rebuilt version of your old code then you know it must be something to do with your code.

I hope that gets you somewhere.

Cheers, Joseph

查看更多
临风纵饮
4楼-- · 2019-01-01 01:18

You might also want to check the logs on the device to see if it's something simple like a permissions problem. You can check the logs using adb from a host/debug computer:

adb logcat

Or if you have access to the console (or when using Android-x86 get console by typing Alt+F1) then you can check the logs by using the logcat command:

logcat
查看更多
闭嘴吧你
5楼-- · 2019-01-01 01:21

I had the same problem using the apk file exported from android‌ Tools > Export. I used the apk file in bin folder instead and it worked!

P.S. apk file in bin folder is created after first time you run the application in eclipse.

查看更多
永恒的永恒
6楼-- · 2019-01-01 01:22

The reason is apk is not signed. Once the apk is signed, the issue will be resolved. http://ionicframework.com/docs/guide/publishing.html Please use the link on instructions to sign the apk.

查看更多
忆尘夕之涩
7楼-- · 2019-01-01 01:22

I'm not repeating what is instructed here to input the Key store, password, etc. Try

Build -> Generate Signed APK -> [ Input ] ---Next---> select BOTH

  • V1 (Jar Signature)
  • V2 (Full APK Signature)

I don't know why, but at least it worked in my situation.

查看更多
登录 后发表回答