android 5.0 编译报错,Tiny4412_android5.0.2编译

源码导入android

参考

参考2

1, . setenv

2, lunch (choose 14. full_tiny4412-eng)

3, mmm development/tools/idegen/

4, sh ./development/tools/idegen/idegen.sh

这行命令的意思是生成对应的文件:android.iws, android.ipr, android.iml

生成对应的文件后,打开Android Studio,选择打开一个现有的Android Studio项目,选择Android源码的根目录,导入即可(起作用的是android.irp文件).在配置sdk版本之后就可以查看Android 源码了.

报错:

Exception in thread "main" java.io.FileNotFoundException: ./out/target/product/hammerhead/obj/GYP/shared_intermediates/res.java (Is a directory)

at java.io.FileInputStream.open(Native Method)

at java.io.FileInputStream.(FileInputStream.java:138)

at java.io.FileReader.(FileReader.java:72)

at Configuration.parsePackageName(Configuration.java:204)

at Configuration.rootOf(Configuration.java:180)

at Configuration.traverse(Configuration.java:140)

at Configuration.traverse(Configuration.java:167)

at Configuration.traverse(Configuration.java:167)

at Configuration.traverse(Configuration.java:167)

at Configuration.traverse(Configuration.java:167)

at Configuration.traverse(Configuration.java:167)

at Configuration.traverse(Configuration.java:167)

at Configuration.traverse(Configuration.java:167)

at Configuration.(Configuration.java:72)

at Main.main(Main.java:37)

解决办法是将

./out/target/product/hammerhead/obj/GYP/shared_intermediates/res.java

修改为:

./out/target/product/hammerhead/obj/GYP/shared_intermediates/res.j

准备文件:

tar xzf android-5.0.2-fs-20150325.tar.gz

tar xzf linux-3.0.86-20150324.tgz

安装环境(ubuntu 16.04):

sudo ./install-devel-packages.sh

make -v / 4.1

gcc /g++ -v/5.4

arm-linux-gcc -v/

java -v /openjdk-7

编译kernel

cd linux-3.0.86

cp tiny4412_android_defconfig.config

make zInmage

编译android

b578b3d452091093d5eeb5fcd7fb437d.png

cd android-5.0.2

. setenv

lunch

choose full_tiny4412-eng

make -j4

打包

./gen-img.sh

# if get err : ./gen-img.sh: line 31: mkimage: command not found

tar xzf uboot_tiny4412-20130729.tgz

cd uboot_tiny4412

make tiny4412_config

make

sudo cp tools/mkimage /usr/bin

碰到的错误:

1, Unable to locate package mingw32

处理:

sudo vim /etc/apt/sources.list

//在sources.list末尾添加,保存

deb http://us.archive.ubuntu.com/ubuntu trusty main universe

sudo apt-get update

sudo apt-get install mingw32

2, 编译kernel报错

HOSTCC scripts/basic/fixdep

HOSTCC scripts/kconfig/conf.o

HOSTCC scripts/kconfig/zconf.tab.o

HOSTLD scripts/kconfig/conf

scripts/kconfig/conf --silentoldconfig Kconfig

CHK include/linux/version.h

CHK include/generated/utsrelease.h

make[1]: 'include/generated/mach-types.h' is up to date.

CC kernel/bounds.s

arm-linux-gcc: error trying to exec 'cc1': execvp: No such file or directory

/home/arte/work/driver/tiny4412/source/linux-3.0.86/./Kbuild:35: recipe for target 'kernel/bounds.s' failed

make[1]: *** [kernel/bounds.s] Error 1

Makefile:997: recipe for target 'prepare0' failed

make: *** [prepare0] Error 2

处理=============================================

没有指定arm-linux-gcc版本,需要在.bashrc中将toolschain加入export

export PATH=$PATH:/opt/FriendlyARM/toolschain/4.5.1/bin/

3, 编译android报错, java版本不对

============================================

Checking build tools versions...

************************************************************

You are attempting to build with the incorrect version

of java.

Your version is: openjdk version "1.8.0_181" OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-1ubuntu0.16.04.1-b13) OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode).

The required version is: "1.7.x"

Please follow the machine setup instructions at

https://source.android.com/source/initializing.html

