More OF for Android build problems (both eclipse and android studio)

Hi everyone,

First, thanks in advance for any help.

I have been making OF apps for years on OSX but wanted to make one for android. I’m not sure exactly where to begin the question because I’ve tried so many things at this point, but I have spent a while trying to follow the steps for both the eclipse and andriod studio versions of setting up OF for android.

To start, I am on OSX 10.10.4 Yosemite. I tried to follow the instructions as closely as possible. However, a number of things seemed to be slightly different in the interfaces involved so a few things I had to do what seemed like the closest (perhaps here in lies the problem) so there might be some slight differences there.

When eclipse wasn’t working, I tried the andriod studio version which also didn’t work. I also tried to search the forum, google, issues on github, and a number of other things that did not seem to work. When I am on eclipse my errors look like this:

Description Resource Path Location Type
make: *** [all] Error 2 openFrameworks C/C++ Problem
make: *** [Release] Error 2 androidEmptyExample C/C++ Problem
make[1]: *** [Debug] Error 2 openFrameworks C/C++ Problem
make[1]: *** [Release] Error 2 androidEmptyExample C/C++ Problem
make[2]: *** [/Users/barragan/Documents/code/of_v0.9.0_android_release/libs/openFrameworksCompiled/lib/android/obj/armv7/Debug/libs/openFrameworks/3d/of3dPrimitives.o] Error 127 openFrameworks C/C++ Problem
make[2]: *** [/Users/barragan/Documents/code/of_v0.9.0_android_release/libs/openFrameworksCompiled/lib/android/obj/armv7/Debug/libs/openFrameworks/3d/of3dUtils.o] Error 127 openFrameworks C/C++ Problem
make[2]: *** [/Users/barragan/Documents/code/of_v0.9.0_android_release/libs/openFrameworksCompiled/lib/android/obj/armv7/Debug/libs/openFrameworks/3d/ofCamera.o] Error 127 openFrameworks C/C++ Problem
make[2]: *** [/Users/barragan/Documents/code/of_v0.9.0_android_release/libs/openFrameworksCompiled/lib/android/obj/armv7/Release/libs/openFrameworks/3d/of3dPrimitives.o] Error 127 androidEmptyExample C/C++ Problem
make[2]: *** [/Users/barragan/Documents/code/of_v0.9.0_android_release/libs/openFrameworksCompiled/lib/android/obj/armv7/Release/libs/openFrameworks/3d/of3dUtils.o] Error 127 androidEmptyExample C/C++ Problem
make[2]: *** [/Users/barragan/Documents/code/of_v0.9.0_android_release/libs/openFrameworksCompiled/lib/android/obj/armv7/Release/libs/openFrameworks/3d/ofCamera.o] Error 127 androidEmptyExample C/C++ Problem
make[2]: *** Waiting for unfinished jobs… androidEmptyExample C/C++ Problem
make[2]: *** Waiting for unfinished jobs… openFrameworks C/C++ Problem
Program “/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++” not found in PATH androidEmptyExample Project Properties, C++ Preprocessor Include…/Providers, [CDT GCC Built-in Compiler Settings] options C/C++ Scanner Discovery Problem

when I am on android studio my errors look like this:

Error:(146, 1) Execution failed for task ‘:ofAndroidLib:compileReleaseOF’.

make failed with exit status 2

More details:
I tried a number of fixes related to changing the name of the folder in the last eclipse error. For some reason it says linux-x86_64 but of course the folder in the toolchains directory says darwin-x86_64 because I downloaded the OSX version (ndk r10e). I also tried changing the make file to hardcode that name in. Neither worked. It did not remove errors but instead added more. I tried to search for the other errors but couldn’t find much info (on the error codes or fixes) searching around. I have also installed and pointed at many different versions of the SDK tools. Some cause more errors and some cause less. This is the least I could produce.

At some point, I gave up and tried to android studio. Forever, I couldn’t get the gradle sync to work. It said error code 2 for a long time. I found an issue logged on github that had a different approach to setting up android studio. Doing this:

https://github.com/openframeworks/ofSite/issues/315

at least got the gradle to sync. But then left me with the common error “Execution failed for task ‘:ofAndroidLib:compileReleaseOF’.” However, none of the fixes I could find made any difference for this. I tried different versions of android studio as well to no avail.

