安卓, apk安装INSTALL_FAILED_POLICY_REJECTED_PERMISSION

2022-09-04 04:33:36

我正在尝试使用Android Studio安装应用程序,我设法安装除此应用程序以外的其他应用程序,当我尝试安装它时,我在Logcat中收到一些错误,然后通过警报,我不确定什么错误与主要问题有关(无法安装该应用程序),但在这里它们是:INSTALL_FAILED_POLICY_REJECTED_PERMISSION

2 次以下错误:

com.example.appName has no certificates at entry AndroidManifest.xml; ignoring!

之后有2次:

getAuthToken called with non existant account: myoldemail@gmail.com
Failed to get auth token: no such account
android.accounts.AuthenticatorException: no such account

最后,我收到一个警报。INSTALL_FAILED_POLICY_REJECTED_PERMISSION

确切地说(很久以前有一个同名的应用程序,所以它可能有意义,但无论如何点击确定都无法安装apk):

Installation failed with message INSTALL_FAILED_POLICY_REJECTED_PERMISSION.
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

WARNING: Uninstalling will remove the application data!

Do you want to uninstall the existing application?

编辑:

我将设备恢复出厂设置,顺便说一句,这是一个4.4.4 Note 4设备和相同的错误,所以它应该是应用程序或带有构建的东西。

此外,我删除了我的所有帐户,删除了电子邮件应用程序,我可能在网上做了所有事情,但仍然犯了同样的错误。

编辑:

首先,它正在模拟器上工作,现在,这里有一些更多细节,清单:

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


    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <permission
        android:name="com.example.appName.C2D_MESSAGE"
        android:protectionLevel="signature" />
    <uses-permission android:name="com.example.appName.permission.C2D_MESSAGE" />

    <application
        android:name=".AppClass"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <!-- https://github.com/ParsePlatform/Parse-SDK-Android/issues/39 -->
        <meta-data
            android:name="com.parse.push.gcm_sender_id"
            android:value="id:1057382563338" />
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />

        <activity
            android:name=".activities.MainActivity"
            android:label="AppName"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activities.RegistrationActivity"
            android:label="Registration"
            android:parentActivityName=".activities.MainActivity"
            android:theme="@style/AppTheme.NoActionBar">
            <!-- The meta-data element is needed for versions lower than 4.1 -->
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".activities.MainActivity" />
        </activity>
        <activity
            android:name=".activities.TouActivity"
            android:label="Terms of use"
            android:parentActivityName=".activities.MainActivity"
            android:theme="@style/AppTheme.NoActionBar">
            <!-- The meta-data element is needed for versions lower than 4.1 -->
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".activities.MainActivity" />
        </activity>
        <activity
            android:name=".activities.PPActivity"
            android:label="Privacy policy"
            android:parentActivityName=".activities.MainActivity"
            android:theme="@style/AppTheme.NoActionBar">
            <!-- The meta-data element is needed for versions lower than 4.1 -->
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".activities.MainActivity" />
        </activity>

        <activity
            android:name=".activities.DashboardActivity"
            android:label="Dashboard"
            android:launchMode="singleTop"
            android:theme="@style/AppTheme.NoActionBar" />

        <activity
            android:name=".activities.PassChangeActivity"
            android:label="Password change"
            android:parentActivityName=".activities.DashboardActivity"
            android:theme="@style/AppTheme.NoActionBar">
            <!-- The meta-data element is needed for versions lower than 4.1 -->
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".activities.DashboardActivity" />
        </activity>

        <receiver android:name=".gps.GpsLocationReceiver">
            <intent-filter>
                <action android:name="android.location.PROVIDERS_CHANGED" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </receiver>
        <receiver
            android:name=".utils.CustomPushReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.USER_PRESENT" />
                <action android:name="com.parse.push.intent.RECEIVE" />
                <action android:name="com.parse.push.intent.DELETE" />
                <action android:name="com.parse.push.intent.OPEN" />
            </intent-filter>
        </receiver>

        <service android:name="com.parse.PushService" />
        <!-- This receiver calling PushService defined above -->
        <receiver
            android:name="com.parse.GcmBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter>
                <!-- Receive the actual message -->
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <!-- Receive the registration id, http://stackoverflow.com/questions/22217601/is-com-google-android-c2dm-intent-registration-deprecated -->
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <category android:name="com.example.appName" />
            </intent-filter>
        </receiver>
    </application>

</manifest>

至于我的依赖关系:

compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.support:support-v4:24.2.0'
compile 'com.facebook.android:facebook-android-sdk:4.15.0'
compile 'com.parse:parsefacebookutils-v4-android:1.10.4@aar'
compile 'com.parse:parse-android:1.13.1'
compile 'com.parse:parsetwitterutils-android:1.10.5'
compile 'com.android.support:cardview-v7:24.2.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.jakewharton.rxbinding:rxbinding-appcompat-v7:0.4.0'

compileSdkVersion+targetSdkVersion设置为 24 并设置为 19minSdkVersion


答案 1

首先想到的是设备上的设备上有一个管理应用程序。对于企业设置中使用的电话,通常就是这种情况。该应用程序会为您的手机强制实施某些策略。https://developer.android.com/reference/android/app/admin/DevicePolicyManager.html

由于您已经删除了所有(交换)电子邮件,因此我的下一个猜测可能是您的应用程序中的问题。很少有库/工具需要开发人员手机才能正常工作。你是否能够共享你的清单或/和依赖项,以便我们更好地了解你的应用?


答案 2

您是否在设备上安装了 Knox?我遇到了类似的问题,三星诺克斯是我被拒绝的原因。禁用 Knox 后,我被允许安装.apk。

另外,您是否检查过是否允许“未知来源”?我假设你这样做,因为你已经能够安装其他应用程序,但我很好奇它设置了什么。

您知道.apk是否正确签名和对齐等等吗?


推荐