Android APK 安装 "Package Installer has Stopped"

标签 android android-studio apk android-manifest

我正在 Android Studio 中开发一个应用程序,并使用 Build APK 工具生成 APK 文件供队友测试。最近,他们开始在 APK 安装时遇到错误,每当他们打开 .apk 文件时,就会提示“Package Installer has Stopped”。

安装到此为止。最近,一个无法在 Galaxy S7 Edge 和 Note 8 上安装的 apk 在 LG V20 上成功安装,如果这有值(value)的话。此外,我在 .apk 上传之间对应用程序所做的重大更改是编写一些 java 代码以在单击按钮后在设备上打开另一个应用程序。当点击发生时,应用程序将打开(如果已安装)或重定向到 Play 商店供用户安装。

我四处阅读,似乎有些遇到此问题的人收到了相同的消息,因为他们的 AndroidManifest 中未设置某些权限。打开单独的应用程序是否需要权限?或者还有其他可能导致此问题的原因吗?

编辑:还提到我无法卸载我的应用程序的已安装版本。我尝试了一种在线解决方案,该解决方案清除数据并强制停止 Package Installer(系统应用程序)并且卸载其他应用程序变得更慢。

这是我的AndroidManifest.xml

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

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <application
        android:name=".GlobalValue"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher_official"
        android:label="@string/icon_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".HomeActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar" />
        <activity android:name=".LoginActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".PlanSelectedActivity" />
        <activity android:name=".ReportWorkoutActivity" />
        <activity android:name=".DeviceMonitoringActivity" />
        <activity android:name=".SubscribedUserActivity" />
        <activity android:name=".ChangePasswordActivity" />
        <activity android:name=".CreateAccountActivity"></activity>
    </application>

</manifest>

以及我的 build.gradle 中的依赖项。

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.volley:volley:1.1.1'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.squareup:android-times-square:1.6.5@aar'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

最佳答案

看来我解决了我的问题。

我为该应用上传了一个自定义图标。在AndroidManifest代码中可以看到:

android:icon="@drawable/ic_launcher_official"

此图标的尺寸太大 (>1600x1600)。我使用在线图像缩减器(谷歌附近的一个)将相同的图像缩小到 < 500x500。重新构建 apk 并安装它。我现在可以再次安装、运行和卸载该应用程序。

关于Android APK 安装 "Package Installer has Stopped",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53643434/

相关文章:

java - Android错误: Syntax error on token "}",删除此 token

android - 在用户响应之前对自定义内核调用 onRequestPermissionsResult 调用 requestPermissions 两次

android - React native 应用程序不适用于 Android 版本 11

android - 安装 Xamarin 后 ADB 无法在 Android Studio 中运行

安卓分析APK

android - apklib 和 jar 文件有什么区别?

android - 使用 Xamarin 相机拍摄后如何提高图像质量?

java - 在 Android 中使用另一个 List<String> 追加到全局列表 <String>

android - MPAndroidchart - 烛台图表为空白

运行时不会生成Android APK