Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Android / Any Expert with Android make files?

Author
Message
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 23rd Nov 2011 09:17
As soon as I am adding FMOD to my Android.mk, my app is crashing.

These are the extra lines I am adding to the android.mk file supplied with android_template:

LOCAL_MODULE := fmodex
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libfmodex.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../common/include
include $(PREBUILT_SHARED_LIBRARY)

LOCAL_SHARED_LIBRARIES := fmodex



Any idea what I am doing wrong, as I spent 2 days testing & researching without success
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 23rd Nov 2011 19:24
I've not tried it with a prebuilt shared library, it's possible the library is not being uploaded to the device. Is there a static alternative?
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 23rd Nov 2011 21:43
unfortunately no, they only supply that one shared library

Do you think I should give up and stop wasting my time, or maybe there's a small hope for a solution?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 23rd Nov 2011 23:23
In your Application.mk there should be an APP_MODULES line, try adding fmodex to it (separated by spaces), which should move it to the libs folder, then hopefully eclipse will pick it up and put it in the apk. If not you can add it, should look something like this

APP_MODULES := android_player fmodex
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 24th Nov 2011 07:10 Edited at: 24th Nov 2011 07:11
Will check it out. Thanks for the interest and help.

Paul, on a totally different subject, check out this guide...

Do you think this can be implemented and make the recompiling process more transparent for users?

http://mobilepearls.com/labs/ndk-builder-in-eclipse/
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 24th Nov 2011 18:10
Quote: "Do you think this can be implemented and make the recompiling process more transparent for users?"


The settings suggest that eclipse must be able to run the ndk-build script without going through cygwin, which normally I would say isn't possible. However I did notice that v7 of the NDK introduced a bat file for compiling on Windows without needing cygwin, I've not tried v7 yet so I don't know if it is any good or if it would work with this method, but it's possible.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 24th Nov 2011 20:16 Edited at: 24th Nov 2011 20:17
And we are using the r7 of the ndk right, as that was the latest one in the download section
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 24th Nov 2011 20:36
Tried this

APP_MODULES := android_player fmodex

But it still crashes.

This is the ndk-build compile output. Seems like the libs are installing.



What does exactly the 2> parameter in ndk-build do?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 24th Nov 2011 21:33
Quote: "And we are using the r7 of the ndk right"


I'm using 6b, if anything v7 should be better with this sort of issue.

Quote: "What does exactly the 2> parameter in ndk-build do?"


It pipes the stderr output into a file instead of flooding the console window, so that the window just gets stdout.

Quote: "This is the ndk-build compile output. Seems like the libs are installing."


Everything looks in order. Where did you get the libfmodex.so lib from, is it compiled for armeabi?
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 24th Nov 2011 22:47
Got the libfmodex.so from the fmod api & examples.
yes it is compiled for armeabi & armeabi-v7a respectively
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 25th Nov 2011 12:11
I tried this, and it works great!

Every time I edit my template.cpp in Eclipse and save it, it automatically gets recompiled, without having to go in Cygwin! I think it's worth extending the Android guide to include this as an optional commodity!

http://mobilepearls.com/labs/ndk-builder-in-eclipse/
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 25th Nov 2011 13:16
It seems that Android does not automatically load dynamic libraries at runtime, so one has to do this manually in the correct dependency order, in Java.

The Fmod examples use this Java code, which I think I need to somehow integrate instead of the DUMMY class in agk.



How can I do this successfully?

All FMOD examples have a static section in Java that loads the lib. One must subsclass native activity just so you can hook some static code to load the libs before the native activity is launched.

I have absolutely no experience with Android and this is driving me crazy! I managed to implement fmod playback in Windows and iOS without any problem!!!

Login to post a reply

Server time is: 2024-04-20 09:45:57
Your offset time is: 2024-04-20 09:45:57