Run react-native info in your terminal and paste its contents here.
React Native Environment Info:
System:
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i3-2310M CPU @ 2.10GHz
Memory: 1.43 GB / 7.91 GB
Binaries:
Yarn: 1.12.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.2.0.0 AI-181.5540.7.32.5056338
I want to build APK release from React Native project. Unfortunately, I got this error.
Starting a Gradle Daemon, 1 incompatible and 3 stopped Daemons could not be reused, use --status for details
FAILURE: Build failed with an exception.
* What went wrong:
Failed to capture snapshot of input files for task ':app:bundleReleaseJsAndAssets' property '$1' during up-to-date check.
> Could not read path '${RN_PROJECT_DIRECTORY}\node_modules\@babel\parser\.bin\parser'.
* 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
Create new React Native project with react-native-cli, for example:
react-native init sampleApp
cd sampleApp/android && gradlew assembleRelease
I assume you tried ./gradlew clean and restarting your computer? I find Gradle's caches can cause strange behavior often not worth debugging without trying the above.
I just execute gradlew clean only, not restart the computer, Mr @bartolkaruza .
@achmadk I have the same problem, have you solved it?
Not yet @YanmaY .
${RN_PROJECT_DIRECTORY}\node_modules\@babel\parser.bin\parser
This bit looks wrong, but I can't figure out where that path is configured. The variable is not substituted and I think the parser should be at \node_modules\.bin\parser instead of inside @babel. Could you post a log of ./gradlew assembleRelease --info?
I solved the problem by revert yarn to version 1.9.4 just now @YanmaY
Here is the stacktrace
* Exception is:
org.gradle.api.UncheckedIOException: Failed to capture snapshot of input files for task ':app:bundleReleaseJsAndAssets' property '$1' during up-to-date check.
at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.snapshotTaskFiles(CacheBackedTaskHistoryRepository.java:333)
at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.createExecution(CacheBackedTaskHistoryRepository.java:154)
at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.access$100(CacheBackedTaskHistoryRepository.java:61)
at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository$1.getCurrentExecution(CacheBackedTaskHistoryRepository.java:114)
at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.getStates(DefaultTaskArtifactStateRepository.java:201)
at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:86)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.GradleException: Could not read path '${RN_ROOT_PROJECT}\node_modules\@babel\parser\.bin\parser'.
at org.gradle.api.internal.file.collections.jdk7.Jdk7DirectoryWalker$1.visitFileFailed(Jdk7DirectoryWalker.java:110)
at org.gradle.api.internal.file.collections.jdk7.Jdk7DirectoryWalker$1.visitFileFailed(Jdk7DirectoryWalker.java:59)
at org.gradle.api.internal.file.collections.jdk7.Jdk7DirectoryWalker.walkDir(Jdk7DirectoryWalker.java:59)
at org.gradle.api.internal.file.collections.DirectoryFileTree.walkDir(DirectoryFileTree.java:155)
at org.gradle.api.internal.file.collections.DirectoryFileTree.visitFrom(DirectoryFileTree.java:133)
at org.gradle.api.internal.file.collections.DirectoryFileTree.visit(DirectoryFileTree.java:118)
at org.gradle.api.internal.changedetection.state.DefaultFileSystemSnapshotter.snapshotDirectoryTree(DefaultFileSystemSnapshotter.java:137)
at org.gradle.api.internal.changedetection.state.AbstractFileCollectionSnapshotter$FileCollectionVisitorImpl.visitDirectoryTree(AbstractFileCollectionSnapshotter.java:98)
at org.gradle.api.internal.file.collections.FileTreeAdapter.visitRootElements(FileTreeAdapter.java:118)
at org.gradle.api.internal.file.CompositeFileCollection.visitRootElements(CompositeFileCollection.java:185)
at org.gradle.api.internal.changedetection.state.AbstractFileCollectionSnapshotter.snapshot(AbstractFileCollectionSnapshotter.java:53)
at org.gradle.api.internal.changedetection.state.DefaultGenericFileCollectionSnapshotter.snapshot(DefaultGenericFileCollectionSnapshotter.java:38)
at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.snapshotTaskFiles(CacheBackedTaskHistoryRepository.java:331)
... 32 more
Caused by: java.nio.file.NotDirectoryException: ${RN_ROOT_PROJECT}\node_modules\@babel\parser\.bin\parser
... 43 more
* Get more help at https://help.gradle.org
I also encountered this. Seems to be a problem with newer Yarn versions on Windows.
[email protected] is OK @achmadk @thomanau
I have downgraded yarn version to 1.10.1 then it works. Thank you @YanmaY .
[email protected] is OK @achmadk @thomanau
I am using yarn version 1.12.1 and I got the same problem.
I have downgraded yarn version to 1.10.1 then it works too. Thank @YanmaY.
Step by step:
yarn installI think this problem has been fixed at yarn v1.12.3. You can update to recent version or keep installed yarn version to 1.10.1.
@achmadk why did you re-open this issue? Is there something on React Native side that still needs to be changed? If not, you can close this as resolved; people will find your solution (upgrade yarn) through Google regardless of the issue being closed.
sorry for inconvenience @bartolkaruza . I will close this issue.
@achmadk @tronginc How to install yarn version 1.10.1
This issue has been solved since yarn release version 1.12.3, @voanhtuan318 . You can either install yarn version 1.12.3 or latest version (1.13.0)
@achmadk I have the same issue when I run ./gradlew assembleRelease
Could not read path node_modules\@babel\parser.bin\parser'.
and the yarn version is 1.12.1, I'm tried to upgrade it but it's not upgraded
my command is yarn upgrade --latest
Most helpful comment
[email protected] is OK @achmadk @thomanau