I just created a library and uploaded to bintray and jcenter.
In my testing app, this library is added as a module:
implementation project(':dropdownview')
And everything wells well.
After the library module is uploaded to jcenter, I used this instead:
implementation 'com.asksira.android:dropdownview:0.9.1
Then a runtime error occurs when the library tries to call a method that depends on another library:
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.transitionseverywhere.TransitionSet" on path: DexPathList[[zip file "/data/app/com.asksira.dropdownviewdemo-6fj-Q2LdwKQcRAnZHd2jlw==/base.apk"],nativeLibraryDirectories=[/data/app/com.asksira.dropdownviewdemo-6fj-Q2LdwKQcRAnZHd2jlw==/lib/arm64, /system/lib64, /system/vendor/lib64]]
(I was following this guide to publish libraries. I published 3 libraries before using the same method already, they all worked perfectly; but this is the first time I included another 3rd party library dependency in my own library.)
compile vs implementation
And then I tried to change my 3rd party library dependency of my library from
implementation 'com.andkulikov:transitionseverywhere:1.7.9'
to
compile 'com.andkulikov:transitionseverywhere:1.7.9'
(Note that this is NOT the dependency of app to my library, but my library to another library)
And upload again to bintray with version 0.9.2.
implementation 'com.asksira.android:dropdownview:0.9.2
This time it WORKED?!
My Question
Is this some kind of bug of Android Studio / Gradle (But Google is saying that they are going to remove compile
by the end of 2018...), or have I done anything wrong?
The full source code of v0.9.1 can be found here.
Note that I didn't access any methods directly from app
to TransitionsEverywhere
. Specifically, ClassNotFoundException
occurs when I tap on the DropDownView
, and DropDownView
calls expand()
which is a public
internal method.
More info
To eliminate other factors, below are things that I have tried before changing implementation
to compile
, all no luck:
- Clean and Re-build
- Uninstall app + clean and re-build
- Make the Application a MultiDexApplication
- Instant run has already been disabled