当前位置 : 主页 > 网页制作 > React >

react-native run-android随机无法删除或创建文件夹

来源:互联网 收集:自由互联 发布时间:2021-06-15
我在 Windows 10上运行: 该文件夹的权限是Everyone完全访问. Cmd行设置为Administrator. –version react-native-cli:2.0.1 –version react-native:0.47.2 * What went wrong:Execution failed for task ':@myApp/react-native
我在 Windows 10上运行:

该文件夹的权限是Everyone&完全访问.

Cmd行设置为Administrator.

–version react-native-cli:2.0.1

–version react-native:0.47.2

* What went wrong:
Execution failed for task ':@myApp/react-native-spinkit:mergeReleaseResources'.
> java.io.IOException: Could not delete path 'C:\Users\My\Desktop\App\node_modules\@myApp
\react-native-spinkit\android\build\intermediates\res\merged\release\drawable-xhdpi-v4'.

例如,我将得到上面的错误.有时它说不能删除一些中间路径,有时,它说它无法创建它们.

它不是固定的错误输出,每次遇到麻烦的中间文件夹都不同.当我在好日子里重复React-native run-android 2-3次时,它将成功编译.在糟糕的日子里,我将重复cmd 10-15次,然后它突然起作用.

顺便说一句,我使用android / gradlew clean命令来确保它也进行清理.

我注意到的一件事是,每次失败,编译百分比%都会进一步增加.直到最后,如果我看到100%那么它将起作用.

相同的代码一次编译与Mac,Android物理或虚拟机,在Mac上同样的东西是非常稳定的.我的Windows安装程序只会出现此问题.有没有人和我一样经历过同样的事情?我有什么办法可以解决这个问题吗?

你可以试试这个: Error:Execution failed for task ‘:app:processDebugResources’. > java.io.IOException: Could not delete folder “” in android studio

删除/ build文件夹为我做了.

I guess some of the files in the target build directory is open in another tool you use. Just a file handle open in the folder which has to be cleaned. The build task ‘clean’ wants to delete all the files in the build directory(normally ‘target’) and when it fails, the build fails.

网友评论