froger_mcs froger_mcs - 1 year ago 148
Android Question

Mixing android plugins from gradle and gradle-experimental

Is there any way or workarounds or just hints to make plugins from gradle and gradle-experimental working together?

For example to mix those two versions:

I have an existing project which uses some external plugins (

apply plugin: ''
apply plugin: ''
apply plugin: 'com.jakewharton.hugo'

in my root
I have:

Issues which I have:

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id '']
> java.lang.NullPointerException (no error message)


* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.jakewharton.hugo']
> 'android' or 'android-library' plugin required.

Without other plugins my project works fine (I have Android Library with some NDK code which is called from my main project. Problem occurs when I add mentioned plugins on any others.

And the question is - is it a gradle-experimental issue or issue of each plugin (hugo, databinding, apt, probably much more).

Or maybe you have any hints if there is any other way to have app with current stable gradle plugin and library (with NDK code) which uses gradle-experimental?

What I want to avoid is a dealing with *.mk files and (as full as possible) Android Studio support. Bigger picture is to prepare .aar library with NDK code (just simple computation) which will be able to plug in to existing projects.

Answer Source

I've been able to mix gradle stable and -experimental android plugins without any issues by using recent versions in my project.

You should be able to define both dependencies inside your project's build.gradle file:

dependencies {
    classpath ''
    classpath ''

and then either use apply|library) or|library) from your various module's build.gradle files.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download