Dex2oat failed - errors received in android install/update app. Dex permission denied

Asked

Viewed 701 times

0

While the application is updating/running I checked several errors related to the same problem

03-13 19:58:28.772 5605-5611/? E/art: Failed sending reply to Bugger: Broken pipe 03-13 19:58:28.822 5619-5619/? E/dex2oat: Failed to create Oat file: /data/Dalvik-cache/Arm/data@[email protected]@[email protected]: Permission denied 03-13 19:58:29.242 5634-5634/? E/dex2oat: Failed to create Oat file: /data/Dalvik-cache/Arm/data@[email protected]@[email protected]: Permission denied 03-13 19:58:29.292 5639-5639/? E/dex2oat: Failed to create Oat file: /data/Dalvik-cache/Arm/data@[email protected]@[email protected]: Permission denied 03-13 19:58:29.337 5643-5643/? E/dex2oat: Failed to create Oat file: /data/Dalvik-cache/Arm/data@[email protected]@[email protected]: Permission denied 03-13 19:58:29.382 5647-5647/? E/dex2oat: Failed to create Oat file: /data/Dalvik-cache/Arm/data@[email protected]@[email protected]: Permission denied 03-13 19:58:29.427 5653-5653/? E/dex2oat: Failed to create Oat file: /data/Dalvik-cache/Arm/data@[email protected]@[email protected]: Permission denied 03-13 19:58:29.477 5657-5657/? E/dex2oat: Failed to create Oat file: /data/Dalvik-cache/Arm/data@[email protected]@[email protected]: Permission denied 03-13 19:58:29.527 5661-5661/? E/dex2oat: Failed to create Oat file: /data/Dalvik-cache/Arm/data@[email protected]@[email protected]: Permission denied 03-13 19:58:29.572 5665-5665/? E/dex2oat: Failed to create Oat file: /data/Dalvik-cache/Arm/data@[email protected]@[email protected]: Permission denied 03-13 19:58:29.617 5669-5669/? E/dex2oat: Failed to create Oat file: /data/Dalvik-cache/Arm/data@[email protected]@[email protected]: Permission denied 03-13 19:58:29.662 5681-5681/? E/dex2oat: Failed to create Oat file: /data/Dalvik-cache/Arm/data@[email protected]@[email protected]: Permission denied

I already have permission to write and read WRITE_EXTERNAL_STORAGE/READ_EXTERNAL_STORAGE what might be ?? what permission is this that is denied ?

AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/>

