Problem with ofAndroid on OSX

hello,

i installed the ADT, edited the make file, imported every libary in the right order… but I got errors when I build openFrameworks.

make: *** [all] Error 2 openFrameworks C/C++ Problem
make[1]: *** [Debug] Error 2 openFrameworks C/C++ Problem
make[2]: *** […/…/…/libs/openFrameworksCompiled/lib/android/obj/armv7/Debug/libs/openFrameworks/3d/of3dPrimitives.o] Error 127 openFrameworks C/C++ Problem

what I can see is that there missing the of3dPrimitives.o file. how can I fix this problem.

regards

i remember that error, i encountered it too when setting up the environment. I can’t really recall what it was though, can you post the whole console log and the problem section as well?

ok, here is the console output

**** Build of configuration Android for project openFrameworks ****

make -C …/openFrameworksCompiled/project all PLATFORM_OS=Android
Compiling …/…/…/libs/openFrameworks/3d/of3dPrimitives.cpp
/android-ndk-r9b//toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86/bin/arm-linux-androideabi-g++ -g3 -Wall -nostdlib --sysroot=/android-ndk-r9b//platforms/android-14/arch-arm/ -fno-short-enums -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -DANDROID -I"/android-ndk-r9b//platforms/android-14/arch-arm/usr/include/" -I"/android-ndk-r9b//sources/cxx-stl/gnu-libstdc++/include" -I"/android-ndk-r9b//sources/cxx-stl/gnu-libstdc++/4.7/include" -I"/android-ndk-r9b//sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include" -I"/android-ndk-r9b//sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include" -I"/android-ndk-r9b//sources/crystax/include/" -I"…/…/…/libs/glu/include_android" -I"…/…/…/addons/ofxAndroid/src" -I…/…/…/libs/FreeImage/include -I…/…/…/libs/freetype/include -I…/…/…/libs/freetype/include/freetype2 -I…/…/…/libs/freetype/include/freetype2/freetype -I…/…/…/libs/freetype/include/freetype2/freetype/config -I…/…/…/libs/freetype/include/freetype2/freetype/internal -I…/…/…/libs/freetype/include/freetype2/freetype/internal/services -I…/…/…/libs/glfw/include -I…/…/…/libs/glfw/include/GLFW -I…/…/…/libs/openssl/include -I…/…/…/libs/openssl/include/openssl -I…/…/…/libs/poco/include -I…/…/…/libs/tess2/include -I…/…/…/libs/openFrameworks -I…/…/…/libs/openFrameworks/3d -I…/…/…/libs/openFrameworks/app -I…/…/…/libs/openFrameworks/communication -I…/…/…/libs/openFrameworks/events -I…/…/…/libs/openFrameworks/gl -I…/…/…/libs/openFrameworks/graphics -I…/…/…/libs/openFrameworks/math -I…/…/…/libs/openFrameworks/sound -I…/…/…/libs/openFrameworks/types -I…/…/…/libs/openFrameworks/utils -I…/…/…/libs/openFrameworks/video -DDEBUG -MMD -MP -MF …/…/…/libs/openFrameworksCompiled/lib/android/obj/armv7/Debug/libs/openFrameworks/3d/of3dPrimitives.d -MT…/…/…/libs/openFrameworksCompiled/lib/android/obj/armv7/Debug/libs/openFrameworks/3d/of3dPrimitives.o -o …/…/…/libs/openFrameworksCompiled/lib/android/obj/armv7/Debug/libs/openFrameworks/3d/of3dPrimitives.o -c …/…/…/libs/openFrameworks/3d/of3dPrimitives.cpp
/bin/sh: /android-ndk-r9b//toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86/bin/arm-linux-androideabi-g++: No such file or directory
make[2]: *** […/…/…/libs/openFrameworksCompiled/lib/android/obj/armv7/Debug/libs/openFrameworks/3d/of3dPrimitives.o] Error 127
make[1]: *** [Debug] Error 2
make: *** [all] Error 2

**** Build Finished ****

end the errors

Description Resource Path Location Type
make[2]: *** […/…/…/libs/openFrameworksCompiled/lib/android/obj/armv7/Debug/libs/openFrameworks/3d/of3dPrimitives.o] Error 127 openFrameworks C/C++ Problem
make[1]: *** [Debug] Error 2 openFrameworks C/C++ Problem
make: *** [all] Error 2 openFrameworks C/C++ Problem

and one warning
Description Resource Path Location Type
Invalid project path: Duplicate path entries found (/openFrameworks [Output path]), path: [/openFrameworks]. openFrameworks pathentry Path Entry Problem

maybe it helps…

this is the problem

/bin/sh: /android-ndk-r9b//toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86/bin/arm-linux-androideabi-g++: No such file or directory

the makefile can’t find the compiler, check your paths and your sdk installation!

oh thanks, I have only /bin/sh: /android-ndk-r9b//toolchains/arm-linux-androideabi-4.6 or 4.8 in this path. how can I change this?

regards

you are using ndk r9b which is not supported in OF 0.8 unless you do a small change. it is explained in the setup instructions:

http://www.openframeworks.cc/setup/android-eclipse/

ok, I should read carefully, sorry and thanxs, everything is fine now

Hello everyone!

I’ve encountered the same problem today, and I’ve noticed that the search path for the compiler is incorrect;

the error log says:
/toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86/bin/arm-linux-androideabi-g++

but that folder is named “darwin-x86_64”, instead!
just rename that folder to “darwin-86” (deleting the “_64”) and everything works!

have a nice day!! :wink:

This thread FINALLY answered a a big question for me: what the hell is Error 2 & Error 127! It was obviously wrong name of directory, this time :

/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86/bin/arm-linux-androideabi-g++

but instead was supposed to be linux-i686

It’s compiling well, I’m about to change target version from 4.4 (newest one) to some previous to try it out on my phone…

you don’t need to change the target version it should be compatible with 2.2 or later like it is

Thanks for the help! I’m compiling now on Mavericks with NDK r9b.

Regarding the darwin-x86 vs darwin-x86_64 naming convention, I found that there is no need to change the directory name in the Android NDK.

Just do a global find/replace for “HOST_PLATFORM = darwin-x86” and change to “HOST_PLATFORM = darwin-x86_64”. (effectively adding the “_64” to HOST_PLATFORM env variable)

I only had to change 2 occurrences across 2 make files.

Same change here.

OSX.6.8
ndk r9b

In the config.android.default.mk file
I change “HOST_PLATFORM = darwin-x86” to “HOST_PLATFORM = darwin-x86_64”
and everything is fine.

OF on the android, I’m so excited :wink:

I got the same problem:
/bin/sh: /toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86/bin/arm-linux-androideabi-g++: No such file or directory
and i tried renaming the folder, didnt work, still got the same error. I change the GCC_VERSION to i migth add. Anyone got any ideas ?

I also have this problem. The error that pops up when I try to compile the android empty example
Program “/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++” not found in PATH . I don’t know why it’s trying to find linux-x86_64 given that I followed all the instructions for osx (i’m running 10.10.4) I found that folder and changed the name from “darwin-x86_64” to “linux-x86_64,” but it had no effect. I know this is an old thread, but any thoughts about this would be super helpful.