$ scons target=arm-android-linux build_config=Release

编译Platinum库

1.scon编译环境:

Building for Android: 

ANDROID_HOST_SYSTEM = darwin-x86

ANDROID_TOOLCHAIN   = arm-linux-androideabi-4.9

ANDROID_PLATFORM    = android-9

ANDROID_ARCH        = arm

ANDROID_TOOLCHAIN_BIN   = /Users/zhouronghua/DEV/IDES/Android/sdk/ndk/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86/bin

ANDROID_SYSROOT   = /Users/zhouronghua/DEV/IDES/Android/sdk/ndk/android-ndk-r11c/platforms/android-9/arch-arm

ce/Tests/FileMediaServer/FileMediaServerTest.cpp

sh: arm-linux-androideabi-g++: command not found

scons: *** [Build/Targets/arm-android-linux/Debug/Source/Tests/FileMediaServer/FileMediaServerTest.o] Error 127

说明:检测/Users/zhouronghua/DEV/IDES/Android/sdk/ndk/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86/bin环境下存在arm-linux-androideabi-g++

原因:darwin-x86_64下边,而不是darwin-x86下边。

### add the tools to the path
env.PrependENVPath('PATH', ANDROID_TOOLCHAIN_BIN)

对应Platium的Build下的Config.scons文件修改配置信息

# detect the host system on which we're running
if env.has_key('android_host_system') and env['android_host_system']:
	ANDROID_HOST_SYSTEM = env['android_host_system']
else:
	PLATFORM_TO_TARGET_MAP = {
    	'linux-i386' : 'linux-x86_64',
    	'linux2'     : 'linux-x86_64',
    	'win32'      : 'windows',
    	'cygwin'     : 'windows',
    	'darwin'     : 'darwin-x86_64'
	}
	if sys.platform in PLATFORM_TO_TARGET_MAP:
		ANDROID_HOST_SYSTEM = PLATFORM_TO_TARGET_MAP[sys.platform]
	else:
		raise Exception('Android Host Platform cannot be determined')

# set defaults
ANDROID_ARCH         = 'arm'
ANDROID_PLATFORM     = 'android-9'
#ANDROID_TOOLCHAIN    = 'arm-linux-androideabi-4.4.3'
ANDROID_TOOLCHAIN    = 'arm-linux-androideabi-4.9'
ANDROID_CROSS_PREFIX = 'arm-linux-androideabi'

1)PLATFORM_TO_TARGET_MAP对应平台修改为64位的。因为Mac上对应的CPU指令都是64位的;

2)修改ANDROID_TOOLCHAIN对应自己环境使用的指令集。

2.编译时出现对应的NDK工具禁止使用

/arm-android-linux/Debug/Source/Core/PltCtrlPoint.o Build/Targets/arm-android-linux/Debug/Source/Core/PltHttp.o Build/Targets/arm-android-linux/Debug/Source/Extras/PltStreamPump.o Build/Targets/arm-android-linux/Debug/Source/Extras/PltMetadataHandler.o Build/Targets/arm-android-linux/Debug/Source/Extras/PltFrameStream.o Build/Targets/arm-android-linux/Debug/Source/Extras/PltFrameServer.o Build/Targets/arm-android-linux/Debug/Source/Extras/PltDownloader.o Build/Targets/arm-android-linux/Debug/Source/Extras/PltRingBufferStream.o Build/Targets/arm-android-linux/Debug/Source/Extras/PltLeaks.o Build/Targets/arm-android-linux/Debug/Source/Extras/PltFrameBuffer.o

arm-linux-androideabi-ranlib Build/Targets/arm-android-linux/Debug/libPlatinum.a

scons: *** [Build/Targets/arm-android-linux/Debug/libPlatinum.a] Error -9

scons: building terminated because of errors.

解决方法:IOS升级到10.15以后,系统安全与隐私中允许对应的可执行程序使用。

Logo

智屏生态联盟致力于大屏生态发展,利用大屏快应用技术降低开发者开发、发布大屏应用门槛

更多推荐