10

My app is crashed with following error,

 E/dex2oat: Failed to create oat file:/data/dalvik-cache/arm/data@app@com.stvgame.xiaoy.remote-1@split_lib_dependencies_apk.apk@classes.dex: Permission denied

And our app use mutipule dex, does they have relation?

Matthias
  • 4,481
  • 12
  • 45
  • 84
happyburglar
  • 121
  • 1
  • 1
  • 8
  • I get the same error, without multidex. I do have arm8 build though, maybe it is a 64bit specific thing? – Bram Mar 09 '18 at 00:28
  • I solved this problem with edit my primary dex file. see [this](https://stackoverflow.com/questions/52294318/failed-to-create-oat-file) – Amir133 Nov 14 '18 at 12:47

2 Answers2

12

I had a similar problem and my solution was disable the Instant Run, if you're using Android Studio...

Miller
  • 121
  • 1
  • 2
4

I had got a similar error when i used multi dex for the first time, This guide helped a lot,

My error was i forgot to add this in the application class:

public class MyApplication extends SomeOtherApplication {
  @Override
  protected void attachBaseContext(Context base) {
     super.attachBaseContext(base);
     MultiDex.install(this);
  }
}

in your build gradle, make sure you have included the following lines:

android {
    defaultConfig {
        ...
        minSdkVersion 15 
        targetSdkVersion 25
        multiDexEnabled true
    }
    ...
}

dependencies {
  compile 'com.android.support:multidex:1.0.1'
}

Even then multi dex has limitations with progaurd, read the guide to find out if that is causing this issue.

Harsh Ganatra
  • 411
  • 3
  • 8