Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Why am I getting "App not installed" error on latest build of Android APK, with signed release

A topic by HH Richards created Jan 11, 2021 Views: 2,381 Replies: 12
Viewing posts 1 to 6
(1 edit)

Hey folks! I'm creating an Android app using Monaca (Monaca is just an online service where you can build the app instead of using my computer).

It's always worked fine. I'm onto my 10th version of this app, and I've done the same I always do, increase the versioncode number as I know it will only work if the number is greater. 

But when downloading & installing this app over the existing app (which always works), I get the vague message "app not installed". 

Any idea why I'm having this error message & not being able to install?

Here's some detail from the AndroidManifest.xml file in each apk file

The versionName of the last 3 are: 
8)   1.8.0
9)   1.9.2
10) 1.10.0

The versionCode from the last 3 are:
8)   10013
9)   10902
10)  11001

If I uninstall the app, I'm able to install v10 fine. But I'm not able to install it if v8 or v9 are installed. Normally if I have this problem it's because the versionCode is lower, & if I increment it, it works ok.

I'm signing the app with the same key. 

Moderator

As you mentioned, this is indeed a version code thing, and is intended. The idea behind it is if a user tries to install an older version of the same app, the OS won’t let them. This is detected based on the app’s package name, which should be something like “com.mycompany.myapp”, and the version code.

To get around this, there are a few options:

  • Uninstall previous app (as you mentioned)
  • Sign the app with a debug key, which will signal to the OS that it’s alright to install “apk”s of various version codes. Make sure not to upload an apk signed this way.
  • It’s been a while, but I believe if you use “adb” to install an apk, it automatically removes the previous version. I could be wrong, but worth keeping in mind.

Apart from these, there’s not much else you can do. This is intended, although I do agree the message “App is not installed” is not detailed enough.

Thanks for replying! But I still don't understand why I can install 9 after 8, but not 10 after 9. 

11001 IS greater than 10902 right? Unless there's some weird numbering thing that I'm not aware of.

This is something that is affecting the users of my game. If I tell them to uninstall they'll lose their progress 

Moderator

Oh I see what you mean, didn’t realize this is for users.

Yes, this shouldn’t happen, only the versionCode is compared when installing a new version, not the versionName.

Did you add anything in the android manifest that makes the app unplayable in some devices?

Also for future reference, you can use the “Reply” button on someone’s comment, as that gives them a notification and increases the chances of them seeing it :)

The androidmanifest.xml is identical for all 3 files is the same except for the versionCode & versionName (I'm comparing by dragging the APKs into Android Studio. 

I've done another test now where I've changed the versioncode to something a lot higher, 21000 and the same thing happens. I can't install it if version 9 is installed. 

Any idea what else to check? 

Moderator(+1)

Hmm, the only thing I can think of is the key used to sign the app, but you mentioned it’s the same in all versions.

Have you managed to reproduce this on one of your devices? If so you can run Android Studio’s logcat, and see what error pops up when trying to install it. Alternatively if you are using “adb” you can use “adb logcat”.

Thanks for your reply! I'll try and do what you've said, although I've never done any debugging before like this. I'm not sure what adb is, or logcat. I've got Android Studio installed but tbh not used it until yesterday when I debugged the apk file! This is all new to me 

Moderator

Logcat is basically a “terminal” that displays messages of what’s happening in an android device. When an error occurs, it displays the message there.

On Android Studio, on the bottom left, there should be some small tabs, and one of them should be called “6: Logcat”. If you click that, it should display the Logcat of any connected device. It will display a lot of messages, from all apps running on your device, but you can filter messages per-application to make it easier to find.

So the idea is to connect your device, open the Logcat window, and keep looking at it while on your device you are installing your app to trigger the “App not installed” message. At exactly that point, Logcat should display some error message with more details.

“adb” (Android Debug Bridge) is basically a set of command-line tools to do the same thing, but without using Android Studio. No need to dive there, it is a bit more involved that simply using Android Studio.

Is it possible for your to post the manifests here? In your original post you list

The versionCode of the last 3 are:  8)   1.8.0 9)   1.9.2 10) 1.10.0

