Building JuceDemo on Android fails




I've just checked out Juce's master branch from Git and I've been encountering a lot of issues so far when trying to build JuceDemo.

So after setting up the correct paths for the Android SDK and NDK (and having saved it) I import the project as an Android project in my Eclipse and...

Error in JuceDemo::onCreate! There's an import missing for Ok easy enough.


Then I try to run the build.xml and it seems there's a bug in the way the sdk.dir variable is resolved. See below:

Buildfile: C:\Users\Tbop\Documents\JUCE-master\extras\JuceDemo\Builds\Android\build.xml
C:\Users\Tbop\Documents\JUCE-master\extras\JuceDemo\Builds\Android\build.xml:30: Cannot find C:\Users\Tbop\Documents\JUCE-master\extras\JuceDemo\Builds\Android\Program FilesAndroidadt-bundle-windo
ws-x86_64-20130729sdk\tools\ant\build.xml imported from C:\Users\Tbop\Documents\JUCE-master\extras\JuceDemo\Builds\Android\build.xml
Total time: 0 seconds

Odd path right? Well I've tried the hardcoded way and set the line build.xml:30 to the correct path. But then I've got another issue and this one remains unresolvable so far... Any idea?

Buildfile: C:\Users\Tbop\Documents\JUCE-master\extras\JuceDemo\Builds\Android\build.xml
  [taskdef] Could not load definitions from resource It could not be found.
  [taskdef] Could not load definitions from resource It could not be found.
C:\Program Files\Android\adt-bundle-windows-x86_64-20130729\sdk\tools\ant\build.xml:392: Problem: failed to create task or type checkenv
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

Total time: 0 seconds

Haven't seen any of these issues myself, but I've never been crazy enough to attempt to build Android stuff on Windows..


Your java error is a bit puzzling though.. Don't understand how that could behave differently for you (?)

I'm going to try on my mac then.

Well the import is definitely missing so I don't understand how could that work for everyone without?

um... I just had a look in the java file, and the import is right there.


Like I've said a million times, can everyone please check that you're using the latest code before reporting problems!

Uh? Actually you're right I can find it by browsing on the online repository but I don't get it then. Just downloaded the repository as a zip file about 4 hours ago.
Beforehand I had downloaded the latest release and the bug was definitely there (the reason why I downloaded the master branch instead).

Perhaps a problem of caching with eclipse. In fact, I had weird issues with it recently when opening similar projects twice in a row.


Sorry about that, what about the ant script error? About to redo the same on my mac to see if I can reproduce it but perhaps is something we should investigate as well later on.

I'll try to see what I can do with this:

You're not still using the defunct sourceforge repo are you?

No no I'm using the correct one. I think something went wrong at one point with eclipse and that the former version I had opened before updating to the latest build was still cached in eclipse only, somehow


The mac version seems to work properly at least, should be enough for what I want to do for now anywaz. Cheers!

not sure if this is the same phenomenon, but I got android juce stuff to build on Windows only by getting rid of the relative include paths in juce module includes.  Seems to be due to a path length limitation in the NDK tools for Windows


for instance in JuceLibraryCode\modules\juce_core\juce_core.h  the following workaround was needed:

// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#if defined (JUCER_VS2012_78A501F)
 #include "../../../../../SDKs/juce/modules/juce_core/juce_core.h"
#elif defined (JUCER_ANDROID_7F0E4A25)
 #include "/dat/ws/altalogix/alxaudio/trunk/SDKs/juce/modules/juce_core/juce_core.h"
#elif defined (JUCER_XCODE_MAC_F6D2F4CF)
 #include "../../../../../SDKs/juce/modules/juce_core/juce_core.h"
#elif defined (JUCER_XCODE_IPHONE_5BC26AE3)
 #include "../../../../../SDKs/juce/modules/juce_core/juce_core.h"
 #error "This file is designed to be used in an Introjucer-generated project!"

no need to edit the .h files of course, you can do this simply by setting the LOCAL JUCE Folder to an absolute path in the introjucer for the Android build