英文:
Android Studio Java (generated) files are posing errors while running the app
问题
我刚刚在我的Android Studio中导入了一个项目。当我尝试重构软件包名称时,开始出现错误。我是Android方面的初学者,只需要您的帮助。
当我通过重命名java后面的第一个文件夹来重构软件包名称时,它确实更改了文件夹名称,但是在java(生成的)文件中有一些导入。现在我无法优化生成的文件中的导入,因为它们不能被更改,所有更改都会丢失。
英文:
I just imported a project in my Android Studio. When I tried to refactor the package name, I started facing errors. I am a beginner in Android so just need your help.
When I refactored the package name by renaming the first folder after java. It did change the folder name but there were some imports in files of java (generated). Now I am unable to optimize imports in the generated files as it cannot be changed and all the changes are lost.
答案1
得分: 1
你在java(生成的)文件夹下...
那些java文件不应该被编辑...
那些是由编译器生成的....
明确写着不应该被编辑
正如你所说,“我正在尝试重构包名”,只需参考这个链接
谢谢
英文:
you are under java (generated) folder ...
those java files should not be edited...
those are generated by compiler....
it is clearly written above it should not be edited
as you said I am trying to refactor the package name
just refer this this
Thanks
答案2
得分: -1
从Android Studio IDE
文件菜单 -> 无效缓存并重新启动 -> 无效缓存并重新启动。
这应该可以解决您的错误。
英文:
from Android Studio IDE
file menu -> Invalidate Cache and restart -> Invalidate Cache and restart.
this should solve your errors
答案3
得分: -1
如果您计划更改包的名称,请尝试这个答案。编辑生成的文件的目的是什么?
英文:
If you are planning to change the name of the package try this answer. what is the purpose to edit a generated file
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论