Rebuilding java classes on android branch?


I need to make some modifications in CinderNativeActivity, Camera etc classes. I see they come within the libcinder-release.aar, libcinder-debug.aar archives, which are not rebuilt during regular cinder build.

What’s the easiest way to build these archives?




At current you need to open the Android Studio project that is here (will soon be moved to the proj/android/ folder as part of a larger reorganization of project files) and build using Android Studio’s gradle support.

I agree though, ideally we can find a way to run the gradle build from cmake. I did a bit of research around this and it seems feasible to run gradle with command line arguments as a post build step, it would require someone with a bit more knowledge of gradle than myself though, to do it correctly.


@rich.e At this point I am running the gradle builds from android/libcinder_java using

./gradlew assembleDebug
./gradlew assembleRelease

At first it was complaining about missing tools, but it was easy to put the right dependencies into the right places by looking at the gradlew errors.

This describes how to call external script from cmake.




I’m trying to rebuild the .aar libs, but it fails, did anything change?

Qs-MacBook-Pro:libcinder_java Q$ ./gradlew assembleDebug

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'libcinder_java'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not find org.libcinder.gradle:cinderappbuild:1.0.
     Searched in the following locations:
     Required by:


the problem was with the path in the build.gradle that was missing a level up

dirs "${projectDir}/../../../tools/android/CinderAppBuild/repo"

I also had to change the sdk and tool versions in app/build.gradle

android {
    compileSdkVersion 21
    buildToolsVersion "25.0.3"

    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"

now I’m getting a bunch of compile errors:

EDIT: I’ve commented out pretty much everything in the exampleapp, so now I can build libcinder-debug.aar and libcinder-release.aar, however it looks like the compiled libs are missing everything, the size is only 11K(cinder libs are 80K) also when I run the gradlew it always build both aar files no mater what assemble option I use.


I think I’ve figured it out, the problem was again a missing level-up in the paths in build.gradle. I’ll tidy up and make a PR

Looking for some guidance on how Android Apps are built

I think I’ve figured it out, the problem was again a missing level-up in the paths in build.gradle. I’ll tidy up and make a PR

Please do, thanks for tackling this!