where I assume you meant versionName, but I'd like to be sure.

(+1)

Oh yes you're right. I mistyped. I've corrected above. 

Here is the AndroidManifest for v9

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:versionCode="10902"
    android:versionName="1.9.2"
    android:hardwareAccelerated="true"
    android:compileSdkVersion="28"
    android:compileSdkVersionCodename="9"
    package="com.hhrichards.lewdmod"
    platformBuildVersionCode="10902"
    platformBuildVersionName="1.9.2">     <uses-sdk
        android:minSdkVersion="21"
        android:targetSdkVersion="28" />     <supports-screens
        android:anyDensity="true"
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:resizeable="true"
        android:xlargeScreens="true" />     <uses-permission
        android:name="android.permission.INTERNET" />     <application
        android:label="@ref/0x7f030001"
        android:icon="@ref/0x7f020000"
        android:hardwareAccelerated="true"
        android:supportsRtl="true">         <activity
            android:theme="@ref/0x01030129"
            android:label="@ref/0x7f030000"
            android:name="com.hhrichards.lewdmod.MainActivity"
            android:launchMode="1"
            android:screenOrientation="1"
            android:configChanges="0x4b4"
            android:windowSoftInputMode="0x10">             <intent-filter
                android:label="@ref/0x7f030002">                 <action
                    android:name="android.intent.action.MAIN" />                 <category
                    android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>


Here is v10

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:versionCode="11000"
    android:versionName="1.10.0"
    android:hardwareAccelerated="true"
    android:compileSdkVersion="28"
    android:compileSdkVersionCodename="9"
    package="com.hhrichards.lewdmod"
    platformBuildVersionCode="11000"
    platformBuildVersionName="1.10.0">     <uses-sdk
        android:minSdkVersion="21"
        android:targetSdkVersion="28" />     <supports-screens
        android:anyDensity="true"
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:resizeable="true"
        android:xlargeScreens="true" />     <uses-permission
        android:name="android.permission.INTERNET" />     <application
        android:label="@ref/0x7f030001"
        android:icon="@ref/0x7f020000"
        android:hardwareAccelerated="true"
        android:supportsRtl="true">         <activity
            android:theme="@ref/0x01030129"
            android:label="@ref/0x7f030000"
            android:name="com.hhrichards.lewdmod.MainActivity"
            android:launchMode="1"
            android:screenOrientation="1"
            android:configChanges="0x4b4"
            android:windowSoftInputMode="0x10">             <intent-filter
                android:label="@ref/0x7f030002">                 <action
                    android:name="android.intent.action.MAIN" />                 <category
                    android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

Thanks! Yeah, those manifests look OK to me. The only thing I can think of is what Dark Dimension suggested, perhaps the latest version was signed differently (something like that happened to me with Unity Android builds a few years ago, something changed in how my builds were signed and I couldn't update my app on Google Play)

https://forums.xamarin.com/discussion/183885/fixing-app-not-installed-problem-ap...

If your device is below min version of 21 SDK - Android 5 - it won't install - any users who have devices below that - and there still are users out there with those devices, won't be able to update - the app won't install.

I'm not sure where you're publishing this but Google Play won't accept app updates on 28 SDK - only on 29 SDK - i.e. Android 10.  In other words, they'll reject your update and there will be nothing to update for the users.

If you're doing a direct install then you could have a block on Google Play Protect.  Make sure that is disabled.  They block apps that don't come from the Google Play Store. 

i found out why you having problems,  the Custom Debugger is using an older version of Android SDK. you must have it at 64 bit because google does not allow 32 bit anymore. https://stackoverflow.com/questions/44779654/monaca-compiled-app-ios-app-as-32-b...