Failed to install apk file by Package Installer?

Put your problem here if it does not fit any of the other categories.

Failed to install apk file by Package Installer?

Postby NickLee » Wed Nov 24, 2010 12:02 am

Hi, all,
I have some problem installing my apk file in code. Wondering if anyone could find out what I did wrong.
What I was trying to do is put a Check Upgrade function in our program. When user clicks it, it will send request to our web server and find out what is the latest version. I use app versionName to stamp a version, something like 2010.11.23. I don't use the version code in Manifest.xml file. So our program sees the latest VersionName is later than itself, it will download the latest one, and then use the following code to install the new apk file:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(strNewAPKFile),"application/vnd.android.package-archive");
this.startActivity(intent);

Now looks like, everytime when I changed the VersionName, it will fail to install the apk file. It downloads the file fine. I don't know exactly why. Sometimes, in Eclips, when I hit debug, I got error saying "Re-installation failed due to different application signatures". I don't know if this is the same error caused the installation failed.

So, looks like my questions are:
1. Should that upgrade logic work? I am wondering if it has something to do with the VersoinName.
2. What could cause the application signature change? (I did sign our program before I put it on our server, but I always use the same key file for different versionName. )

Any input are welcome.
Thanks.
NickLee
Junior Developer
Junior Developer
 
Posts: 10
Joined: Tue Jun 29, 2010 11:49 pm

Top

Re: Failed to install apk file by Package Installer?

Postby Edelfried » Tue Feb 08, 2011 8:10 am

Hello NickLee,

did you solve the problem?
I will try to create an selv-updater function for my application too. But, I had the idear to create an encapsulated updater app that will update and reinstall my app.
Are there any difficulties with the apps' signature?

greetings,
Edelfried
Edelfried
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Feb 08, 2011 7:48 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 9 guests