我有一个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"
},