저는 프로젝트에 추가 할 때 내 테스트를 컴파일 할 수 없다는 Espresso 테스트 용 라이브러리가 있습니다.Android Studio 3.0의 com.android.dex.DexIndexOverflowException
Gradle을이 오류 이미 multiDex 내 프로젝트에 사용할 수 있기 때문에 정말 이상한
Caused by: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
at com.android.dx.merge.DexMerger$8.updateIndex(DexMerger.java:565)
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:276)
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:574)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:166)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
에게 출력
내 프로젝트 build.gradle
defaultConfig {
minSdkVersion 16
targetSdkVersion 21
versionName versionNameFromGitTagVia()
versionCode versionCodeFromJenkins()
multiDexEnabled true
testInstrumentationRunner "app.test.general.InstrumentationRunner" ...
}
dependencies {
...
androidTestImplementation project(':test-utils')
...
implementation 'com.android.support:multidex:1.0.2'
}
내 응용 프로그램 클래스
public class RiderApplication extends MultiDexApplication implements Application.ActivityLifecycleCallbacks,
GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
....
}
AndroidManifest를 라이브러리를 제거
<application
android:name=".RiderApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@style/MyAppTheme"
tools:replace="android:theme,android:icon">
문제
어떤 제안을 해결?
편집 나는 여러 가지 방법으로 그것을 해결하기 위해 시도하고, 나는
androidTestImplementation
그러나 같은 라이브러리를 포함 할 때이 만 happends 것을 발견 정기적
implementation
로 사용하는 경우 덱스 오류가 사라집니다.
정말 이상한
편집 내가 2.3.3 문제가 더 이상
'Application' 클래스를 만듭니다. 논리를 확인 https://stackoverflow.com/a/33430306/3395198 –
고마워요 @ IntelliJAmiya하지만 내 애플 리케이션은 이미 multidex – orelzion
응용 프로그램 클래스를 지원합니까 언급 했나요? –