************************************************************

build/core/main.mk:167: *** stop。 停止。

#### make failed to build some targets (6 seconds) ####

解决:

切换java版本到openjdk7

sudo update-alternatives --config java

如果且不过来 , 检查一下~/.bashrc是不是配置了固定java_home

如果还是不行 , 退出termial 在进, 最后不行就重启.

4, clang问题

clang: error: linker command failed with exit code 1 (use -v to see invocation)

build/core/host_shared_library_internal.mk:44: recipe for target 'out/host/linux-x86/obj32/lib/libnativehelper.so' failed

make: *** [out/host/linux-x86/obj32/lib/libnativehelper.so] Error 1

重新make 不加-j参数 .

external/libcxx/include/thread:149: error: unsupported reloc 43

clang: error: linker command failed with exit code 1 (use -v to see invocation)

build/core/host_shared_library_internal.mk:44: recipe for target 'out/host/linux-x86/obj32/lib/libc++.so' failed

make: *** [out/host/linux-x86/obj32/lib/libc++.so] Error 1

#### make failed to build some targets (04:12 (mm:ss)) ####

从log看都和clang有关,参考

1.修改

cd /art/build/

vim Android.common_build.mk //修改第119行

修改前:

# Host.

ART_HOST_CLANG := false

ifneq ($(WITHOUT_HOST_CLANG),true)

# By default, host builds use clang for better warnings.

ART_HOST_CLANG := true

endif

修改后:

# Host.

ART_HOST_CLANG := false

ifneq ($(WITHOUT_HOST_CLANG),false)

# By default, host builds use clang for better warnings.

ART_HOST_CLANG := true

endif

2.修改

经过第一次修改之后发现编译还是报同样的错误,执行下面:

cp /usr/bin/ld.gold /prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/x86_64-linux/bin/ld

3.修改过上述代码后,最好执行一次make update-api,再make

5, 报错如下

You have tried to change the API from what has been previously approved.

To make these errors go away, you have two choices:

You can add “@hide” javadoc comments to the methods, etc. listed in the

errors above.

You can update current.txt by executing the following command:

make update-api

To submit the revised current.txt to the main Android repository,

you will need approval.

build/core/tasks/apicheck.mk:57: recipe for target ‘out/target/common/obj/PACKAGING/checkapi-current-timestamp’ failed

make: *** [out/target/common/obj/PACKAGING/checkapi-current-timestamp] Error 38

解决:参考

make update-api

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
回答: 报错信息"Could NOT find TinyXml (missing: TINYXML_LIBRARIES TINYXML_INCLUDE_DIR)"表示找不到TinyXml库。为了解决这个问题,你可以按照以下步骤进行操作: 1. 首先,确保你已经安装了TinyXml库的依赖库。你可以使用以下命令安装缺失的依赖库: ``` apt-get install libtinyxml-dev ``` 2. 如果你已经安装了TinyXml库的依赖库,但仍然出现问题,你可以尝试手动定义TinyXml库的环境变量。你可以在CMakeList.txt文件中添加以下内容: ``` set(TINYXML_LIBRARIES /path/to/tinyxml/lib) set(TINYXML_INCLUDE_DIR /path/to/tinyxml/include) ``` 请确保将"/path/to/tinyxml/lib"和"/path/to/tinyxml/include"替换为实际的TinyXml库的路径。 3. 如果以上步骤都没有解决问题,你可以尝试重新编译TinyXml库。你可以按照以下步骤进行操作: - 下载TinyXml库的源代码。 - 进入TinyXml库的源代码目录。 - 执行以下命令进行编译和安装: ``` make make install ``` 请注意,这些步骤可能因为你的具体环境而有所不同。如果你仍然遇到问题,建议查阅TinyXml库的官方文档或者寻求相关技术支持。 #### 引用[.reference_title] - *1* [Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)Call Stack](https://blog.csdn.net/quantum7/article/details/127092600)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [TinyXML2(学习记录)](https://blog.csdn.net/qq_34709554/article/details/129937874)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [在Ubuntu上编译QGIS 3.6.*-3.10.* 代码的填坑笔记](https://blog.csdn.net/DanyelleG/article/details/106454423)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值