运行“ npx react-native run-android”命令时出现构建失败错误

时间:2019-12-19 15:37:35

标签: react-native build.gradle react-native-android

错误:解析模块App/Config时,发现了Haste软件包App。但是,在软件包中找不到模块Config。实际上,这些文件都不存在

遇到此错误,尝试通过 npm cache clean 解决,也遵循了https://github.com/oblador/react-native-vector-icons/issues/626#issuecomment-357405396,但问题未解决。

试图通过运行 rm ./node_modules/react-native/local-cli/core / __ fixtures __ / files / package.json 命令来解决此问题,但是在核心目录中没有目录,只有一个.js文件。

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
warn The following packages use deprecated "rnpm" config that will stop working from next release:
  - react-native-vector-icons: https://github.com/oblador/react-native-vector-icons
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
error While resolving module `App/Config`, the Haste package `App` was found. However the module `Config` could not be found within the package. Indeed, none of these files exist:

  * `/home/bhanwar/react_native/App/Config(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`
  * `/home/bhanwar/react_native/App/Config/index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`. Run CLI with --verbose flag for more details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleDebugJsAndAssets'.
> Process 'command 'npx'' finished with non-zero exit value 1

* 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 1m 47s

    at checkExecSyncError (child_process.js:621:11)
    at execFileSync (child_process.js:639:15)
    at runOnAllDevices (/home/bhanwar/react_native/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)
    at buildAndRun (/home/bhanwar/react_native/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41)
    at /home/bhanwar/react_native/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:125:12
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
    at async Command.handleAction (/home/bhanwar/react_native/node_modules/@react-native-community/cli/build/index.js:164:9)

0 个答案:

没有答案
相关问题