Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed #47692

Open
Pradip-BCA opened this issue Nov 19, 2024 · 3 comments
Open

Build failed #47692

Pradip-BCA opened this issue Nov 19, 2024 · 3 comments
Labels
Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue.

Comments

@Pradip-BCA
Copy link

Description

FAILURE: Build failed with an exception.

  • Where:
    Settings file 'D:\Mobile_App_Devlopment\LetestMobileApp\demo\android\settings.gradle' line: 2

  • What went wrong:
    Error resolving plugin [id: 'com.facebook.react.settings']

java.io.UncheckedIOException: Could not move temporary workspace (D:\Mobile_App_Devlopment\LetestMobileApp\demo\android.gradle\8.10.2\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10-5dd2a0af-cc67-4253-ad4c-ccfe5db8d92b) to immutable location (D:\Mobile_App_Devlopment\LetestMobileApp\demo\android.gradle\8.10.2\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10)

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

BUILD FAILED in 10s
info Run CLI with --verbose flag for more details.

Steps to reproduce

FAILURE: Build failed with an exception.

  • Where:
    Settings file 'D:\Mobile_App_Devlopment\LetestMobileApp\demo\android\settings.gradle' line: 2

  • What went wrong:
    Error resolving plugin [id: 'com.facebook.react.settings']

java.io.UncheckedIOException: Could not move temporary workspace (D:\Mobile_App_Devlopment\LetestMobileApp\demo\android.gradle\8.10.2\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10-5dd2a0af-cc67-4253-ad4c-ccfe5db8d92b) to immutable location (D:\Mobile_App_Devlopment\LetestMobileApp\demo\android.gradle\8.10.2\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10)

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

BUILD FAILED in 10s
info Run CLI with --verbose flag for more details.

React Native Version

0.76.2

Affected Platforms

Runtime - Android

Output of npx react-native info

Windows 11
8GB RAM, 512 GB SAD
AND RISEN 5
PLEASE SOLVE THE PROBLEM

Stacktrace or Logs

FAILURE: Build failed with an exception.

* Where:
Settings file 'D:\Mobile_App_Devlopment\LetestMobileApp\demo\android\settings.gradle' line: 2

* What went wrong:
Error resolving plugin [id: 'com.facebook.react.settings']
> java.io.UncheckedIOException: Could not move temporary workspace (D:\Mobile_App_Devlopment\LetestMobileApp\demo\android\.gradle\8.10.2\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10-5dd2a0af-cc67-4253-ad4c-ccfe5db8d92b) to immutable location (D:\Mobile_App_Devlopment\LetestMobileApp\demo\android\.gradle\8.10.2\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 10s
info Run CLI with --verbose flag for more details.

Reproducer

expo/expo-template-default

Screenshots and Videos

Screenshot 2024-11-19 092250

@react-native-bot react-native-bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Nov 19, 2024
@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

@Sanjayng125
Copy link

Try cd android
./gradlew clean
And npx react-native run android or npm start

@mrozanc
Copy link

mrozanc commented Nov 23, 2024

I have the same problem on all my projects, on 2 different computers, with different versions of Gradle (8.11.1, 8.11, 8.10.2), on projects that were working before without me touching anything. And on WSL it works fine for the same projects, so I think this problem is Windows 11 related. I only have it on Kotlin projects and not on Java projects also, so maybe it's related to the kotlin plugin.

❯ gradle --version

------------------------------------------------------------
Gradle 8.11.1
------------------------------------------------------------

Build time:    2024-11-20 16:56:46 UTC
Revision:      481cb05a490e0ef9f8620f7873b83bd8a72e7c39

Kotlin:        2.0.20
Groovy:        3.0.22
Ant:           Apache Ant(TM) version 1.10.14 compiled on August 16 2023
Launcher JVM:  21.0.5 (Eclipse Adoptium 21.0.5+11-LTS)
Daemon JVM:    C:\Users\marc\scoop\apps\temurin21-jdk\current (no JDK specified, using current Java home)
OS:            Windows 11 10.0 amd64

❯ gradle init --type kotlin-library --dsl kotlin --project-name test-project --java-version 21

Select test framework:
  1: kotlin.test
  2: JUnit Jupiter
Enter selection (default: kotlin.test) [1..2] 1

Generate build using new APIs and behavior (some features may change in the next minor release)? (default: no) [yes, no] no


> Task :init
Learn more about Gradle by exploring our Samples at https://docs.gradle.org/8.11.1/samples/sample_building_kotlin_libraries.html

BUILD SUCCESSFUL in 7s
1 actionable task: 1 executed

./gradlew clean --debug --stacktrace generates this output:
output-log.txt

The stacktrace points to an AccessDeniedException when moving files:

Caused by: java.nio.file.AccessDeniedException: C:\Users\marc\.gradle\caches\8.11.1\transforms\861004acddba2701e93ae76fc6f706a8-770f8cf9-a2e1-495f-98f1-b5b0a064985f -> C:\Users\marc\.gradle\caches\8.11.1\transforms\861004acddba2701e93ae76fc6f706a8
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$moveAtomically$13(DefaultFileSystemAccess.java:229)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.write(DefaultFileSystemAccess.java:217)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.moveAtomically(DefaultFileSystemAccess.java:228)
        at org.gradle.internal.execution.steps.AssignImmutableWorkspaceStep$WorkspaceMoveHandler.executeMoveOr(AssignImmutableWorkspaceStep.java:273)
        ... 61 more

When I remove the kotlin plugin from the lib buildscript, then I can execute the clean task:

plugins {
    // Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
    //alias(libs.plugins.kotlin.jvm) <-here

    // Apply the java-library plugin for API and implementation separation.
    `java-library`
}

I tried to upgrade the plugin version to 2.0.21: same issue, downgrade to 1.9.25: same issue.

Looks like it's a global error when using the kotlin JVM plugin on Windows...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue.
Projects
None yet
Development

No branches or pull requests

4 participants