Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Android doesn't work #21

Open
caijiami opened this issue Dec 15, 2021 · 0 comments
Open

Android doesn't work #21

caijiami opened this issue Dec 15, 2021 · 0 comments

Comments

@caijiami
Copy link

$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1014 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Installing the app...
:ReactNative:Unexpected empty result of running '[node, -e, console.log(require('react-native/cli').bin);]' command.
:ReactNative:Running '[node, -e, console.log(require('react-native/cli').bin);]' command failed.

FAILURE: Build failed with an exception.

  • Where:
    Script '/Users/caijiami/Desktop/react-navigation-ex-demo/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 170

  • What went wrong:
    A problem occurred evaluating script.

internal/modules/cjs/loader.js:883 throw err; ^Error: Cannot find module 'react-native/cli'Require stack:- /Users/caijiami/.gradle/daemon/5.5/[eval] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) at Function.Module._load (internal/modules/cjs/loader.js:725:27) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at [eval]:1:13 at Script.runInThisContext (vm.js:133:18) at Object.runInThisContext (vm.js:310:38) at internal/process/execution.js:77:19 at [eval]-wrapper:6:22 at evalScript (internal/process/execution.js:76:60) { code: 'MODULE_NOT_FOUND', requireStack: [ '/Users/caijiami/.gradle/daemon/5.5/[eval]' ]}

  • 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 490ms

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Unexpected empty result of running '[node, -e, console.log(require('react-native/cli').bin);]' command.
:ReactNative:Running '[node, -e, console.log(require('react-native/cli').bin);]' command failed.

FAILURE: Build failed with an exception.

  • Where:
    Script '/Users/caijiami/Desktop/react-navigation-ex-demo/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 170

  • What went wrong:
    A problem occurred evaluating script.

internal/modules/cjs/loader.js:883 throw err; ^Error: Cannot find module 'react-native/cli'Require stack:- /Users/caijiami/.gradle/daemon/5.5/[eval] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) at Function.Module._load (internal/modules/cjs/loader.js:725:27) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at [eval]:1:13 at Script.runInThisContext (vm.js:133:18) at Object.runInThisContext (vm.js:310:38) at internal/process/execution.js:77:19 at [eval]-wrapper:6:22 at evalScript (internal/process/execution.js:76:60) { code: 'MODULE_NOT_FOUND', requireStack: [ '/Users/caijiami/.gradle/daemon/5.5/[eval]' ]}

  • 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 490ms

at checkExecSyncError (child_process.js:616:11)
at execFileSync (child_process.js:634:15)
at runOnAllDevices (/Users/caijiami/Desktop/react-navigation-ex-demo/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)
at buildAndRun (/Users/caijiami/Desktop/react-navigation-ex-demo/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:179:41)
at /Users/caijiami/Desktop/react-navigation-ex-demo/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:133:12
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Command.handleAction (/Users/caijiami/Desktop/react-navigation-ex-demo/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:182:9)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

进程已结束,退出代码为 1

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

No branches or pull requests

1 participant