Hi Suraj,
When there are multiple flavors for the library, the plugin do not know
which flavor to publish.
One way to solve it is to set the default publish config in your library.
E.g.
model {
android {
defaultPublishConfig = "allRelease"
}
}
However, this will cause the app project to depend on the library with all
the native libraries. This is what I would recommend if it's OK with you.
You can also publish the non-default variants and manually setup the
dependencies for each flavor. For details, check
out
http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Library-Publication.
There is currently no simple way to set up variant aware dependencies.
It's on the roadmap, but it's not available at the moment.
Raymond
On Tuesday, October 20, 2015 at 9:36:40 PM UTC-7, Suraj Barkale wrote:
>
> Hi Thasso,
>
> Removing configuration gives me compile errors:
> hello-jniaar (jniaar)> ./gradlew clean build
> :app:clean
> :libraries:hello-aar:clean UP-TO-DATE
> :app:preBuild UP-TO-DATE
> :app:preDebugBuild UP-TO-DATE
> :app:checkDebugManifest
> :app:prepareDebugDependencies
> :app:compileDebugAidl
> :app:compileDebugRenderscript
> :app:generateDebugBuildConfig
> :app:generateDebugAssets UP-TO-DATE
> :app:mergeDebugAssets
> :app:generateDebugResValues UP-TO-DATE
> :app:generateDebugResources
> :app:mergeDebugResources
> :app:processDebugManifest
> :app:processDebugResources
> :app:generateDebugSources
> :app:processDebugJavaRes UP-TO-DATE
> :app:compileDebugJavaWithJavac
> android-ndk/hello-jniaar/app/src/main/java/com/example/hellojniapp/HelloJniApp.java:21:
>
> error: package com.example.hellojniaar does not exist
> import com.example.hellojniaar.HelloJniLib;
> ^
> android-ndk/hello-jniaar/app/src/main/java/com/example/hellojniapp/HelloJniApp.java:36:
>
> error: cannot find symbol
> HelloJniLib lib = new HelloJniLib();
> ^
> symbol: class HelloJniLib
> location: class HelloJniApp
> android-ndk/hello-jniaar/app/src/main/java/com/example/hellojniapp/HelloJniApp.java:36:
>
> error: cannot find symbol
> HelloJniLib lib = new HelloJniLib();
> ^
> symbol: class HelloJniLib
> location: class HelloJniApp
> 3 errors
> :app:compileDebugJavaWithJavac FAILED
>
> FAILURE: Build failed with an exception.
>
> * What went wrong:
> Execution failed for task ':app:compileDebugJavaWithJavac'.
> > Compilation failed; see the compiler error output for details.
>
> * Try:
> Run with --stacktrace option to get the stack trace. Run with --info or
> --debug option to get more log output.
>
> BUILD FAILED
>
> Total time: 10.501 secs
>
> Your suggestion only works if there are no flavours in the library project.
>
> Thanks & Regards,
> Suraj
>
> On Tuesday, October 20, 2015 at 8:25:15 PM UTC+11, Thasso Griebel wrote:
>>
>> Hi Suraj,
>>
>> do not depend on a specific configuration but just on the project:
>>
>> compile project(path: ':libraries:hello-aar')
>>
>> Hope it helps,
>> -Thasso
>>
>> On Friday, October 16, 2015 at 6:46:49 AM UTC+2, Suraj Barkale wrote:
>>>
>>> Hi,
>>>
>>> I am unable to link with a library project using gradle-experimental
>>> plugin if that library uses flavors. I have uploaded example code here:
>>> https://github.com/surajbarkale-dolby/android-ndk/tree/jniaar/hello-jniaar
>>> This appears to be broken even in 0.3.0-alpha7. Most probably I am missing
>>> something very obvious. Can someone please help me in getting this project
>>> to compile?
>>>
>>> Thanks & Regards,
>>> Suraj
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.