Android App用户在尝试更新时获取“Ap p not installed”

问题描述 投票:19回答:5

更新:对于询问用户正在接收哪些错误代码的人:没有错误代码。它只是打开一个空白的安装后页面,上面写着“应用程序未安装”,旁边有一个大的“X”。不同版本的Android可能会有不同的消息。没有迹象表明安装过程中出了什么问题。

更新2:一些用户报告说,当他们尝试从Play商店安装/更新时收到错误代码“-504”,并在手动尝试安装.apk时收到“app not installed”消息。我不知道这个错误与无法安装的用户有什么关联,但是关于这个主题的关于SO的仅有2个问题的解决方案并没有为我解决任何问题。我已经包含了更新的清单和构建文件。

更新3:用户在成功安装IAB后在版本中报告此问题,这进一步证明了此问题是由引入IAB引起的概念的合法化。

更新4:看起来问题是旧用户尝试更新到新版本,而不是新用户。考虑到这一点,这个问题很有可能是INSTALL_FAILED_UID_CHANGED的结果。浏览版本历史记录,我在用户无法更新的有问题版本中所做的重大更改是删除我不再打算使用的drawable。

要求用户通过程序来解决这个问题并不合理。如果有一个我可以强制执行的解决方案可以解决有缺陷的用户,那就太好了......如果没有,那么我现在能做的最少就是损害控制并确保将来不会发生这种情况。

注意:以下是原始帖子推测问题是将IAB引入应用程序的结果。从那时起,它变得越来越不可能成为原因。无论如何,该帖子仍然有相关信息。

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

原标题:Android App用户在介绍IAB后获取“Ap​​p not installed”

我最近在我的应用程序中介绍了IAB,该应用程序已在Google Play上发布。过了一段时间,我开始收到一些用户的报告,当他们尝试安装或更新它时,他们会收到“安装失败”错误。让我觉得引入IAB的原因是,一位特定的长期用户通过电子邮件告诉我,当他尝试使用IAB更新到版本时,安装程​​序会提到引入了新的权限并需要用户的许可。一旦被授予,它表示应用程序无法安装。

我做了一些谷歌搜索,它似乎是一个问题从他们的结束,一个用户甚至试图手动安装.apk删除所述权限没有任何成功。我不确定这不是我做错了什么,而是我必须接受一些用户的必然性。

请注意,绝大多数都没有安装应用程序的问题,直到IAB推出之后我才收到任何报告。如果少量丢失的用户不会打扰我,但问题是,这些用户会损害我的应用程序的评级。用户还提到他们可以完全安装应用程序,不包括我自己的应用程序。

我不排除用户在引入IAB之前可能已经出现这些错误的可能性,并且链接可能是错误的。

这是我的清单:

<?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>

这是Gradle文件:

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')
}

并且,如果需要,顶级构建:

// 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()
    }
}
android android-gradle apk android-manifest
5个回答
2
投票

android:largeHeap="true">>行的清单文件中有一个拼写错误。 xml行以>>结尾。这可能导致错误。


1
投票

可能是手机的Google Play服务版本低于您在APK中定义的最低版本。

除非用户升级他们的谷歌服务(https://play.google.com/store/apps/details?id=com.google.android.gms&hl=en)或减少你的版本,否则你无能为力。

您也可能需要在清单中添加以下内容。 (我认为这用于比较手机中安装的版本与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>

0
投票

请记住,最新版本的Android(Marshmallow版本)已更改权限,以便为用户提供更多权限。因此,仅在清单中定义权限是不够的。

通过代码,您需要确保用户在使用应用时启用了结算权限。解决此问题的最简单方法是将目标SDK设置为v-22。这应该暂时解决您的问题。

然而,真正的解决方案是处理Marshmallow中引入的新权限。这是怎么做的:

@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));
}

希望这可以帮助 :)


0
投票

我在我的Android设备上安装了一个新APK用于我正在开发的应用程序时出现此错误。

我检查了设备上的调试日志(使用“adb -d logcat> log.txt”)并找到一个条目“PackageManager:检测到降级:更新版本代码2早于当前10000”。很明显,版本控制出了问题。

我卸载了包,然后能够安装APK没有问题。


-1
投票

也许错误在用户身边。

This article说明如下:

Google Play - 错误504

问题

由于错误,无法下载应用程序。

第一解决方案

通常,请:转到设置>应用>所有> Google Play商店和清除缓存和清除数据。同时清除Google Services Framework的缓存和清除数据。

二解决方案

尝试删除您的GMail帐户

这个Stack Exchange answer讨论了类似的想法。

根据list of status codes at Wikipedia,504错误意味着以下内容:

504网关超时 服务器充当网关或代理,并未从上游服务器收到及时响应。

询问您的用户是否解决了上述问题。

© www.soinside.com 2019 - 2024. All rights reserved.