Could a custom ROM solve 'app not installed' problem?

Hero002

Member
Mar 3, 2020
15
0
0
Hi!

I am developing apps in Python/Kivy and testing them on my Moto G5. 6 months ago it worked fine. Now when I try to install Python/Kivy apps that worked 6 months ago or apps that others can install on THEIR devices, my Moto G5 with Android 8.1.0 says "app not installed". I have looked at many settings in the phone without finding a solution. Could installing a custom ROM, like ArrowOS, lineageOS or Pixel Experience be the solution to the problem?

I look forward to any input. Thank you!
 

TheFixItMan

Senior Member
Jul 8, 2012
7,654
3,922
253
London
Hi!

I am developing apps in Python/Kivy and testing them on my Moto G5. 6 months ago it worked fine. Now when I try to install Python/Kivy apps that worked 6 months ago or apps that others can install on THEIR devices, my Moto G5 with Android 8.1.0 says "app not installed". I have looked at many settings in the phone without finding a solution. Could installing a custom ROM, like ArrowOS, lineageOS or Pixel Experience be the solution to the problem?

I look forward to any input. Thank you!
You will get app not installed message for the following reason

There's not enough space on the device to install it

There's an app with the same package name already installed and the app you're trying to install with the same package name is signed with a different key

The apk is not signed

The apk is signed but with a platform key so it can only be installed to system and not to a user

The app only has 64bit libs and you are trying to install on a 32bit system


If it's an android version issue eg you need a higher version of android to install on you will get unable to parse the package so assuming your app is designed to install on 32bit Roms it will install on stock rom
If it's only designed for 64bit roms you will need a custom rom for this device
 
Last edited:

Hero002

Member
Mar 3, 2020
15
0
0
You will get app not installed message for the following reason

There's not enough space on the device to install it

There's an app with the same package name already installed and the app you're trying to install with the same package name is signed with a different key

The apk is not signed

The apk is signed but with a platform key so it can only be installed to system and not to a user

The app only has 64bit libs and you are trying to install on a 32bit system

If it's an android version issue eg you need a higher version of android to install on you will get unable to parse the package so assuming you app is designed to install on 32bit Roms it will install on stock rom
If it's only designed for 64bit roms you will need a custom rom for this device
Are we misunderstanding each other?
I am talking about test APKs that are not signed. Transferred via USB. And which could be installed 6 months ago. I HAVE uninstalled it before trying to reinstall it.
 

nift4

Senior Member
May 22, 2019
426
119
43
Are we misunderstanding each other?
I am talking about test APKs that are not signed. Transferred via USB. And which could be installed 6 months ago. I HAVE uninstalled it before trying to reinstall it.
He just listed all possible reasons for that message. You btw get an more informative error message if you use adb install, so use it and post the error here.
 

TheFixItMan

Senior Member
Jul 8, 2012
7,654
3,922
253
London
Are we misunderstanding each other?
I am talking about test APKs that are not signed. Transferred via USB. And which could be installed 6 months ago. I HAVE uninstalled it before trying to reinstall it.
Apks must be signed - if they are not signed even with just a test key they will not install

The only exception to this is if you are rooted and have changed your rom to disable signature checking

Just quickly sign the apk with a test key using this app
https://play.google.com/store/apps/details?id=com.haibison.apksigner
 
Last edited:

Hero002

Member
Mar 3, 2020
15
0
0
He just listed all possible reasons for that message. You btw get an more informative error message if you use adb install, so use it and post the error here.
Thank you for your reply!
Someone in the Kivy forum also asked me to do that, but there isn't really any error message - see output from Ubuntu Terminal below.
The Moto G5 is connected to the PC with USB. USB file transfer is enabled, and USB debugging.

Now I have done it again with 4 APK-files:

1. A 'release' version of my app, which worked without problems 6 months ago.
2. A new 'debug' version of same app.
3. A 'Hello world' Kivy test APK file that worked for the Kivy guy who compiled it.
4. My compilation of the same Kivy test app.

As you can see, none of them work on my Moto G5 with Android 8.1.0 (the February 2019 update). I pressed <enter> twice then Ctrl-C each time:

[email protected]:~$ /home/henrik/.buildozer/android/platform/android-sdk/platform-tools/adb install -r "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/bin/GeoESPtrainingTEST__arm64-v8a-0.1-arm64-v8a-release.apk"
* daemon not running; starting now at tcp:5037
* daemon started successfully
Performing Streamed Install


^C
[email protected]:~$ /home/henrik/.buildozer/android/platform/android-sdk/platform-tools/adb install -r "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/bin/GeoESPtrainingTEST__arm64-v8a-0.1-arm64-v8a-debug.apk"
Performing Streamed Install


