I have an android library and want to distribute it like jar.
I create the demo project that shows how my library works and add gradle dependency from my library:
compile project(':my-library')
Then I build the project, it works fine. Than I take jar
file from my library (from build/intermediates/bundles/release - link), and put it to libs
directory and replace the dependency with this:
compile fileTree(dir: 'libs', include: ['*.jar'])
But I was very surprised because the demo app did not work. I tried to clean, make jar
more times, clear cache, test it on different Android versions from 4.0 till 6.0.1 but the same picture: it works if library is connected to sources, but does not work if library is connected like jar created from that sources.
My library is quite big, and I'm not sure what exactly goes wrong. In normal conditions it should load some javascript from server, run it and show some results in WebView, but in case of jar file I see only empty screen.
How is this possible?