转自:http://chinavideo.org/forum.php?mod=viewthread&tid=10821&page=1

Error 1:

$ ndk-build
/cygdrive/c/andy/abc/obj/local/armeabi-v7a/objs/abc//hellow.o.d:1: ***  multiple target patterns . Stop.

quick fix: Delete Obj folder from “C:\andy\prjM\obj\local\armeabi-v7a” then run ndk-build
or refer this

Error 2:
Android.mk:44: ***  commands commence before first target . Stop.
fix: Check there are no comments,no space ,no empty line in the src includes of Android.mk

For example:
wrong:

  1. LOCAL_SRC_FILES :=file1.cpp\
  2. file1al.cpp\
  3. #file1atures.cpp\
  4. file1r.cpp\
  5. file1le.cpp\
  6. Satfile1.cpp\
  7. Sfile1l.cpp\
  8. file1e.cpp\
  9. Sfile1face.cpp\

复制代码

3rd line has #, 4th line has space(check with cursor),5th line is empty line

Right:

  1. LOCAL_SRC_FILES :=file1.cpp\
  2. file1al.cpp\
  3. file1atures.cp\
  4. file1r.cpp\
  5. file1le.cpp\
  6. Satfile1.cpp\
  7. Sfile1l.cpp\
  8. file1e.cpp\
  9. Sfile1face.cpp\

复制代码

Error 3:
$ ndk-build clean
Android 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: ***  Android NDK: Aborting  . Stop.

Fix: include Android.mk location inside global application.mk and Android.mk
Run the command from the parent directory with app.mk and and.mk resides

Error 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.sh 
Please define ANDROID_NDK_ROOT to point to the root of your Android NDK installation.

// Run the script inside NDK root directory like shown below
xxx-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.sh

Error 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 prebuilt

i;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.sh
To follow build in another terminal, please use: tail -F /tmp/ndk-toolchain/build-CtAG7s/log.txt
Download sources from android.git.kernel.org
Using git clone prefix: git://android.git.kernel.org/toolchain
downloading sources for toolchain/binutils
downloading sources for toolchain/build
downloading sources for toolchain/gcc
downloading sources for toolchain/gdb
downloading sources for toolchain/gmp
downloading sources for toolchain/gold
downloading sources for toolchain/mpfr
Patching toolchain sources
Toolchain sources downloaded and copied to /tmp/ndk-toolchain/build-CtAG7s/src
Cleaning 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.so

xxx-desktop:~/bin/u/android-ndk-r5/samples/native-activity$ ndk-build
Compile thumb  : native-activity <= main.c
Compile thumb  : android_native_app_glue <= android_native_app_glue.c
StaticLibrary  : libandroid_native_app_glue.a
SharedLibrary  : libnative-activity.so
Install        : libnative-activity.so => libs/armeabi/libnative-activity.so

Android NDK编译常见错误及解决方案相关推荐

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

    Android NDK编译常见错误及解决方案 Error 1:$ ndk-build/cygdrive/c/andy/abc/obj/local/armeabi-v7a/objs/abc//hello ...

  2. android中ndk编译错误,Android NDK编译常见错误及解决方案

    Android NDK编译常见错误及解决方案 Error 1:$ ndk-build/cygdrive/c/andy/abc/obj/local/armeabi-v7a/objs/abc//hello ...

  3. android system image 编译出错,Android framework 编译常见错误

    常见错误: 1)  添加系统API或者修改@hide的API后,需要执行 make update-api,然后再make 2) 修改公共api后,需要 make update-api 比较framew ...

  4. php源码编译常见错误解决方案大全

    php源码编译常见错误解决方案大全 http://www.cnlvzi.com/index.php/Index/article/id/143 在CentOS编译PHP5的时候有时会遇到以下的一些错误信 ...

  5. android 编译 sdl,使用android ndk编译SDL2示例错误r14

    我已经测试过在我的ubuntu 16.04机器上构建SDL2源代码(2.0.5)中的示例.使用android ndk编译SDL2示例错误r14 根据https://wiki.libsdl.org/An ...

  6. Android NDK开发Crash错误定位

    在Android开发中,程序Crash分三种情况:未捕获的异常.ANR(Application Not Responding)和闪退(NDK引发错误).其中未捕获的异常根据logcat打印的堆栈信息很 ...

  7. android jni不适用ndk,Android NDK编译之undefined reference to 'JNI_CreateJavaVM'

    利用Android NDK编译动态库,在C文件中调用了两个JNI函数:JNI_GetDefaultJavaVMInitArgs和JNI_CreateJavaVM.编译的时候始终报以下错误: XXX: ...

  8. 大数据常见错误及解决方案

    大数据常见错误及解决方案(转载) 1.用./bin/spark-shell启动spark时遇到异常:java.net.BindException: Can't assign requested add ...

  9. MySQL数据库常见错误及解决方案

    MySQL数据库常见错误及解决方案 1 MySQL无法重启问题解决Warning: World-writable config file '/etc/my.cnf' is ignored 原因 今天帮 ...

最新文章

  1. 使用SSH框架实现用户登录验证
  2. python快速排序算法详细图解_Python实现桶排序与快速排序算法结合应用示例
  3. linux 设备管理工具 udev 规则编写
  4. Mysql实战:主从同步
  5. eclipse指定jdk版本启动,解决Version XXXX of the JVM is not
  6. python string模块安装_python String模块-阿里云开发者社区
  7. Python基础,基本类型(整型,浮点数等)数据结构(List,dic(Map),Set,Tuple),控制语句(if,for,while,continue or break):来自学习资料
  8. [网络安全提高篇] 一〇九.津门杯CTF的Web Write-Up万字详解(SSRF、文件上传、SQL注入、代码审计、中国蚁剑)
  9. 05.序列模型 W3.序列模型和注意力机制
  10. Hide Delegate(隐藏“委托关系”)
  11. php如何分词,关于php分词如何单独提取出来
  12. 微型计算机硬件认识和拆装,微型计算机系统硬件组成与外设认识.doc
  13. C#如何运行外部程序(打开可执行程序):ShellExcute和Process
  14. Android 持续集成基础教程
  15. STM32F107VCT6开发板 CAN总线通信实验----发送和接收
  16. 单体架构与微服务架构(英文)
  17. 稳压二极管型号及国内外类似型号对照变
  18. G码云+hexo搭建博客
  19. VM无法将网络更改为桥接状态:没有未桥接的主机网络适配器
  20. 调研主板,树莓派 VS RK3288板子,还是 RK的主板香,但是只支持 anrdoid 7系统,估计也有刷机成 armbian或者

热门文章

  1. mysql intersect用法格式_我们如何模拟MySQL INTERSECT查询?
  2. Python 框架 之 Django 绑定 MySql ,MVT 实现简单一个简单的浏览器(内附详细步骤)
  3. R语言计算KS值、绘制KS曲线
  4. 【谷歌地图--MapsSDK集成】
  5. PHP在线发邮件 无需服务端软件
  6. 怎么选择合适的PLM系统
  7. Chapter5.2:频率响应法
  8. 前端路由和 VueRouter
  9. mac必备的mac解压缩软件:BetterZip for mac中文版
  10. 单片机 LCD1602显示实验