私はRetrofitの使用により利益を得るAndroidプロジェクトを持っています。それはまだ非常に初期段階にあり、十数以下の関数とクラス定義があります。 RetrofitをGradleに追加すると、DexIndexOverflowExceptionが発生します。multiDexなしでRetrofitを使用するためにAndroid Appを調整する方法
multiDexをプロジェクトに追加するのは早すぎるようです。特に、1つの依存関係を追加することによってトリガされるようです。確かに、私は何か間違ったことをする必要があります。基本的な例では、multiDexを必要としていないようです。私は何をすべきですか?
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.mydomain.myapp"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
//multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.0.0-beta1'
compile 'com.android.support:support-v4:24.0.0-beta1'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
//compile 'com.squareup.retrofit2:converter-gson:2.1.0'
//compile 'com.android.support:multidex:1.0.0'
}