我是靠谱客的博主 纯情山水,这篇文章主要介绍Android项目The type R is already definedAndroid项目The type R is already defined,现在分享给大家,希望可以做个参考。

Android项目The type R is already defined

现象:
使用Android Studio打开且编译过的项目,再次在Ubuntu源码编译服务器中编译时,报错如下:

ERROR: /home/user/androidSource/out/target/common/obj/APPS/xxxx_intermediates/src/com/xx/xxx/R.java:10:
The type R is already defined
ERROR: /home/user/xxxx/vendor/customer/xxx/xxxx/gen/com/xx/xxx/IMyAidlInterface.java:8:
The type IMyAidlInterface is already defined
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target ‘ninja_wrapper’ failed
make: * [ninja_wrapper] Error 1
make: Leaving directory ‘/home/user/androidSource’

原因:
Android Studio编译后生成的build路径下,R文件、aidl文件与编译服务器中的R文件、aidl文件重复

解决方案:
将Android Studio生成的 build/generated/source/aidl/debug/com.xx.xxx/IMyAidlInterface.java 和 build/generated/source/r/debug/com.xx.xxx/R.java 都删除,然后重新再在Ubuntu源码编译服务器中编译代码

最后

以上就是纯情山水最近收集整理的关于Android项目The type R is already definedAndroid项目The type R is already defined的全部内容,更多相关Android项目The内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(62)

评论列表共有 0 条评论

立即
投稿
返回
顶部