응용 프로그램 종속성으로 Guava를 사용하고 Instrumentation 테스트에서 Espresso를 사용합니다. 에스프레소는 com.google.guava:guava:16.0
과 함께 제공되며 응용 프로그램 종속성이 guava
이므로 중복 된 종속성 문제를 처리해야합니다.guava 종속성 및 Espresso를 사용하여 응용 프로그램을 구성하는 방법
java.lang.NoSuchMethodError: com.google.common.base.Optional.get
at com.google.android.apps.common.testing.ui.espresso.base.ThreadPoolExecutorExtractor.getAsyncTaskThreadPool(ThreadPoolExecutorExtractor.java:50)
: 나는 다음과 같은 오류의 무리를 얻고있다하지만 그 라인에
compile 'com.google.guava:guava:17.0'
androidTestCompile('com.jakewharton.espresso:espresso:1.1-r3') {
exclude group: 'com.squareup.dagger'
exclude group: 'com.google.guava'
}
:
제이크 와튼 내가 뭔가를 수행하여 중복 의존성 문제를 해결 할 수 Double Espresso에서 언급 에스프레소가 구아바 의존성을 찾지 못하는 것처럼 보입니다. 나는 이제 java.lang.NoSuchMethodError: com.google.common.base.Optional.get
는 에스프레소 코드에서 사라
compile 'com.google.guava:guava:17.0'
androidTestCompile ('com.jakewharton.espresso:espresso:1.1-r2') {
exclude group: 'com.squareup.dagger'
exclude group: 'com.google.guava'
}
androidTestCompile('com.google.guava:guava:17.0')
으로 시도하지만, 계측 테스트 구아바의 방법 중 하나를 사용하는 응용 프로그램 코드를 칠 때 나는 여전히 다음과 같은 오류를 얻고 경우 : java.lang.NoClassDefFoundError
을 androidTestCompile('com.google.guava:guava:17.0')
도 제거하면이 오류가 발생합니다.
나는 구아바와 운이없는 AndroidTestProvided
으로 시도했다.
그리고 guava 메소드를 사용하여 계측 테스트에서 애플리케이션 코드가 나왔을 때 왜 구아바 경로를 찾을 수 없는지에 대한 아이디어가 부족합니다. 여기
는 스택 트레이스가com.google.common.collect.Ordering
사용
new Ordering<SomeClass>()
안타
Caused by: java.lang.NoClassDefFoundError: com/themis/clioAndroid/activity/calendar/calendarEntry/CalendarEntryListAdapter$1
at com.themis.clioAndroid.activity.calendar.calendarEntry.CalendarEntryListAdapter.<clinit>(CalendarEntryListAdapter.java:112)
... 34 more
Caused by: java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
at dalvik.system.DexFile.defineClass(Native Method)
at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:211)
at dalvik.system.DexPathList.findClass(DexPathList.java:315)
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:58)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
... 35 more
이다.
모든 의견을 환영합니다.
NoClassDefFoundError에 대한 스택 추적을 게시하십시오. – yogurtearl
@yogurtearl 방금 스택 추적을 붙여 넣었습니다. 다른 정보가 필요한 경우 알려 주시기 바랍니다. –
당신은 프로 가드를 사용하고 있습니까? 그렇다면, Proguard를 비활성화하면 NoSuchMethodError가 사라지나요? – yogurtearl