Skip to content

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

@Roa-chen

Description

@Roa-chen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions