Friday, February 3

Solve package installation error on Android


You might did something strange to your Android if you encounter this problem. It's not normal if you face this:) But probably you know that already and counted the cost:)


When you have a downloaded apk, you are getting this:
Parse error: "There was a problem parsing the package."

Or you might try to install it via pm (android's package manager):
shell@bacon:/sdcard/ $ pm install -r Opera.apk                                                                  pkg: Opera.apk


adb still works

You can use android's debug bridge to install an apk fine, but that doesn't help if you need to install an apk from your phone.

realpath is the issue

It turns out, that the problem can be resolved by giving the absolute path of the apk to pm.

shell@bacon:/sdcard/ $ pm install -r /sdcard/Opera.apk                                                    pkg: /sdcard/Opera.apk                                        
Or if you are scripting it for some reason ;)
shell@bacon:/sdcard/ $ pm install -r $(realpath Opera.apk)
                  pkg: /sdcard/Opera.apk                                        

Have fun:)

No comments:

Post a Comment