^C
[email protected]:~$ /home/henrik/.buildozer/android/platform/android-sdk/platform-tools/adb install -r "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/PyCharm-Python-Kivy-Buildozer-problemer/Android-not-installing-anything/hello/bin/HWtest-0.1-arm64-v8a-debug.apk"
Performing Streamed Install


^C
[email protected]:~$ /home/henrik/.buildozer/android/platform/android-sdk/platform-tools/adb install -r "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/PyCharm-Python-Kivy-Buildozer-problemer/Android-not-installing-anything/hello/bin/HWtest__arm64-v8a-0.2-arm64-v8a-debug.apk"
Performing Streamed Install


^C
[email protected]:~$
 

Hero002

Member
Mar 3, 2020
15
0
0
Apks must be signed - if they are not signed even with just a test key they will not install

The only exception to this is if you are rooted and have changed your rom to disable signature checking

Just quickly sign the apk with a test key using this app
https://play.google.com/store/apps/details?id=com.haibison.apksigner
Thank you for your reply.

I installed that 'apk-signer' app on my Moto G5, but when I try to sign the 'HWtest__arm64-v8a-0.2-arm64-v8a-debug.apk' file (selecting that file through 'File Manager +', I get the message 'apk-signer has stopped'. When I try one of the other APK-files, I get the message 'apk-signer keeps stopping' (my translation from Danish).
If I try selecting the file through the build in 'FIles' app, I can't seem to select an APK-file. When I try, 'Files' thinks I want to edit the file name...?!
 

nift4

Senior Member
May 22, 2019
426
119
43
Thank you for your reply!
Someone in the Kivy forum also asked me to do that, but there isn't really any error message - see output from Ubuntu Terminal below.
The Moto G5 is connected to the PC with USB. USB file transfer is enabled, and USB debugging.

Now I have done it again with 4 APK-files:

1. A 'release' version of my app, which worked without problems 6 months ago.
2. A new 'debug' version of same app.
3. A 'Hello world' Kivy test APK file that worked for the Kivy guy who compiled it.
4. My compilation of the same Kivy test app.

As you can see, none of them work on my Moto G5 with Android 8.1.0 (the February 2019 update). I pressed <enter> twice then Ctrl-C each time:

[email protected]:~$ /home/henrik/.buildozer/android/platform/android-sdk/platform-tools/adb install -r "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/bin/GeoESPtrainingTEST__arm64-v8a-0.1-arm64-v8a-release.apk"
* daemon not running; starting now at tcp:5037
* daemon started successfully
Performing Streamed Install


^C
[email protected]:~$ /home/henrik/.buildozer/android/platform/android-sdk/platform-tools/adb install -r "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/touchtracer/bin/GeoESPtrainingTEST__arm64-v8a-0.1-arm64-v8a-debug.apk"
Performing Streamed Install


^C
[email protected]:~$ /home/henrik/.buildozer/android/platform/android-sdk/platform-tools/adb install -r "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/PyCharm-Python-Kivy-Buildozer-problemer/Android-not-installing-anything/hello/bin/HWtest-0.1-arm64-v8a-debug.apk"
Performing Streamed Install


^C
[email protected]:~$ /home/henrik/.buildozer/android/platform/android-sdk/platform-tools/adb install -r "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/PyCharm-Python-Kivy-Buildozer-problemer/Android-not-installing-anything/hello/bin/HWtest__arm64-v8a-0.2-arm64-v8a-debug.apk"
Performing Streamed Install


^C
[email protected]:~$
Oh, that's strange... Try
Code:
adb push /path/to/my/apk /sdcard/app.apk; adb shell pm install /sdcard/app.apk
 

Hero002

Member
Mar 3, 2020
15
0
0
Oh, that's strange... Try
Code:
adb push /path/to/my/apk /sdcard/app.apk; adb shell pm install /sdcard/app.apk
Just to be sure: Is that 2 commands? And could it look like this in my case:

adb push /mnt/4AF15A0435E762B4/DataDoc/bin/HWtest-0.1-arm64-v8a-debug.apk /sdcard/HWtest-0.1-arm64-v8a-debug.apk
adb shell pm install /sdcard/HWtest-0.1-arm64-v8a-debug.apk
 

TheFixItMan

Senior Member
Jul 8, 2012
7,654
3,922
253
London
Just to be sure: Is that 2 commands? And could it look like this in my case:

adb push /mnt/4AF15A0435E762B4/DataDoc/bin/HWtest-0.1-arm64-v8a-debug.apk /sdcard/HWtest-0.1-arm64-v8a-debug.apk
adb shell pm install /sdcard/HWtest-0.1-arm64-v8a-debug.apk
To make things easier

Copy the apk to your computer to a folder with a short filename and no spaces in the path
Make sure you adb is in your environmental veriables so it can be run from any path
Open a terminal window in the location where your apk is

Type
Code:
adb install nameofapp.apk
Also upload the app here or you can send me a private a message with a link if you don't want it to be public and I'll see if I can install it - I don't have this device anymore but if it installs on mine I don't see why it wouldn't on a moto g5


Also I've noted on your app name it's arm64-v8
This device stock rom is 32bit so unless your app supports 32bit roms it will not install as mentioned in my first reply to you
In this case you will need to use a custom rom that support 64bit architecture or make the app support 32bit architecture armv7
 
Last edited:

Hero002

Member
Mar 3, 2020
15
0
0
To make things easier

Copy the apk to your computer to a folder with a short filename and no spaces in the path
Make sure you adb is in your environmental veriables so it can be run from any path
Open a terminal window in the location where your apk is

Type
Code:
adb install nameofapp.apk
Also upload the app here or you can send me a private a message with a link if you don't want it to be public and I'll see if I can install it - I don't have this device anymore but if it installs on mine I don't see why it wouldn't on a moto g5


Also I've noted on your app name it's arm64-v8
This device stock rom is 32bit so unless your app supports 32bit roms it will not install as mentioned in my first reply to you
In this case you will need to use a custom rom that support 64bit architecture or make the app support 32bit architecture armv7
Thank you for your reply!

Connecting Moto G5 to my Ubuntu laptop again, I get the same result again. After a while, I pressed <enter> twice, then Ctrl-C. Here is the Terminal output:

[email protected]:/mnt/4AF15A0435E762B4/DataDoc/bin$ adb install HWtest-0.1-arm64-v8a-debug.apk
Performing Streamed Install


^C
[email protected]:/mnt/4AF15A0435E762B4/DataDoc/bin$

This particular file is a 'Hello world'-test that I could upload here, but there doesn't seem to be a way of uploading files here?
Should I put it on an Internet URL instead?

ADDITION:
I have put the file here:
http://transformation.dk/deling/HWtest-0.1-arm64-v8a-debug.apk
 
Last edited:

TheFixItMan

Senior Member
Jul 8, 2012
7,654
3,922
253
London
Thank you for your reply!

Connecting Moto G5 to my Ubuntu laptop again, I get the same result again. After a while, I pressed <enter> twice, then Ctrl-C. Here is the Terminal output:

[email protected]:/mnt/4AF15A0435E762B4/DataDoc/bin$ adb install HWtest-0.1-arm64-v8a-debug.apk
Performing Streamed Install


^C
[email protected]:/mnt/4AF15A0435E762B4/DataDoc/bin$

This particular file is a 'Hello world'-test that I could upload here, but there doesn't seem to be a way of uploading files here?
Should I put it on an Internet URL instead?

ADDITION:
I have put the file here:
http://transformation.dk/deling/HWtest-0.1-arm64-v8a-debug.apk
Your app installs and runs fine

The reason it won't install on stock rom on this device is because your lib files are for a 64bit devices

Stock rom on this device is 32bit and you have not included any 32bit lib alternatives armv7

If you want to install the app on this device you have two choices

1 - build the app to also include support for 32bit devices
2 - Install a custom 64bit rom on the Moto G5
 
  • Like
Reactions: Hero002

Hero002

Member
Mar 3, 2020
15
0
0
Your app installs and runs fine

The reason it won't install on stock rom on this device is because your lib files are for a 64bit devices

Stock rom on this device is 32bit and you have not included any 32bit lib alternatives armv7

If you want to install the app on this device you have two choices

1 - build the app to also include support for 32bit devices
2 - Install a custom 64bit rom on the Moto G5
Great. Thank you!

I found an APK I compiled in March:
GeoESPtrainingTEST__armeabi-v7a-0.1-armeabi-v7a-release.apk

And yes - something happens - in Terminal:

[email protected]:/mnt/4AF15A0435E762B4/DataDoc/bin$ adb install GeoESPtrainingTEST__armeabi-v7a-0.1-armeabi-v7a-release.apk
Performing Streamed Install
Success
[email protected]:/mnt/4AF15A0435E762B4/DataDoc/bin$

But nothing happens on the Moto G5...!

Then I copied that APK file to Moto G5, and in 'File Manager +' I tapped on it to install it, and the installer said: "Do you want to install an update to the existing app?" I said 'yes', it installed successfully, and it worked as expected.

That seems strange... at least to me!
 

TheFixItMan

Senior Member
Jul 8, 2012
7,654
3,922
253
London
Great. Thank you!

I found an APK I compiled in March:
GeoESPtrainingTEST__armeabi-v7a-0.1-armeabi-v7a-release.apk

And yes - something happens - in Terminal:

[email protected]:/mnt/4AF15A0435E762B4/DataDoc/bin$ adb install GeoESPtrainingTEST__armeabi-v7a-0.1-armeabi-v7a-release.apk
Performing Streamed Install
Success
[email protected]:/mnt/4AF15A0435E762B4/DataDoc/bin$

But nothing happens on the Moto G5...!

Then I copied that APK file to Moto G5, and in 'File Manager +' I tapped on it to install it, and the installer said: "Do you want to install an update to the existing app?" I said 'yes', it installed successfully, and it worked as expected.

That seems strange... at least to me!
You may have had part of the apk still installed - it may have copied the apk of the 64bit version to data but failed to complete the install due to the 64bit libs and left some parts

You can do
Code:
adb shell
cd /data/app (or where ever the apk is located) 
rm com.packagenameofapp.apk
And this will remove the apk but since you got it working via updating directly on the phone there's not really any need
 
  • Like
Reactions: Hero002

nift4

Senior Member
May 22, 2019
426
119
43
To make things easier

Copy the apk to your computer to a folder with a short filename and no spaces in the path
Make sure you adb is in your environmental veriables so it can be run from any path
Open a terminal window in the location where your apk is

Type


Also upload the app here or you can send me a private a message with a link if you don't want it to be public and I'll see if I can install it - I don't have this device anymore but if it installs on mine I don't see why it wouldn't on a moto g5


Also I've noted on your app name it's arm64-v8
This device stock rom is 32bit so unless your app supports 32bit roms it will not install as mentioned in my first reply to you
In this case you will need to use a custom rom that support 64bit architecture or make the app support 32bit architecture armv7
He tried adb install and it didn't work!
 

nift4

Senior Member
May 22, 2019
426
119
43
I said that because his terminal commands were messy - was just to eliminate any issues with long commands

Plus issue is solved - his app only had 64bit libs so won't install on stock rom on this device which is 32bit
Sorry, I just read your quote, not the whole thread
 

Hero002

Member
Mar 3, 2020
15
0
0
You may have had part of the apk still installed - it may have copied the apk of the 64bit version to data but failed to complete the install due to the 64bit libs and left some parts

You can do
Code:
adb shell
cd /data/app (or where ever the apk is located) 
rm com.packagenameofapp.apk
And this will remove the apk but since you got it working via updating directly on the phone there's not really any need
Yes - it works!
I tried compiling a 32bit version of the Python/Kivy 'hello world' test app by putting this line:
android.arch = armeabi-v7a
in the 'buildozer.spec' file.

(EDIT: Instead of this line:
android.arch = arm64-v8a)

In Terminal, while in the test app project folder, I ran:

$ buildozer android debug
$ buildozer android debug deploy run

And the app opened on the Moto G5!

Thank you VERY much!!!

(EDIT:
Now I tried compiling my 'real' app to 32bit using 'android.arch = armeabi-v7a', and that worked too!)

Thank you!
 
Last edited:

Hero002

Member
Mar 3, 2020
15
0
0
Yes - it works!
I tried compiling a 32bit version of the Python/Kivy 'hello world' test app by putting this line:
android.arch = armeabi-v7a
in the 'buildozer.spec' file.

(EDIT: Instead of this line:
android.arch = arm64-v8a)

In Terminal, while in the test app project folder, I ran:

$ buildozer android debug
$ buildozer android debug deploy run

And the app opened on the Moto G5!

Thank you VERY much!!!

(EDIT:
Now I tried compiling my 'real' app to 32bit using 'android.arch = armeabi-v7a', and that worked too!)

Thank you!
Am I kind of demanding?
I mean - it would have been VERY nice if either ADB (Android Debug Bridge) or the Package Installation App on my Moto G5 phone had given some kind of error message like for instance:
"ERROR: 64bit code found. Only 32bit code allowed."
That would have saved me a huge amount of time!
 

TheFixItMan

Senior Member
Jul 8, 2012
7,654
3,922
253
London
Am I kind of demanding?
I mean - it would have been VERY nice if either ADB (Android Debug Bridge) or the Package Installation App on my Moto G5 phone had given some kind of error message like for instance:
"ERROR: 64bit code found. Only 32bit code allowed."
That would have saved me a huge amount of time!
Would be nice but unfortunately error messages are never really that clear unless you know what's wrong

My favourite being unexpected or unknown error found - very helpful