Problem building The demo app



I just tried to build the Demo application for Android with the latest Juce tip and I got the following error:

[exec] Compile++ thumb  : juce_jni <= ApplicationStartup.cpp
     [exec] Compile++ thumb  : juce_jni <= MainDemoWindow.cpp
     [exec] Compile++ thumb  : juce_jni <= JuceLibraryCode4.cpp
     [exec] Prebuilt       : libstdc++.a <= <NDK>/sources/cxx-stl/gnu-libstdc++/libs/armeabi/
     [exec] SharedLibrary  :
     [exec] /Users/michaelh/Code/juce/extras/JuceDemo/Builds/Android/obj/local/armeabi/objs/juce_jni/../../../Source/demos/InterprocessCommsDemo..o:([vtable for InterprocessCommsDemo::DemoInterprocessConnection]+0x34): undefined reference to `non-virtual thunk to juce::InterprocessConnection::handleMessage(juce::Message const&)'
     [exec] collect2: ld returned 1 exit status
     [exec] make: *** [/Users/michaelh/Code/juce/extras/JuceDemo/Builds/Android/obj/local/armeabi/] Error 1

Can somebody point me in the right direction to solve this error?
I’m building this on Snow Leopard, with a recent Android SDK and NDK r5b.



edit: mention that this is on Juce tip


Hmm. Haven’t seen that one before, and the tip builds for me, using the same setup.

A non-virtual-thunk problem usually means there’s an optimisation mismatch between some of your compiled modules. Did you try cleaning it and running ant again? Is this with “ant debug” from the command line?


After deleting the Android folder and regenerating the project with IntroJucer the project builds.
First I ran ‘ant clean’ before building with ‘ant release’ but that didn’t solve the problem…

Thank you for your quick response!


Ok… I just managed to reproduce the thunk problem, by running “ant clean”.

So it looks like “ant clean” doesn’t work properly, and I suspect it’s probably doing something stupid and actually causing the problem. Try just deleting the obj directory to clean it, and it should work. (I actually use a shell script to clean my intermediate files, so didn’t realise this was broken).


Hi Jules,

first of all i want to say you are doing really a fantastic job!

But i need some help to get the Juce Demo running on the Android simulator (on my Mac).
I installed eclipse, the andoid sdk and ndk and the actual Juce sources.
Then i recreated the Build/Android directory with the introjucer ( with modified the sdk pathes appropriate to my environment).
In eclipse i created a new android project from existing source, filled in the project name , chose build target android 2.3.
In the package explorer i selected the build.xml entry and right clicked “Run as …” -> “Ant build”. This compiled the library.
After this i tried to start the Project “JuceAppActivity” by right clicking “Run as …” -> “Android application”.
This uploads “JuceAppActivity.apk” to the simulator but crashes on startup.
The debugger complains

It seems that I have missed something.
Is my description sufficient to provide me with a hint?
Best regards


I’ve sometimes found it necessary to do a ‘clean’ to force it to actually build the package (even the first time you run it), so that’s worth trying. You don’t seem to have pasted the entire error message though - what does it say is actually wrong with ?


Not so easy for me to get familiar with eclipse.
But meanwhile I found out that the shared library is not found, This happens in at line 56


with a ClassNotFoundException.
The JuceAppActivity.apk has about 2,36 Mb, so the library should be part of the package.
One thing during compiling the library with ant v1.8.2 is a message

[quote]Invalid attribute name:


ok… I’m afraid my eclipse skills are quite limited, that doesn’t ring any bells for me…



I think that the “Invalid attribute name: package” message is a red-herring. I also get this message and I think it is because Introjucer is creating the AndroidManifest.xml file with a line break in the manifest tag. If you remove the line break, the message goes away.

With or without this doesn’t seem to effect any of my builds which (most of the time) are working ok!

As nobody else has asked, you are using the latest git source of Juce (1.53) aren’t you and not 1.52???




Thank you for clarifying. The message has gone.

The Introjucer reports 1.53.87
In Eclipse I’m using ant-1.8.2 as Runtime Environment.
Target system is Android 2.3
Any recommendations for the emulator?



Not really, I just create a basic 2.3 emulator image with no special settings.

Here is my setup:

OS X 10.6.7
Eclipse 3.7.0 using built-in ant 1.8.2 (I had problems with Eclipse 3.6.2)
Juce latest git (1.53.87)

I (loosely) followed the standard installation guide at

Sorry I can’t really help much further as I am a bit of an Eclipse newbie as well :slight_smile:




Currently I try to use Eclipse 3.7.0 but i could not install the android sdk (produces an error during download)
But I will work oon that issue.
Best regards


Interestingly, the latest tip of Juce seems to have broken Android (unless I have done something else wrong!)

When I build and deploy the Juce Demo, it instantly force closes…

I will attempt to debug and let you know what (if anything) I find.




After dowloading the M6 build of Eclipse 3.7.0 i could install all Updates for Eclipse and ADT.
So far, so good, but deploying JuceDemo still not works.
What I saw is that in the when building the project there is no subdirectory in Builds/Android/src, so the link could not be made. The build resulted in a 19k JuceAppActivity.apk.
After creating Builds/Android/src/com, runnung a build process and recreating the Android project, the appropriate Source files are listed, and the apk has about 2.3 Mb.
The most annoying thing after this step the debugger could not connect to the emulator anymore and the session could not be established.

Best regards


Ah, the joys of android development… I’ve been busy on other stuff recently, and haven’t done an android build for a while, but will check it again today.


Absolutely. I can’t believe how inconsistent the build environment is. Perhaps because I am used to Visual Studio and XCode but Eclipse+Android seems to just randomly “not work”! Sometimes I found that I would need to delete the contents of the Build directory and start again with Introjucer but at the moment I can’t get anything to work :frowning:




Sorry, I had managed to break it in the last check-in - should be ok now.


I have built the demo app for Android from a mac os x host and run it on a target … pretty cool.

I am having the following problem building the same demo app from linux and windows platform:

ant debug
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk/lib/tools.jar
Buildfile: build.xml

/media/Shared_FS/Ubuntu/Work/juce/downloaded_juicer/extras/JuceDemo/Builds/Android/build.xml:12: taskdef class cannot be found

Total time: 0 seconds

The local properties file contains the correct path information:


Thanks for any Ant/environment pointers.