I am uploading my Fire TV application on Amazon app store. I got error of multidex library.
The app exceeded 65k reference limit. Please enable multidexing your app or use ProGuard to reduce methods and resubmit the app.
Below is my app gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
minSdkVersion 21
targetSdkVersion 26
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
disable 'MissingTranslation'
}
dexOptions {
javaMaxHeapSize = "4g"
preDexLibraries = false
}
}
dependencies {
// Glide image library
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:support-v4:26.0.0'
compile 'com.android.support:appcompat-v7:26.0.0'
compile 'com.google.android.gms:play-services:+'
compile 'com.google.android.gms:play-services-analytics:10.2.4'
compile 'com.android.support:multidex:1.0.2'
compile 'com.android.volley:volley:1.0.0'
compile project(path: ':library')
compile project(path: ':ffmpeg')
compile project(path: ':okhttp')
compile project(path: ':opus')
compile project(path: ':flac')
compile project(path: ':playbacktests')
compile project(path: ':testutils')
compile project(path: ':vp9')
compile files('libs/WebtrendsAndroidClientLib.jar')
}
Below is AndroidManifest File
<application
android:name=".controller.app.MyApp"
android:allowBackup="true"
android:banner="@drawable/tv_launcher"
android:hardwareAccelerated="false"
android:icon="@drawable/app_logo"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar">
Below is Application class
public class MyApp extends Application {
@Overrideprotected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
What is going wrong with my code regarding multidex enable that amazon store reject my apk for uploading with multidex error? Please give me solution