0

Error building OS=android CPU=arm BINDINGS=cpp,java on OSX

asked 2014-07-23 17:55:06 -0700

jdelliot gravatar image

updated 2014-07-24 15:57:42 -0700

Following the pattern established in a prior thread ( https://ask.allseenalliance.org/question/855/error-building-osandroid-cpuarm-bindingscppjava-on-linux/ ), I endeavored to get AllJoyn for Android building on my Mac (OSX Mavericks 10.9.4). I run the following command from either the AllJoyn root folder or the alljoyn_java folder with the same results:

scons OS=android CPU=arm BINDINGS=cpp,java ANDROID_SDK=/Library/adt-bundle-mac-x86_64-20140702/sdk ANDROID_NDK=/usr/local/android-ndk-r9d ANDROID_SRC=~/repos/CDP/external/android-src

This same command line, ran on my Ubuntu machine (with appropriate path modifications) executes to completion successfully. On OSX, the build gets fairly far before failing, but eventually returns:

scons: *** [alljoyn_java/samples/android/chat/libs/armeabi/liballjoyn_java.so] Source `build/android/arm/debug/dist/java/lib/liballjoyn_java.so' not found, needed by target `alljoyn_java/samples/android/chat/libs/armeabi/liballjoyn_java.so'.

Any ideas on what might be going on?

re-edit

Thanks for the suggestions. I haven't tried commenting out the line that builds the samples, but I did try just building the target, by executing the following:

scons OS=android CPU=arm BINDINGS=cpp,java ANDROID_SDK=/Library/adt-bundle-mac-x86_64-20140702/sdk ANDROID_NDK=/usr/local/android-ndk-r9d ANDROID_SRC=~/repos/CDP/external/android-src build/android/arm/debug/dist/java/lib/liballjoyn_java.so

That results in the same error:

scons: Reading SConscript files ...
Building bindings: cpp, java
Building services: about
BULLSEYE_BIN not specified
GTEST_DIR not specified skipping common unit test build
BULLSEYE_BIN not specified
GTEST_DIR not specified skipping alljoyn_core unit test build

scons: warning: Ignoring missing SConscript 'alljoyn_core/win8_sdk/SConscript'
File "/Users/xxx/xxx/xxx/external/AllJoyn/alljoyn_core/SConscript", line 160, in <module>
scons: done reading SConscript files.
scons: Building targets ...
scons: *** Do not know how to make File target `build/android/arm/debug/dist/java/lib/liballjoyn_java.so' (/Users/xxx/xxx/xxx/external/AllJoyn/build/android/arm/debug/dist/java/lib/liballjoyn_java.so).  Stop.
scons: building terminated because of errors.

Not sure if excluding the samples will make any difference if the target itself won't build.

Any other ideas?

Thanks in advance, John

One more update:

I have now built with the samples excluded. Build succeeds, but does not build the library in question. Adding the samples back in after successfully building without, still fails in exactly the same manner.

edit retag flag offensive close merge delete

Comments

The scons scripts should not attempt to build the samples till liballjoyn_java.so file is built. The only suggestion I have would be to find the line in the scons script that builds the samples and comment out that line. See if the build completes when its skipping the Samples. Let me know what the result is.

georgen ( 2014-07-24 09:01:46 -0700 )edit

In addition you could try building just the library run same build command but tell it to only build liballjoyn_java.so do this by adding the line `build/android/arm/debug/dist/java/lib/liballjoyn_java.so` to the end of the scons command. This tells SCons to only build the specified file.

georgen ( 2014-07-24 09:05:29 -0700 )edit

Can you please update the original question with the scons command you are using?

bspencer ( 2014-07-24 13:47:36 -0700 )edit

Edited original question as requested.

jdelliot ( 2014-07-24 14:29:41 -0700 )edit

I have a hunch this is an issue with the Java build on Mac. I personally don't know anyone that is using a mac to build Android source. The SConscritps may be setup in such a way that they are not even building the file since you are using an untested build configuration. Since you are getting the ` Do not know how to make File target` this indicates that building android on mac does not even add liballjoyn_java.so to the list of files that should be built. This unfortunately means digging into the scons scripts and see if we can figure out whats not being called and why. Have you tried to build the liballjoyn_java for mac? If that works then at least we know Java is setup correctly and its most likely something else in the build script.

georgen ( 2014-07-24 14:42:45 -0700 )edit

3 answers

Sort by ยป oldest newest most voted
1

answered 2014-07-25 09:56:47 -0700

msanu gravatar image

An alternative approach is to keep the original alljoyn_java/samples/android/SConscript and not replace occurrences of liballjoyn_java.so but instead modify build_core/conf/android/SConscript with the patch below:

--- a/build_core/conf/android/SConscript
+++ b/build_core/conf/android/SConscript

Help(vars2.GenerateHelpText(env))

+# Override build settings when building on darwin.
+if 'darwin' == env.subst('$PLATFORM'):
+   env['SHLIBSUFFIX']    = '.so'

# Override MSVC build settings when building on windows.
edit flag offensive delete publish link more
0

answered 2014-07-24 11:54:47 -0700

jdelliot gravatar image

georgen,

Thanks for the suggestions. I haven't tried commenting out the line that builds the samples, but I did try just building the target:

scons: Reading SConscript files ...
Building bindings: cpp, java
Building services: about
BULLSEYE_BIN not specified
GTEST_DIR not specified skipping common unit test build
BULLSEYE_BIN not specified
GTEST_DIR not specified skipping alljoyn_core unit test build

scons: warning: Ignoring missing SConscript 'alljoyn_core/win8_sdk/SConscript'
File "/Users/xxx/xxx/xxx/external/AllJoyn/alljoyn_core/SConscript", line 160, in <module>
scons: done reading SConscript files.
scons: Building targets ...
scons: *** Do not know how to make File target `build/android/arm/debug/dist/java/lib/liballjoyn_java.so' (/Users/xxx/xxx/xxx/external/AllJoyn/build/android/arm/debug/dist/java/lib/liballjoyn_java.so).  Stop.
scons: building terminated because of errors.

Not sure if excluding the samples will make any difference if the target itself won't build.

Any other ideas?

edit flag offensive delete publish link more

Comments

One more update: I have now built with the samples excluded. Build succeeds, but does not build the library in question. Adding the samples back in after successfully building without, still fails in exactly the same manner.

jdelliot ( 2014-07-24 12:05:58 -0700 )edit

I moved your comments into the original question. Ask is designed as a Q&A site not a forum. You are free to edit you question as much as you need to provide more information that leads to the correct answer.

georgen ( 2014-07-24 14:32:40 -0700 )edit
0

answered 2014-12-07 00:34:43 -0700

congngale gravatar image

Hi jdelliot,

I almost time develop alljoyn application on ubuntu and today I just switch into MAC and met exactly your problem. I took time to read SConscript I figured out that It was a mistake (I thought) when It doesn't copy the liballjoyn_java into JAVA_DISTDIR/lib even It is already built that lib. I also modify couple lines in SConscript and the problem gone. This is how i fixed it:

  1. Firstly, Cd into alljoyn_java folder and run scons command same as yours.
  2. Secondly, After It done, you will see a library liballjoyn_java.dylib at alljoyn_java/build/android/arm/debug/dist/java/lib
  3. Finally, You just rename the library liballjoyn_java.dylib into liballjoyn_java.so and copy it to where the scons said that can not found this library.
edit flag offensive delete publish link more

Comments

if scons is naming the file libaljoyn_java.dylib when it should be named liballjoyn_java.so we can fix that by updating the scons scripts. If we are on a Mac we can set the SHLIBSUFFIX to '.so' not dylib when building. @congngale I would encourage you to try to make the change and submit it to the alliance. I am happy to help out if you want to try.

georgen ( 2014-12-10 10:36:56 -0700 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2014-07-23 17:55:06 -0700

Seen: 577 times

Last updated: Dec 07 '14