全新安装 Android Studio 3.6.3(便携式)后。当我尝试构建和运行我的项目时,我不断收到
app\build\intermediates\compile_and_runtime_not_namespaced_r_class_jar\debug\R.jar:进程无法访问该文件,因为它正被另一个进程使用。
不确定它想从我这里得到什么。我以“管理员身份”运行 Android Studio,甚至关闭项目并重新打开它,第一次运行时,第二次出现错误。
我尝试使缓存无效并重新启动,我尝试删除 app/build 下的文件夹,但它似乎又回来了。我错过了什么?
谢谢
更新:
尝试清理项目时,我得到以下信息
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:clean'.
> Unable to delete directory 'C:\Users\name\Downloads\portable\android-studio\projects\appm\app\build'
Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory.
- C:\Users\name\Downloads\portable\android-studio\projects\appm\app\build\intermediates\compile_and_runtime_not_namespaced_r_class_jar\debug\R.jar
- C:\Users\name\Downloads\portable\android-studio\projects\appm\app\build\intermediates\compile_and_runtime_not_namespaced_r_class_jar\debug
- C:\Users\name\Downloads\portable\android-studio\projects\appm\app\build\intermediates\compile_and_runtime_not_namespaced_r_class_jar
- C:\Users\name\Downloads\portable\android-studio\projects\appm\app\build\intermediates
Run Code Online (Sandbox Code Playgroud)
如果我等了几分钟,例如更新这个问题所花的时间,那么它又可以工作了……
更新: 更新到Android Studio 4,出现同样问题。
我刚刚更新了 android studio 3.6.1。这次更新后,我更新了所有插件。现在 Gradle 同步失败。请检查以下错误。
Caused by: org.gradle.tooling.BuildException: Failed to process C:\user\app\build\intermediates\compile_and_runtime_not_namespaced_r_class_jar\debug\R.jar
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\app\build\intermediates\javac\debug\classes
Error while dexing.
Run Code Online (Sandbox Code Playgroud) 第二次运行该项目后,我遇到了这个错误。
...\app\build\intermediates\compile_and_runtime_not_namespaced_r_class_jar\debug\R.jar:进程无法访问该文件,因为它正被另一个进程使用
到目前为止Clean 项目工作一次,重新启动 Android Studio 工作一次,最后的办法是重新启动电脑(运行 Windows 10)。
打开建议!