简体   繁体   English

重命名包时出错:“无法创建文件 'com'。 文件已经存在。”

[英]Error in renaming package: “Cannot create file 'com'. File already exist.”

The problem is that in the debug folder, the folder is already in the google folder.问题是在debug文件夹中,该文件夹已经在google文件夹中了。 There is also a folder with the name of my first part of the package.还有一个文件夹,里面有我的包的第一部分的名称。 So when I try to rename the first part of the package in my project, I get an error: Cannot create file 'D:\\...\\...\\...\\build\\generated\\source\\r\\debug\\com'. File already exist.因此,当我尝试重命名项目中包的第一部分时,出现错误: Cannot create file 'D:\\...\\...\\...\\build\\generated\\source\\r\\debug\\com'. File already exist. Cannot create file 'D:\\...\\...\\...\\build\\generated\\source\\r\\debug\\com'. File already exist. In my other projects, the folder with the name of the first part of the package is built in the folder 'com', and here in the 'debug' itself.在我的其他项目中,具有包第一部分名称的文件夹构建在文件夹 'com' 中,这里是在 'debug' 本身中。 Tell me, what can I do?告诉我,我能做什么? Can I somehow change the build path of this folder in debug?我可以在调试中以某种方式更改此文件夹的构建路径吗?

  1. Go to Project view in left pane -> (project name folder) -> build转到左侧窗格中的项目视图->(项目名称文件夹) -> 构建

  2. There you will get 3 or 4 folders like: generated, intermediate, outputs like this:在那里你会得到 3 或 4 个文件夹,如:生成的、中间的、输出如下: 在此处输入图片说明

  3. Select all 3 or 4 folders in that build folder and delete them.选择该构建文件夹中的所有 3 或 4 个文件夹并将其删除。

  4. Go to Android view in left pane and try to refactor your package name转到左侧窗格中的Android 视图并尝试重构您的包名称

  5. After that rebuild your project.之后重建你的项目。

That's it!就是这样!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java“文件已存在”错误? - java “The file already exist” error? Android Studio 2016重命名com.example文件错误 - Android Studio 2016 renaming com.example file error 错误:程序包不存在。 发行代码相关吗? - Error: package does not exist. Is the issue code related? 错误:编译 Java 文件时“包 com.fasterxml.jackson.databind 不存在” - Error: "package com.fasterxml.jackson.databind does not exist" when compiling Java file 骆驼文件组件:创建文件,如果已经存在,请将其移动并使用时间戳进行重命名 - Camel file component : create a file and if already exist, move it and renamed it with timestamp 文件重命名和删除错误 - File renaming and deleting error 在for循环中重命名文件时出错 - Error renaming a File in a for loop java.io.FileNotFoundException: 文件 file:/data/home/test/analysis.json 不存在。 读取json时引发错误 - java.io.FileNotFoundException: File file:/data/home/test/analysis.json does not exist. Spark error while reading json Progam无法看到文件,但文件存在。 FileNotFoundException异常 - Progam can't see file but it exist. FileNotFoundException 无法为文件 entry_debug_unsigned_entry.apk 创建 MD5 hash,因为它不存在。 在 DevEco Studio HarmonyOS 中 - Failed to create MD5 hash for file entry_debug_unsigned_entry.apk as it does not exist. in DevEco Studio HarmonyOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM