Jump to content
ertank

Unable to install app after package name change

Recommended Posts

I started an Android project and did not give its package name a proper name. Now project is almost finished and remember to provide it a proper package name before releasing.

 

- I changed the package name.

- I removed installed app on my test phone.

- Restarted the phone.

- Tried to install same app with a new package name.

 

That simply failed and displayed a window with "Unable to create process: Unable to install '<path>'. Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]"

 

I believe I need to do more, but do not know what exactly. Google searches are not helpful. Most likely I am not choosing correct words.

 

This has happened to me before and I did not solve it properly back then (changed package name back to default). I want to learn the way to do it right, now.

 

Any help is appreciated.

 

Thanks & regards,

Ertan

Share this post


Link to post

It means you have another app on the device that is using the same package name, that was signed using a different key (usually using a different version of Delphi).

 

If you're unsure as to which one it is, one way to check is to use adb, which is in the platform-tools folder under the Android SDK root, so change directory into there, and run this:

 

   adb shell pm list packages -f <yourpackagename>

 

e.g:

 

  adb shell pm list packages -f com.embarcadero.Location

 

Example output:

 

  package:/data/app/com.embarcadero.Location-7NS38JcbdfTgvZ3_WPSj-w==/base.apk=com.embarcadero.Location

 

The part after "package:" and before "=<packagename>" is the path to the APK. Pull the package to the PC, e.g:

 

  adb pull /data/app/com.embarcadero.Location-7NS38JcbdfTgvZ3_WPSj-w==/base.apk C:\Temp

 

Then use aapt (in the build-tools\<version> folder under the SDK root, where <version> is whatever version you're using) to discover the application label, e.g:

 

  aapt dump badging C:\Temp\base.apk | grep application-label

 

Example output:

 

  application-label:'Location'

 

Share this post


Link to post

Further to my last reply: I've wrapped up the functionality into my Device Lens tool in version 1.1.0 beta. If you use Slack and join my Slack team at this link:

 

https://slack.delphiworlds.com/

 

(If you have not already joined), go to the #DeviceLens room where I've uploaded a zip of the executable, as well as a couple of notes on how to retrieve the application label.

Share this post


Link to post

It turned out to be a problem of package name. Android does not like domain names starting with numbers like "com.1stlevel.mypackage_name"

However, converting numbers to letters works just fine like "com.firstlevel.mypackage_name".

Share this post


Link to post
2 hours ago, ertank said:

Android does not like domain names starting with numbers like "com.1stlevel.mypackage_name"

That's very odd, since it's perfectly valid. I'd report it to Google.

Share this post


Link to post
1 hour ago, Dave Nottage said:

That's very odd, since it's perfectly valid. I'd report it to Google.

com.1stlevel.mypackage_name is not a valid application id https://developer.android.com/studio/build/application-id

 

  • It must have at least two segments (one or more dots).
  • Each segment must start with a letter. 
  • All characters must be alphanumeric or an underscore [a-zA-Z0-9_].
  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×