Determining if recursive Gradle references need to be added to the apk


(Matt Robertson) #1

I’m working on adding Dropbox support to my Android app, which is quickly becoming an adventure in Package Reference land. Using GradleReferences (which are a fantastic feature) I added the dropbox-core-sdk library. Everything compiled fine, but at runtime I got a ClassNotFoundException (CNF) on a class in okhttp library, which is used by the dropbox library. I added this reference manually and got a CNF on okio, which is used by okhttp. Then I got a CNF on kotlin-stdlib, which is used by okio. I added this and got a CNF jackson-core, which is also used by Dropbox.

At the moment everything seems to be working in my project, but it is a huge headache to manually track down and add all of the recursive dependencies for a large library like the Dropbox API, which has about a 32k method count. Is there any way that EBuild could detect which jars/classes need to be copy-localed into the apk?

(marc hoffman) #2

Hmm. CopyLocal should propagate down into indirect package references. Do you have copyLocal set on the dropbox-core-sdk reference?

(marc hoffman) #3

Actually, oops, turns out that did not happen (I must ave fixed that for NuGet packages, a while back, but not for Gradle. fixed now — I can send you a new build later today (you work on Mac or Windows?).

(Matt Robertson) #4

That would be great - I work on Windows. Thanks!

(marc hoffman) #5

New build is up; please let me know if all gets packaged up correctly now even without you adding the indirect dependencies directly. thanx!

(Matt Robertson) #6

Working great, thanks!

(marc hoffman) #7

Glad to hear!