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

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

Open
Roa-chen opened this issue Apr 21, 2023 · 0 comments
Open

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

Roa-chen opened this issue Apr 21, 2023 · 0 comments

Comments

@Roa-chen
Copy link

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.

  • What went wrong:
    Execution failed for task ':app:checkDebugAarMetadata'.

A build operation failed.
Cannot snapshot output property 'outputDirectory'.
Cannot snapshot output property 'outputDirectory'.

  • 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.
==============================================================================

2: Task failed with an exception.

  • What went wrong:
    java.lang.StackOverflowError (no error message)

  • 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.
==============================================================================

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.

  • What went wrong:
    Execution failed for task ':app:checkDebugAarMetadata'.

A build operation failed.
Cannot snapshot output property 'outputDirectory'.
Cannot snapshot output property 'outputDirectory'.

  • 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.
==============================================================================

2: Task failed with an exception.

  • What went wrong:
    java.lang.StackOverflowError (no error message)

  • 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.
==============================================================================

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant