gradle / gradle-native

The home of Gradle's support for natively compiled languages
https://blog.gradle.org/introducing-the-new-cpp-plugins
Apache License 2.0
91 stars 8 forks source link

How to solve Cannot snapshot output property 'outputDirectory'. #1108

Open Roa-chen opened 1 year ago

Roa-chen commented 1 year ago

Expected Behavior

I'm trying to build a react-native project created by default (so no problems normally), but when I use npx react-native run-android, I get the following error. When I run a program that I had already run before, since the outputs file exists, it does not cause any errors.

Current Behavior

`C:\Users\arsen\OneDrive\Documents\ReactNativeProjects\test>npx react-native run-android info JS server already running. info Installing the app...

Task :app:checkDebugAarMetadata FAILED 9 actionable tasks: 9 executed

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

2: Task failed with an exception.

BUILD FAILED in 1m 39s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

2: Task failed with an exception.

BUILD FAILED in 1m 39s

at makeError (C:\Users\arsen\OneDrive\Documents\ReactNativeProjects\test\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at C:\Users\arsen\OneDrive\Documents\ReactNativeProjects\test\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (C:\Users\arsen\OneDrive\Documents\ReactNativeProjects\test\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:82:7)
at async Command.handleAction (C:\Users\arsen\OneDrive\Documents\ReactNativeProjects\test\node_modules\@react-native-community\cli\build\index.js:108:9)

info Run CLI with --verbose flag for more details.`

Thanks in advance.