生成在build文件夹中的文件,不应对其进行编辑,不能重新构建Android项目 [英] Files under the build folder are generated and should not be edited, cannot re-build android project

查看:13597
本文介绍了生成在build文件夹中的文件,不应对其进行编辑,不能重新构建Android项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是编程的Andr​​oid应用程序的时候,突然就无法解决标记R在我MainActivity。我以前有过这样的问题,它通常是固定的去工具 - > android-> syncProjectWithGradleFiles但这并没有工作。当我试图做到这一点,需要我给我的Andr​​oidManifest.xml文件,并给我的消息,而不是:文件下生成build文件夹中,不应进行编辑如下 此外,显示这些错误如下:

I was programming an Android application when suddenly it was unable to resolve symbol R in my MainActivity. I have had this issue before and it is usually fixed by going to tools->android->syncProjectWithGradleFiles but this did not work. Instead when I attempt to do this it takes me to my AndroidManifest.xml file and gives me the message: "Files under the build folder are generated and should not be edited" shown below Furthermore, these errors are displayed below:

这些错误规定:未发现的资源匹配给定名称(在图标,值为@绘制/图标)。这是一个服务,我最近尝试添加的一部分。所以,我想在这里删除服务文本;然而,每当我删除服务的文本,它不断被重新添加到.xml文件,每当我试图再次同步同摇篮文件的项目。我已经重新构建的项目和清洁项目两个返回相同的错误...谁能帮我解决这个问题?

These errors specify that: No resource found that matches the given name (at 'icon' with value '@drawable/icon'). which is part of a service I recently tried to add. So I tried deleting the service text here; however whenever I delete the service text, it keeps being re-added to the .xml file whenever I attempt to sync the projects with gradle files again. I have re-built the project and cleaned the project both returning the same errors... Can anyone help me fix this?

推荐答案

这是因为你试图修改AndroidManifest的错版的。 Android的工作室向您展示了位于build文件夹中时,发现错误的文件。打开应用程序/ src目录/主/ AndroidManifest.xml中并对其进行修改。

This is because you are trying to modify the wrong version of AndroidManifest. Android Studio shows you the file located in the build folder when it finds errors. Open app/src/main/AndroidManifest.xml and modify it.

这篇关于生成在build文件夹中的文件,不应对其进行编辑,不能重新构建Android项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