android 8.0.0-r1 源码编译遇到的问题build/core/main.mk:21: recipe for target 'run_soong_ui' failed 解决

好处:使用studio查看源码的时候,如果不生成.ipr .iml文件,查看的Java文件是无法索引到其他的文件的,需要一个一个的搜索,很不方便,而.ipr .iml文件就可以解决这部分问题,而且它还可以控制你需要查看源码的内容,比如你不需要查看cpp库,你就可以在.ipr文件中去除对应的文件夹,使你的studio可以更快的打开。

第一步:进入AOSP的根目录,执行命令:

source build/envsetup.sh
lunch
mmm development/tools/idegen/

如果执行成功,可以看到这个提示内容

build completed successfully (02:39 (mm:ss))

但是很不幸我执行报错了,报错内容:

ninja:error:"out/host/common/obj/JAVA_LIBRARIES/guavalib_intermediates/classes-full-debug.jar"need by"out/host/common/obj/JAVA_LIBRARIES/idegen_intermediates/class-full-debug.jar" missing and no know rule to make it

解决办法:在项目的根目录执行以下的命令:

make idegen

第二步:执行:

sh ./development/tools/idegen/idegen.sh

好了,在项目的根目录就会生成.ipr .iml 文件了。
第三步:接下来打开studio 选择 .ipr 文件导入即可,又发现一个问题:

Android studio 一直在执行 scan file to index 任务

也有很多人遇到这个问题
https://stackoverflow.com/questions/17834821/android-studio-background-task-running-indefinitely
通过上面的方法,发现对自己无效。采用了另外一篇文章的解决办法。
https://blog.csdn.net/shisanmei911/article/details/79761569
解决办法:

1 invalidate and restart 不起作用

2 Open module setting --> Modules --> 找到gen文件夹  --> 右键选择Resources

 

 

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
As an AI language model, I don't have access to the specific details of your project or environment. However, here are some general steps you can take to resolve this error: 1. Check your internet connection: Make sure you have a stable internet connection and try re-syncing your project with Gradle by clicking on the "Sync Now" button in the toolbar. 2. Check your Gradle version: Make sure you have the latest version of Gradle installed. You can check the version of Gradle in your project by opening the Gradle panel (located on the right side of the Android Studio window) and looking for the version number. 3. Update your Gradle settings: If you're using an older version of Gradle, you may need to update your Gradle settings to support the latest version of the Android Gradle plugin. You can do this by updating the "build.gradle" file in your project. 4. Check the repository configuration: Make sure that the repository configuration in your "build.gradle" file is correct and up-to-date. You can check the latest version of the Android Gradle plugin and make sure it's included in your repository configuration. 5. Use a stable version: If you're still having trouble with the alpha version, try using a stable version of the Gradle plugin instead. You can do this by updating your "build.gradle" file and specifying a stable version of the Gradle plugin. If none of these steps work, you may need to seek further assistance from the Android community or consult the official documentation.

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值