Android编译环境报错记录

本文解决了Android项目中常见的三个编译错误:1. host_shared_library_internal.mk中的配置问题;2. Android.mk文件中的语法错误;3. gradle依赖解析失败。通过修改配置文件、修正文件格式及添加新的依赖源来解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、报错出现了

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

解决方案:

  1.art/build/Android.common_build.mk中把true改为false

# Host.
ART_HOST_CLANG := false
ifneq ($(WITHOUT_HOST_CLANG),false)          #ture--->false
# By default, host builds use clang for better warnings.
ART_HOST_CLANG := ture
endif

 2 执行命令,更改链接指向 

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

二、报错出现了

vendor/qcom/proprietary/mm-still/ipl/Android.mk:16  recipe commences before first target。 停止

解决方法:

打开 vendor/qcom/proprietary/mm-still/ipl/Android.mk: 发现原来是15行缺少换行符

将 -D__alignx/(x/)=__attribute__/(/(__aligned__/(x/)/)/) 改为

-D__alignx/(x/)=__attribute__/(/(__aligned__/(x/)/)/) /
三、执行命令 ./gradlew tasks时出现错误

Could not resolve all files for configuration ‘:classpath’. 
Could not find com.android.tools.build:gradle:3.0.0. 
Searched in the following locations: 
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom  
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar  
Required by: 
project :* Try: 

Run with –stacktrace option to get the stack trace. Run with –debug option to get more log output.

解决方法:在project的builde.gradle做如下操作分别加上google(),因为关于gradle的升级后,所需要的开源库,不一定在jcenter()库中能找到,可以在google()服务器上找到相应的开源库



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值