Android App Users Get "App not installed" When Attempting to Update
Asked Answered
E

5

20

UPDATE: To those who asked about which error codes the users are receiving: there are no error codes. It just opens a blank, post-installation page that says "The app was not installed" with a big 'X' next to it. It's possible different versions of Android could have different messages. There is no indication for what went wrong during the installation.

UPDATE 2: Some users reported that they receive error code "-504" when they try to install/update from the Play Store, and the "app not installed" message when manually trying to install the .apk. I don't know what correlation this error has with users being unable to install, but the solutions from the only 2 questions on SO on this topic did not fix anything for me. I've included the updated manifests and build files.

UPDATE 3: It appears as users report this issue in versions after IAB has been successfully installed, which further de-legitimatizes the concept that this issue is caused by introducing IAB.

UPDATE 4: It looks like the problem is with old users trying to update to a new version, and not with new users. With that in mind, there is a high likelihood that this issue is result of INSTALL_FAILED_UID_CHANGED. Looking through the version history, the significant change I made in the problematic version that users cannot update from is removing drawables that I no longer intended of using.

Asking users to go through the procedure to fix this isn't plausible. If there is a solution that I can enforce which would fix it for faulty users, wonderful... if not, the least I can do at this point is damage control and ensure this doesn't happen in the future.

NOTE: Below is the original post speculating that the problem is the result of introducing IAB into the app. Since then, it has become more and more unlikely for that to be the cause. Regardless, the post still has relevant information.

------------------------------------------------------------------------------------------

Original Title: Android App Users Get "App not installed" After Introducing IAB

I recently introduced IAB in my app that was published on Google Play. After a while, I've started to get reports from some users that they get an "installation unsuccessful" error when they try to install or update it. What makes me think it's caused by introducing IAB is that one particular long-time user e-mailed me that when he's attempting to update to the version with IAB, the installer mentions that new permissions were introduced and requires the user's permission. Once granted, it says that the app failed to install.

I've done some Googling and it appears to be a problem from their end, one user even tried to manually install an .apk with said permissions removed without any success. I wan't to make sure that it's not something I've done wrong, but an inevitability that I have to accept with some users.

Note that the vast majority has no problem of installing the app, and I haven't received any reports of this until after IAB was introduced. It wouldn't bother me so much were it a small amount of lost users, but the problem is, those users hurt my app's rating. Users have also mentioned that they can install apps, excluding my own, perfectly well.

I don't rule out the possibility that users may have been getting these errors even before IAB was introduced, and the linkage could be a mistaken one.

Here is my manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest package = "com.jjsoftware.fullscientificcalculator"
      xmlns:android = "http://schemas.android.com/apk/res/android">

<uses-permission android:name = "android.permission.VIBRATE"/>
<uses-permission android:name = "com.android.vending.BILLING"/>

<application
    android:allowBackup = "true"
    android:fullBackupContent = "true"
    android:icon = "@drawable/logo"
    android:label = "@string/app_name">
    <activity
        android:name = ".MainActivity"
        android:hardwareAccelerated = "false"
        android:label = "@string/app_name"
        android:screenOrientation = "portrait"
        android:theme="@style/AppTheme">
        <intent-filter>
            <action android:name = "android.intent.action.MAIN"/>
            <category android:name = "android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
    <activity
        android:name = ".SettingsActivity"
        android:theme = "@style/PreferencesTheme">
        <intent-filter>
            <action android:name = ".SettingsActivity"/>
            <category android:name = "android.intent.category.PREFERENCE"/>
        </intent-filter>
    </activity>
</application>

Here is the Gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.jjsoftware.fullscientificcalculator"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 102
        versionName "1.679"
    }

    sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
}

dependencies {
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.google.android.gms:play-services-ads:8.4.0'
    compile 'com.android.support:gridlayout-v7:23.2.1'
    compile files('libs/exp4j-0.4.5.jar')
    compile files('libs/EJML-core-0.28.jar')
    compile files('libs/EJML-dense64-0.28.jar')
    compile files('libs/Jama-1.0.3.jar')
    compile files('libs/EJML-simple-0.28.jar')
}