<!--
     The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
     Google Maps Android API v2, but you must specify either coarse or fine
     location permissions for the 'MyLocation' functionality. 
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<application
    android:name="android.support.multidex.MultiDexApplication"
    android:allowBackup="true"
    android:icon="@drawable/police"
    android:label="@string/app_name"
    android:theme="@style/AppTheme">
    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_splash"
        android:screenOrientation="nosensor"
        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-alias
        android:name=".MainActivity-um"
        android:enabled="true"
        android:icon="@drawable/police"
        android:label="Vade Mecum"
        android:screenOrientation="nosensor"
        android:targetActivity=".MainActivity"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity-alias>
    <activity-alias
        android:name=".MainActivity-dois"
        android:enabled="false"
        android:icon="@drawable/iconetriball"
        android:label="Tatoo"
        android:screenOrientation="nosensor"
        android:targetActivity=".MainActivity"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity-alias>
    <activity-alias
        android:name=".MainActivity-tres"
        android:enabled="false"
        android:icon="@drawable/iconebode"
        android:label="Zoo"
        android:screenOrientation="nosensor"
        android:targetActivity=".MainActivity"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity-alias>
    <activity-alias
        android:name=".MainActivity-quatro"
        android:enabled="false"
        android:icon="@drawable/iconeplay"
        android:label="Play Songs"
        android:screenOrientation="nosensor"
        android:targetActivity=".MainActivity"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity-alias>
    <activity-alias
        android:name=".MainActivity-cinco"
        android:enabled="false"
        android:icon="@drawable/iconeusa"
        android:label="Usa"
        android:screenOrientation="nosensor"
        android:targetActivity=".MainActivity"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity-alias>
    <activity-alias
        android:name=".MainActivity-seis"
        android:enabled="false"
        android:icon="@drawable/iconewirelles"
        android:label="Wirelles Remote"
        android:screenOrientation="nosensor"
        android:targetActivity=".MainActivity"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity-alias>
    <activity-alias
        android:name=".MainActivity-sete"
        android:enabled="false"
        android:icon="@drawable/alianca"
        android:label="Aliance"
        android:screenOrientation="nosensor"
        android:targetActivity=".MainActivity"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity-alias>
    <activity-alias
        android:name=".MainActivity-oito"
        android:enabled="false"
        android:icon="@drawable/correio"
        android:label="Correio"
        android:screenOrientation="nosensor"
        android:targetActivity=".MainActivity"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity-alias>
    <activity-alias
        android:name=".MainActivity-nove"
        android:enabled="false"
        android:icon="@drawable/email"
        android:label="E-mail"
        android:screenOrientation="nosensor"
        android:targetActivity=".MainActivity"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity-alias>
    <activity-alias
        android:name=".MainActivity-dez"
        android:enabled="false"
        android:icon="@drawable/trabalhando"
        android:label="Em Obras"
        android:screenOrientation="nosensor"
        android:targetActivity=".MainActivity"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity-alias>

    <activity
        android:name=".Vademecum"
        android:parentActivityName=".MainActivity">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="br.gov.rj.pmerj.policialoficialsv.MainActivity" />
        <meta-data
            android:name="android.app.searchable"
            android:resource="@xml/searchable" />
    </activity>

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

    <activity android:name=".PesquisaActivity" />
    <activity android:name=".SearchResultsActivity" />
    <activity
        android:name=".VademecumItens"
        android:parentActivityName=".Vademecum" />

    <meta-data
        android:name="android.support.PARENT_ACTIVITY"
        android:value="br.gov.rj.pmerj.policialoficialsv.Vademecum" />

    <activity
        android:name=".VademecumItemUnico"
        android:parentActivityName=".VademecumItens">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="br.gov.rj.pmerj.policialoficialsv.VademecumItens" />
    </activity>
    <!--
         The API key for Google Maps-based APIs is defined as a string resource.
         (See the file "res/values/google_maps_api.xml").
         Note that the API key is linked to the encryption key used to sign the APK.
         You need a different API key for each encryption key, including the release key that is used to
         sign the APK for publishing.
         You can define the keys for the debug and release targets in src/debug/ and src/release/. 
    -->
    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="@string/google_maps_key" />

    <activity
        android:name=".MapsActivity"
        android:label="@string/title_activity_maps" />
    <activity
        android:name=".AlterarIconeActivity"
        android:label="@string/title_activity_alterar_icone"
        android:parentActivityName=".MainActivity">
    <meta-data
        android:name="android.support.PARENT_ACTIVITY"
        android:value="br.gov.rj.pmerj.policialoficialsv.MainActivity" />
        />
    </activity>
    <activity
        android:name=".teste"
        android:label="@string/title_activity_teste"
        android:theme="@style/AppTheme.NoActionBar"></activity>
</application>

1 answer

0

Starting with Android 6.0 (API level 23), users grant permissions to applications while they are running, not when they are installed. This approach optimizes the application installation process as the user does not need to grant permissions when installing or updating the application. It also gives the user more control over the application’s features. For example, a user could choose to allow a camera app access to the camera, but not the location of the device. The user can revoke permissions at any time on the application’s Settings screen.

Follow the example of how to request permission:

/**
 * Verifica a permissão do usuário
 */
private void checkPermission() {
    // Verifica necessidade de verificacao de permissao
    if (ContextCompat.checkSelfPermission(this, android.Manifest.permission. WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
        // Verifica necessidade de explicar necessidade da permissao
        if (ActivityCompat.shouldShowRequestPermissionRationale(this, android.Manifest.permission. WRITE_EXTERNAL_STORAGE)) {
            Toast.makeText(this, "É necessário dar acesso de escrita!", Toast.LENGTH_SHORT).show();
            ActivityCompat.requestPermissions(this,
                    new String[]{android.Manifest.permission. WRITE_EXTERNAL_STORAGE},
                    CODE_PERMISSION_LOCATION);
        } else {
            // Solicita permissao
            ActivityCompat.requestPermissions(this,
                    new String[]{android.Manifest.permission. WRITE_EXTERNAL_STORAGE},
                    CODE_PERMISSION_LOCATION);
        }
    }
}

SOURCE

Browser other questions tagged

You are not signed in. Login or sign up in order to post.