【发布时间】:2020-03-03 10:34:05
【问题描述】:
我有一个 react native 0.61 应用程序,它运行良好,但我知道并非没有任何变化。这是react-native run-android时的错误:
FAILURE: Build failed with an exception.
* Where:
Script 'C:\D\code\js\emps_fe7\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 182
* What went wrong:
A problem occurred evaluating script.
> Text must not be null or empty
* 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 4s
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.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* Where:
Script 'C:\D\code\js\emps_fe7\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 182
* What went wrong:
A problem occurred evaluating script.
> Text must not be null or empty
* 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 4s
at checkExecSyncError (child_process.js:629:11)
at execFileSync (child_process.js:647:13)
at runOnAllDevices (C:\d\code\js\emps_fe7\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (C:\d\code\js\emps_fe7\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at then.result (C:\d\code\js\emps_fe7\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12)
at process._tickCallback (internal/process/next_tick.js:68:7)
我所做的是从头开始重建项目并一个一个地添加每个模块。但是错误是完全相同的。该项目曾经很好,并且已经从中生成了apk。我有点迷失在这里可能会出什么问题。这里是package.json的依赖:
"dependencies": {
"@react-native-community/async-storage": "^1.6.2",
"moment": "^2.24.0",
"react": "16.9.0",
"react-native": "0.61.4",
"react-native-cli": "^2.0.1",
"react-native-confirmation-code-field": "^4.1.0",
"react-native-device-info": "^5.2.1",
"react-native-elements": "^1.2.7",
"react-native-gesture-handler": "^1.5.0",
"react-native-gifted-chat": "^0.11.3",
"react-native-keychain": "^4.0.1",
"react-native-linear-gradient": "^2.5.6",
"react-native-modal": "^11.5.1",
"react-native-modal-datetime-picker": "^7.6.0",
"react-native-reanimated": "^1.4.0",
"react-native-segmented-control-tab": "^3.4.1",
"react-native-vector-icons": "^6.6.0",
"react-native-video": "^5.0.2",
"react-navigation": "^4.0.10",
"react-navigation-stack": "^1.10.3",
"react-navigation-tabs": "^2.5.6",
"socket.io-client": "2.1.1"
},
【问题讨论】:
标签: android react-native