0

SCons error when specifying ANDROID_SDK

asked 2014-06-17 07:50:44 -0700

cs_chance gravatar image

I am attempting to build AllJoyn for Froyo and am hitting a snag when running scons. When I attempt to run this,

scons OS=android CPU=arm ANDROID_NDK=/path/to/android-ndk-r9d ANDROID_SRC=/path/to/src ws=off

as specified in the "AllJoyn Android Environment Setup Guide - 28-Feb-2014" I receive the error:

ANDROID_SDK must be set

When I attempt to set the path to the SDK like so:

scons OS=android CPU=arm ANDROID_NDK=/path/to/android-ndk-r9d ANDROID_SRC=/path/to/src ANDROID_SDK=/path/to/sdk ws=off

I receive this:

IndexError: list index out of range:
  File "/home/chance/alljoyn/SConstruct", line 19:
    env = SConscript(['build_core/SConscript'])
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 614:
    return method(*args, **kw)
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "/home/chance/alljoyn/build_core/SConscript", line 240:
    env.SConscript('conf/${OS_CONF}/SConscript')
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "/home/chance/alljoyn/build_core/conf/android/SConscript", line 69:
    vars2.Add('ANDROID_API_LEVEL', 'Android API level', os.environ.get('ANDROID_API_LEVEL', str(api_levels[-1])))

I have previously built and tested the bindings for cpp and java on their own, and tested AllJoyn sample apps with no issues. Python 2.7.4 is installed, as well as JDK1.5.0_22 and junit-4.11.

I'm guessing I skipped a prerequisite somewhere?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-06-17 10:29:18 -0700

stevek gravatar image

There is code in that SConscript file that tries to determine an appropriate Android API level. Apparently, it could not find one so the api_levels array is empty. The only guess I can make is that your Android SDK doesn't support a high enough API level. Both the NDK and SDK must support an API level of 8 (Froyo) or higher.

You may want to update to Gingerbread, Ice Cream Sandwich, or Jellybean since those tend to get tested more. There are known build problems with KitKat (search this ask forum for details).

edit flag offensive delete publish link more

Comments

Double-checking the SDK appears to have corrected that specific issue. Thanks!

cs_chance ( 2014-06-17 12:28:10 -0700 )edit
Login/Signup to Answer

Question Tools

Follow
2 followers

Stats

Asked: 2014-06-17 07:50:44 -0700

Seen: 219 times

Last updated: Jun 17 '14