문제

I have an Android project that requires the Jsoup library. I've tried everything I can think of to get the jar shaded into the APK.. I just can't get it working. Logcat tells me:

FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: org.jsoup.Jsoup

Does anyone know how to include/shade a maven artifact into an APK with Android Studio?

도움이 되었습니까?

해결책

I have found the answer. The trick is to append ":sources". See an example here: http://www.alonsoruibal.com/my-gradle-tips-and-tricks/

다른 팁

I have seen the same type of error every time someone else adds a library with Gradle. Build is usually successful but app crashes when it tries to use the new library. Running task clean with Gradle helps.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top