NDK编译php,Android NDK编译常见错误及解决方案

Android NDK编译常见错误及解决方案

Error 1:$ ndk-build/cygdrive/c/andy/abc/obj/local/armeabi-v7a/objs/abc//hellow.o.d:1: *** [color=#FF0000]multiple target patterns[/color]. Stop.quick fix: Delete Obj folder from “C:\andy\prjM\obj\local\armeabi-v7a” then run ndk-buildor refer thisError 2:Android.mk:44: *** [color=#FF0000]commands commence before first target[/color]. Stop.fix: Check there areno comments,no space ,no empty line in the src includes of Android.mkFor example:wrong:[code]LOCAL_SRC_FILES :=file1.cpp\file1al.cpp\#file1atures.cpp\file1r.cpp\file1le.cpp\Satfile1.cpp\Sfile1l.cpp\file1e.cpp\Sfile1face.cpp\[/code]3rd line has #, 4th line has space(check with cursor),5th line is empty lineRight:[code]LOCAL_SRC_FILES :=file1.cpp\file1al.cpp\file1atures.cp\file1r.cpp\file1le.cpp\Satfile1.cpp\Sfile1l.cpp\file1e.cpp\Sfile1face.cpp\[/code]Error 3:$ ndk-build cleanAndroid NDK: Could not find application project directory !Android NDK: Please define the NDK_PROJECT_PATH variable to point to it./cygdrive/c/android-ndk-r4b/build/core/build-local.mk:85: *** [color=#FF0000]Android NDK: Aborting[/color] . Stop.Fix: include Android.mk location inside global application.mk and Android.mkRun the command from the parent directory with app.mk and and.mk residesError 4:Please define ANDROID_NDK_ROOT to point to the root of your Android NDK installation.Use case while executing shell script xxx-desktop:~/bin/u/android-ndk-r5/build/tools$ ./rebuild-all-prebuilt.shPlease define ANDROID_NDK_ROOT to point to the root of your Android NDK installation.// Run the script inside NDK root directory like shown belowxxx-desktop:~/bin/u/android-ndk-r5/build/tools$ cd ..xxx-desktop:~/bin/u/android-ndk-r5/build$ cd ..xxxx-desktop:~/bin/u/android-ndk-r5$ ./build/tools/rebuild-all-prebuilt.shError 5: NDK r5 app(native-activity,native-audio,native-plasma) build problem Compiling native-activity,native-audio,native-plasma on ndk-r5 give compile errors stating header not found and  so on ……Quick fix:  Rebuild all prebuilti;e execute shell script rebuild-all-prebuilt.sh to build on latest toolchain provided by android which will take for a while (atleast on my pc)xxx-desktop:~/bin/u/android-ndk-r5$ ./build/tools/rebuild-all-prebuilt.shTo follow build in another terminal, please use: tail -F /tmp/ndk-toolchain/build-CtAG7s/log.txtDownload sources from android.git.kernel.orgUsing git clone prefix: git://android.git.kernel.org/toolchaindownloading sources for toolchain/binutilsdownloading sources for toolchain/builddownloading sources for toolchain/gccdownloading sources for toolchain/gdbdownloading sources for toolchain/gmpdownloading sources for toolchain/golddownloading sources for toolchain/mpfrPatching toolchain sourcesToolchain sources downloaded and copied to /tmp/ndk-toolchain/build-CtAG7s/srcCleaning up...Done.Building arm-eabi-4.4.0 toolchain... (this can be long)ERROR: Could bot build arm-eabi-4.4.0 toolchain!xxxx-desktop:~/bin/u/android-ndk-r5$Now change to native-activity folder and call ndk-build for successful libnative-activity.soxxx-desktop:~/bin/u/android-ndk-r5/samples/native-activity$ ndk-buildCompile thumb  : native-activity <= main.cCompile thumb  : android_native_app_glue <= android_native_app_glue.cStaticLibrary  : libandroid_native_app_glue.aSharedLibrary  : libnative-activity.soInstall        : libnative-activity.so => libs/armeabi/libnative-activity.so

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值