Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android, apk installation INSTALL_FAILED_POLICY_REJECTED_PERMISSION

Tags:

java

android

I'm trying to install application using Android Studio, I manage to install other apps except this app, when I try to install it I get few errors within the Logcat following by INSTALL_FAILED_POLICY_REJECTED_PERMISSION alert, I'm not sure what error relates to the main problem(not able to install the app) but here they are:

2 times the following error:

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

after that there are 2 times:

getAuthToken called with non existant account: [email protected]
Failed to get auth token: no such account
android.accounts.AuthenticatorException: no such account

And finally I get an alert with INSTALL_FAILED_POLICY_REJECTED_PERMISSION.

To be precise(there was an app with the same name long ago so it might make sense, but anyway clicking ok fail to install the 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?

Edit:

I factory reset the device, and btw, it's an 4.4.4 Note 4 device and same error, so it should be the app or something with the build.

Furthermore, I removed all my accounts, removed the email app, I did probably everything online but still, same error.

Edit:

First, it's working on emulators, now, here are some more details, the manifest:

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

As for my dependencies:

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 is set to 24 and minSdkVersion is set to 19

like image 509
Aviel Fedida Avatar asked Sep 07 '16 16:09

Aviel Fedida


People also ask

How do I fix failed to install an APK?

The Android app not installed error can be combated after resetting app permissions. Go to Settings > Apps > Reset App Preferences/Reset Application Permissions. After this, third-party software can be installed on your device.

How do I install an APK file on my Samsung?

Android 8 or aboveOn your device, tap Settings > Apps. Tap Special access > Install unknown apps. Tap the browser from where you will download the APK, such as Chrome.


1 Answers

First thing that comes to mind is a device admin application is on your phone. This is usually the case for phones used in enterprise setting. The app forces certain policies for your phone. https://developer.android.com/reference/android/app/admin/DevicePolicyManager.html

As you already removed all your (exchange) email, my next guess is could be a problem within your app. There are few libraries/tools out there that require developer phones to work properly. Would you be able to share your manifest or/and dependencies to give us a better picture of your app?

like image 84
user1506104 Avatar answered Oct 16 '22 02:10

user1506104