I try the androidImageExample but gradle fail to sync
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")
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)…
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.
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. https://developer.android.com/studio/releases/gradle-plugin.html
(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)