Building JuceDemo with Android Studio


#1

I've attempted to build JuceDemo with Android Studio, as its the tool I've been using for Android development. 

I imported the Eclipse project into a folder alongside the Android build folder. 

I then had to add the ndk path to the local.properties file. 

I was getting the following error:

java.lang.UnsatisfiedLinkError: Native method not found: com.juce.jucedemo.JuceDemoActivity.resumeApp:()V
            at com.juce.jucedemo.JuceDemoActivity.resumeApp(Native Method)
            at com.juce.jucedemo.JuceDemoActivity.onResume(JuceDemoActivity.java:102)

which tells me it cant find find the native source.. realising that the project structure is quite different and it nests the 'jni' folder deep inside the project... 3 folders deeper as I can see. So I adjusted the the Android.mk file so it can find them, but still get the same error on running. 

I'm giving up for now and gonna use the command line or Eclipse. 
Would be nice to have generated Gradle-compatible Android Studio builds alongside Eclipse, as an option in IntroJucer. 


#2

I just got a build working on my 2nd attempt, via ant (had to do "ant clean debug" to get rid of Eclipse files) 

and I must say I'm really impressed... the whole Juce Demo running on my ageing HTC Desire.. !


#3

Cool! Well done peeps!

Last time I looked (quite recently) Android Studio wasn't able to build Native apps.

PC or Mac? Anything othr changes to AS (apart of what's mentioned above)?


#4

Sorry - should have been more clear - I didnt get it working, ended up using the command line tools which, actually worked great - I only had to run "ant clean debug" to get rid of any Eclipse files for it to work. 

Found some info at https://groups.google.com/forum/#!msg/adt-dev/nQobKd2Gl_8/Z5yWAvCh4h4J - looks like you'd need to compile into seperate .so files and include them in the project to get a build going in Android Studio. 

I'm on Mac btw.  


#5

It does work. Please check this new post here:

http://www.juce.com/forum/topic/juce-demo-using-android-studio-solved