OF_android : gradle sync failed : unknow property assembleDebug

Hi :smile:
I try the androidImageExample but gradle fail to sync :confused:
I use the gradle plugin version 2.2.0 and Ndk 13.0. and OF 0.9.3.

When trying to sync, I have this error :
Error:(58, 0) Could not get unknown property ‘assembleDebug’ for root project ‘androidImageExample’ of type org.gradle.api.Project.
Open File
for the line : assembleDebug.dependsOn(":openFrameworksProject:compileDebugOF") in the build.gradle file from the project.

But when I follow the path, I find the task compileDebugOF in the build.gradle file from /libs/openFrameworksCompiled/project/android.
So I don’t understand why gradle doesn’t found the task…
And there was no error for the clean.dependsOn(":openFrameworksProject:clean") line above assembleDebug.dependsOn(":openFrameworksProject:compileDebugOF") :confused:

Thanks for helping me :slight_smile:

Ok, I don’t know what was the problem, but I tried with OF version 0.9.4 and it works :slight_smile:
Sorry for annoying you :slight_smile:

I have the same problem described in first post with OF 0.9.5.


I’m hitting this with 0.9.6

unfortunately have same problem with 9.4!!!

I also hit same problem before (using OF 0.9.8) when I changed the android gradle plugin from 1.3.1 (this is default from AndroidEmptyExample) to 2.2.2. I think its more because there are something change in Android plugin 2.2.2 (not sure though)…

Anyway, I can run the androidEmptyExample project by using the gradle 2.2.1 (as explained in https://developer.android.com/studio/releases/gradle-plugin.html) and android gradle plugin version 1.3.1 (the default one)

[SOLVED] Gradle 2.2.2 requires update in build.gradle

I had the same problem with OF 0.9.8 + Gradle 2.2.2 update.
Gradle 2.2.2 requires an update to the project’s build.gradle file.

build.gradle: current doesn’t work with Gradle 2.2.2


build.gradle: updated for 2.2.2

afterEvaluate {



I was having this issue still with the afterEvaluate fix in and I managed to work around it by commenting out the


When building and running on the device straight from Android Studio. I figured it out from this thread where they were talking about being able to build the apk and install but not run it directly in debug mode below and I’m not Android savvy enough to really know whats going on, but just to save anyone some pain.


Just in case someone need it. For latest Gradle replace those lines:


with this:

tasks.whenTaskAdded { task ->
    if (task.name == 'assembleDebug') {
        task.dependsOn ':openFrameworksProject:compileDebugOF'

tasks.whenTaskAdded { task ->
    if (task.name == 'assembleDebug') {
        task.dependsOn ':openFrameworksProject:compileReleaseOF'
1 Like

Thanks, that helped me

Shouldn’t the second condition be (task.name == ‘assembleRelease’) ?
I would appreciate your confirm.

Yeah, of course it should. Just a victim of copy-paste :slight_smile:

1 Like

The other option here.

oF 0.9.8 is designed for Android Plugin for Gradle 1.3.1 (see yourProject/build.gradle)
We can not change this version number otherwise we should change all gradle syntax like many comments above. (e.g. assembleDebug)
To use this plugin, we need Gradle version 2.2.1 - 2.9.
(Yes, Android Plugin for Gradle and Gradle is different stuff.)
But if we open Android Studio it try to update Gradle to latest version like 3.3 (this is stored in yourProject/gradle folder).

You can fix this by changing distributionUrl to 2.2.1 (at yourProject/gradle/wrapper/gradle-wrapper.properties)


Tested on OSX, Android Studio 2.3.3, of_v0.9.8_android_release