How to solve the "App not installed" error on Android devices?

Hi,
I’ve created and built a new brand app with these commands:

ionic start mytest
npm i -D -E @ionic/lab
ionic cordova build android --prod --release

These commands produce the file “app-release-unsigned.apk”.
If i try to install this apk on my mobile phone with Android6 I have this error: “App not installed”.
Now I’ve found this article it says that I have to open the apk with and Apk Editor and I have to change the Installation path.
I’ve tried this procedure and it works, that is, after this modification I’m able to install and use the Ionic app.

So it seems that something is wrong with the Installation path of my App.
How can I solve this problem?
Is it a known issue?
I’ve used standard commands to create and build it, without any customization of the app.

This is the output of ionic info:

C:\ProveElectron\mytest>ionic info
√ Gathering environment info - done!
Ionic:
   ionic (Ionic CLI)  : 4.1.1 (C:\Users\claudio\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.1.11

Cordova:
   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.0.3, (and 3 other plugins)

System:
   Android SDK Tools : 26.1.1 (C:\Users\claudio\AppData\Local\Android\Sdk)
   NodeJS            : v8.11.3 (C:\Program Files\nodejs\node.exe)
   npm               : 6.2.0
   OS                : Windows 10

Thank you very much

cld

you can not install unsigned.apk in your mobile you have to signed this apk using signer tools after that you able to install release apk in real device.

Are you sure that I have to sign the app?
I’m not publishing the app, just executing it on my mobile, after enablig the developers options.
I think it should work, I remember that it worked the same, but I could be wrong.

cld

2 Likes

I can’t answer your original question, but I could confirm that you don’t have to sign your apk in order to install it on your test phone

I use cordova 8.0.0 and cordova-android 7.1.1

When I build

ionic cordova build android --prod

I get a app-debug.apk which I could install on my phone and which I could connect with a cable to my laptop in order to debug with Chrome

When I build

ionic cordova build android --prod --release

I get a app-release.apk which I could install on my phone and send to the play store

but maybe there is the difference, I don’t get an unsigned release version like you displayed “app-release-unsigned.apk”, that’s maybe what @hirenkorat3 is pointing out

1 Like

Ok, yes with ionic cordova build android --prod I have an app-debug.apk file that I can install on my phone.
Thank you.

It is strange that with the same command "ionic cordova build android --prod --release" we have two different file. I have an “unsigned” file that I can’t install.
However, for testing the app, at this moment, I can use the debug version.

Maybe it does not make sense to have a release version not signed.

cld

Cool to hear you were able to install the debug one

It’s not weird that we have got different file. I guess that you didn’t have generate the certificate not in order to properly sign (–release) your apk which I actually do

1 Like

Ok, I have signed the app following these instructions and now I can install the release version.

So, if I use the command ionic cordova build android --prod I have a file “app-debug.apk” that I can execute on my phone.

If I run the command ionic cordova build android --prod --release I have to sign the file “app-release-unsigned.apk” using this procedure.

1 Like

Not sure it’s a bit weird no that the thing is called “unsigned” if you did all the steps?

No if you follow all the steps you change the name of the app in this step:
zipalign -v 4 app-release-unsigned.apk HelloWorld.apk

I wasn’t following these steps before.

cld

I saw that in a tutorial today, probably correct. It’s just weird to me because I’ve created my certificate once, have added it to my cordova setup and now when I run “–release” I just have got my signed apk, nothing more to do

But you probably gonna be good, keep us posted :wink:

Hi there, I dont know if its too late but incase someone else faces this problem in future.

I had an app which worked at first without needing to sign it, so the theory that one needs to sign a debugging apk is WRONG.

Secondly I fixed this by removing the android cordova platform (theres documentation on this) , after removing the android platform run ionic cordova build android and your apk should work.

I am still new to ionic development so I wont act like I know what causes this, I hope this helps someone :slight_smile:

1 Like

Thanks, doing this fixed the issue for me.

1 Like

@ Mutondit You solution fixed the issue for me as well! Thank you so much!!

I am also facing same issue but signed apk is working for me.but there is one more issue, in some mobiles https calls are happening but in some mobiles https calls are not happening i mean request not reaching to serever. Any solution

In my case, the app was also installed in the guest account on my phone. I solved by switching accounts, uninstalled the app in the other session and voila!