project dependencies using experimental gradle plugin

150 views
Skip to first unread message

Scott Dixon

unread,
Oct 1, 2015, 1:06:50 PM10/1/15
to android-ndk
I'm building a library project with native code using the experimental toolchain. When I add an app and/or test module and set a dependency on my library project...

apply plugin: 'com.android.model.application'

...

dependencies
{

    compile project
(':myLibraryProject')
    compile fileTree
(dir: 'libs', include: ['*.jar'])
    testCompile
'junit:junit:4.12'
}


it doesn't seem to work. That is, the application/test project does not see any of the Java symbols (Since it doesn't build the java side I don't know if it picks up the .so from the .aar).

  1. Is this a known issue?
  2. If so any idea when it will be fixed (i.e. is there a bug open against it)?
  3. If not, what am I missing? This works fine using the current gradle plugin.
Any advice would be greatly appreciated!

Alex Cohn

unread,
Oct 6, 2015, 12:38:04 PM10/6/15
to android-ndk
In my experience, dependency on Java library module works fine with 'com.android.tools.build:gradle-experimental:0.2.0', but there is still no easy way to get the .so from the library AAR.

Alex

Anil Mamede

unread,
Oct 11, 2015, 8:17:17 PM10/11/15
to android-ndk

I resolved the same issue. Ensure that myLibraryProject is declared as library and not application:

myLibraryProject/build.gradle:



apply plugin
: 'com.android.model.library'

...

Anil Mamede

unread,
Oct 11, 2015, 8:17:17 PM10/11/15
to android-ndk

I'm facing the same issue:

On app/build.gradle the dependencies is:

dependencies {
    compile project
(':sonacomponents')
    compile
'com.android.support:support-v4:+'
}

But when running gradlew build app submodule is build first than sonacomponents. With the current gradle plugin it builds with the correct order.



On Thursday, October 1, 2015 at 6:06:50 PM UTC+1, Scott Dixon wrote:
Reply all
Reply to author
Forward
0 new messages