I’m really stuck and at this point am worried that I’ve tried to change so many things who knows what’s going on. I think my next step is to delete everything and try to start from scratch again. I’m hoping someone out there has a little info that could help me. Or at least direct me towards what I should look at to debug the errors. I think there’s not much info in the errors, but I could be looking at the wrong place. I looked at the logs but couldn’t human parse them into anything useful.

Any thoughts?

Thanks a million,
patrick

right when I had given up, I think I found a problem that was indeed likely due to me trying to fix too many things at once. I didn’t want anyone to waste their time of this before I verified. I think the suggestions about renaming the folders to respond to the error of not finding the compiler was right. I think the problem is to be careful not to change too many things at once. I went back through all the files that I could have changed and made sure everything was default again (I found one that wasn’t). Then I went back and removed the _64 from the darwin-x86 folder. The problem was the error was throwing me off thinking it was trying to find the linux-x86_64 folder (in the error output) where in the console output, it clearly says it’s looking for the folder darwin-x86 instead of -x86_64. The change seems to be working, and I’ll know in a couple of minutes. I’m really not sure why the error output would say something different than the console output, but it was. I hope this helps someone out there searching for it in the future. I’ll post back when I’m sure everything is working.

EDIT: Okay, so this post is to inform people who might run into something in the future. After all of this, something very odd that I don’t understand was the problem, but the fix wasn’t hard. It seems (again I don’t know why) that the output on “problems” tab in eclipse did not show the same information as what you can find on the “console” tab. So if you’re new to eclipse, make sure you read the console output because you can possibly get more information to debug that you are used to seeing (if you have done a lot of debugging before).

The console told me what the real problem was. However, over and over, the problems page showed me an error with the empty example that it could not find the linux-x86_64 folder in that path (which shouldn’t exist for the osx verison I downloaded [it’s darwin*]). However, even after I fixed the error and the console did not output any errors, the problems page still had that error. I was very perplexed. After multiple cleans and restarts of eclipse, that problem was always there. I had to manually delete it. And then when I rebuilt, it did not come back.

This leads me to believe (sorry if this is wrong or trivial. I know nearly nothing about eclipse) that for some reason, eclipse does not clear the problems when you rebuild. So I think for hours and hours, I was looking at a problem that would never go away not because my changes weren’t causing difference, but because it was never cleared. If anyone can explain why that happens, I (or some other person in the future) might love to know.

Thanks!

2 Likes

Hello @barragan. Thanks for your solution here.

I spend whole day and night because of this problem and I almost give up about this.
Exactly same as you, trying Eclipse and Android studio too, cleaning and install many times.
finally I could find your issue.

But I have still error here.(my issue)
Maybe I understand wrong way about this solution.(Actually my English is bad…)

So, what you mean is:

  • Change folder name “darwin-x86_64” to “darwin-x86”

Is this all?
Should I change system PATH and folder name both?(I add system path because Eclipse couldn’t find it)

Thank you for your kind and detail explanation.

Hi @eunsoossi,

So this was quite a while ago for me, so I can’t exactly remember all the steps I took. From rereading my post and trying to remember, I remember that I was trying 100 things at all once and getting different solutions garbled. I went back to a clean install and only changed one thing darwin-x86_64 -> darwin-x86 which is the folder I believe it was asking for. Then, in eclipse, I went and manually deleted the error related to linux-x8664 and recompiled and it worked. It was some funky thing which I still do not understand (maybe someone out there does) that it kept presenting the same error regardless of what I did, and I had to manually remove the error and suddenly it was gone forever. I found it very strange. I don’t know if that helps at all. I hope it does.

good luck!

1 Like

Thank you sooo much @barragan!!!

Deleting error message was important part in here! Finally it seems working now.
I spend almost whole 2 days because about this problem.
I never thought about deleting error message manually. How come it’s working?:confused:

Anyway thanks again.

Hey @eunsoossi,

Great to hear you solved the issue. Can you send the issue and the solution with a PR to the FAQ section of the Android Setup Guide?

Sure, I will.

By the way, what is PR?

PR: Pull Request on Github