I know this question has been asked to death here, but I am unable to find the solution in all of the offered answers and its driving me crazy.
I have an app which I have set up to download updates from my own server. This update installs fine on some types of phones but fails on others (namely the Droid Incredible 2).
The error it alerts when I try to install an update on SOME phones is:
"Parse Error: There is a problem parsing the package."
The logcat shows:
INFO/ActivityManager(1482): Starting activity: Intent { act=android.intent.action.VIEW dat=file:///mnt/sdcard/download/application.apk typ=application/vnd.android.package-archive cmp=com.android.packageinstaller/.PackageInstallerActivity } from pid 4620
WARN/PackageParser(2528): Skipping dir: /mnt/sdcard/download/application.apk
WARN/PackageInstaller(2528): Parse error when parsing manifest. Discontinuing installation
What else could I possibly be doing wrong?
edit: I uploaded this app to the Android Market...when I try to install on the troubled phones, I get an alert saying "Package file was signed incorrectly". On the other phones, it downloads and installs just fine.
问题是我正在更新最初通过adb安装的应用程序,而不是通过市场。
If you are trying to download an apk than install it programmatically, be careful to use AsynTask or propery perform threading. I used to face the same error because the activity used to grab an incomplete apk to install it.
I use AsynTask now. doInBackground (does the downloading), onPostExecute( adds the pending intent and calls startActivity to open the installation screen).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.