I've just finished working on my android app and I run it in android studio emulator. It's fine and everything works well, but I have an issue - when I want to generate signed apk , I got these two errors and can't complete apk building process. I've tried a lot of things to solve these two errors that i got, but no result.
Asked
Active
Viewed 69 times
0
-
Enable multidex, check this post. http://stackoverflow.com/a/27284064/3796083 – AndroidRuntimeException Feb 18 '17 at 19:36
2 Answers
2
You've hit the 64K method limit.
Check if you've added unnecessary dependencies, check your ProGuard configuration.
Follow the instructions from the documentation
Ognian Gloushkov
- 2,669
- 1
- 20
- 35
-
after i did these steps , i got more than 2 errors and they are deferent than what i got before ,.... – ops Feb 19 '17 at 09:46
-
after i did these steps , i got more than 2 errors and they are different than what i got before , https://www.photobox.co.uk/slideshow?album_id=4730712146 – ops Feb 19 '17 at 10:04
1
Enable multiDex, do that in your build.gradle file, in defaultConfig block
And if your minSdkVersion < 21 then also add multidex support library in your dependencies block
android {
defaultConfig {
...
multiDexEnabled true // add this line
}
...
}
dependencies {
...
compile 'com.android.support:multidex:1.0.1' //If minSdkVersion < 21
}
Atef Hares
- 4,715
- 3
- 29
- 61
-
-
@OgnianGloushkov Please explain more, this has always fixed the issue for me, even if my `minSdkVersion was < 21` – Atef Hares Feb 18 '17 at 19:44
-
By the time of my comment you didn't include `compile 'com.android.support:multidex:1.0.1'` – Ognian Gloushkov Feb 18 '17 at 20:44