And, if need be, the top-level build:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
Enthetic answered 30/3, 2016 at 16:13 Comment(18)
You need a user to attempt to manually install the APK and tell you exactly the output. An installation failed error is usually caused by having a bad version code or not correctly signed. Those errors should usually be catched by Google Play though. We still need to know the exact error that the user sees. If you are willing to upload the pre-billing version and the post-billing version I could see if there is an issue.Competency
This is exactly what I have done. There is no output other than a window saying the app was not installed. I've tried removing the permissions as well. It seems that suku's answer is the most likely, as I am testing now.Enthetic
What do you mean the before and after? I simply removed the billing permissions entirely and users were unable to install still. I don't have previous versions of my manifest.Enthetic
It's problematic, I don't know where did this issue start. Remember the case that only a few users get this.Enthetic
Any older APK will do, a month ago, 2 months ago, that is less important. It doesn't need to be the APK directly before the issue.Competency
I found an older version that I have, do you need any specifics of it or would you like the entire .apk uploaded somewhere?Enthetic
Here. Note that the package name and app names are different than posed in the question: filedropper.com/fsc. Also note that in the new .apk I've fixed the typo and made a few adjustments as suggested here.Enthetic
What happens if you remove android:largeHeap="true"? I see that is the only difference between the two Manifests. I can update the APK from the old to the new just fine with mine.Competency
The new version doesn't have it, and it doesn't work for people with this problem. Remember that I too can upload without a problem and run the app, but there are some users who cannot, which is why solving this issue is difficult as the error cannot be immediately reproduced.Enthetic
Then reverse it, and put android:largeHeap="true" back in, have you tested that with the users? That is the only difference I can see might cause an issue.Competency
Yes. I only removed it today, both versions don't work for them. I would say it's a problem on their end, but they are able to install every other app but mine.Enthetic
Check two things: Have you upgraded from gradle 1.5 to 2.0-XXXX recently as well? Have you manually added useJack in your app.build? These are 2 things that would definitely cause issues for some users.Fleuron
My gradle build version is still 1.5, but what is useJack? I didn't add it. Also, I don't understand from your phrasing whether I should use them or not.Enthetic
Can someone of your users try install the APK using adb install command? It's necessary to explain "app not installed" message with some technical info.Gilman
See android.stackexchange.com/questions/88214/…Valery
I don't think it's the same issue, as I have people with even above the Lollipop version receiving this error. Furthermore, the error code is different (-504 as opposed to -505 in the linked question.)Enthetic
I saw somewhere that if you lower target sdk, then your issue (504) is observed. I see that the gridLayout has version higher than appCompat. So did you lower the appCompat version during the update from 23.2 to 23.1 ? Probably the gridLayout was using a feature in new AppCompat earlier. ... This may be really far fetched but I can't think of any better.Selfhypnosis
If you use a contentprovider dbhelper has a version if schema changes you should increment the versionCryan
S
2

There is a typo in the manifest file on line android:largeHeap="true">>. xml line ends with >>. This may be causing the error.

Selfhypnosis answered 6/4, 2016 at 10:37 Comment(2)
I think that might be a typo in making the question. The APK wouldn't have compiled with this error on it. So users couldn't have installed it in the first place.Competency
suku is correct, the app compiles with that typo and it's most likely the issue. EDIT: testers are reporting this was not the issue causing the failed installation.Enthetic
M
1

it could be the phones have a lower version of the Google play services than the minimum you defined in the APK.

There is nothing much you can do if that is the case, other than for the users to upgrade their google services (https://play.google.com/store/apps/details?id=com.google.android.gms&hl=en) or you reduce your version.

also you may need to add the following to your manifest. (i think this is used to compare the versions installed in the phones with the versions required by the apk)

<application ...>

    <!-- This meta-data tag is required to use Google Play Services. -->
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" /> 

</application>
Manoeuvre answered 1/5, 2016 at 6:56 Comment(1)
While there haven't been any concise answers yet, since my bounty is about to run out, I will reward it to you instead of wasting it since this was pretty new to me, and that excerpt might prevent future problems.Enthetic
Z
1

I got this error while installing on my Android device a new APK for the app I am developing.

I checked the debug log on the device (using "adb -d logcat > log.txt") and found an entry saying "PackageManager: Downgrade detected: Update version code 2 is older than current 10000". Obviously something went wrong with the versioning somehow.

I uninstalled the package and then was able to install the APK with no problems.

Zagreb answered 10/9, 2017 at 9:10 Comment(0)
E
0

Remember that the latest installment of Android (Marshmallow version) has changed the permissions to give more access to permissions to the user. Hence it is not enough to define the permissions in the manifest anymore.

Through code you need to make sure that the billing permission is enabled by the users when they use the app. The simplest way to go around this is to set the target SDK to v-22. This should temporarily solve your issue.

The real solution however is to handle the new permissions introduced in Marshmallow. Here is how to do it:

@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {

    switch(requestCode) {
        case BILLING_REQUEST:
            if (canAccessBilling()) {
                callBillingPerms();
            }
            break;
    }
}

private void callBillingPerms() {
    Toast.makeText(this, "We need your permission to access Billing", Toast.LENGTH_SHORT).show();
}

private boolean canAccessSMS() {
    return(hasPermission(Manifest.vending.BILLING));
}

@TargetApi(Build.VERSION_CODES.M)
private boolean hasPermission(String perm) {
    return(PackageManager.PERMISSION_GRANTED==this.checkSelfPermission(perm));
}

Hope this helps :)

Engvall answered 6/4, 2016 at 7:16 Comment(2)
Billing permission is not listed as "Dangerous" and as such does not need to be requested at runtime. Also, the build tools version does not determine whether runtime permissions are enabled, the target SDK does. (23 or above uses marshmallow permissions, 22 and below does not)Hawthorn
you are right @Hawthorn on the second part of the comment. I'll change the answer from my end.Engvall
P
-2

Perhaps the error is on the user's side.

This article states the following:

Google Play - Error 504

Problem

App could not be downloaded due to an error.

First solution

The usual, please: go to Settings > Apps > All > Google Play Store and Clear cache and Clear data. Also Clear cache and Clear data for Google Services Framework.

Second solution

Try removing your GMail account

This Stack Exchange answer discussed similar ideas.

According to the list of status codes at Wikipedia, a 504 error means the following:

504 Gateway Timeout
The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.

Ask your users if doing the above solves their issue.

Prostate answered 3/5, 2016 at 16:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.