将 React Native 项目从版本 0.74.3 升级到 0.75.0 后,我遇到了构建问题。该问题仅出现在Android上; iOS 上一切正常。每当我尝试运行任何与 Android 相关的命令(例如 ./gradlew clean)时,我都会收到以下错误:
FAILURE: Build failed with an exception.
* Where:
Script '/Users/mehmetsozd/Desktop/almiratur/almira_app/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 418
* What went wrong:
Could not compile script '/Users/mehmetsozd/Desktop/almiratur/almira_app/node_modules/@react-native-community/cli-platform-android/native_modules.gradle'.
> startup failed:
script '/Users/mehmetsozd/Desktop/almiratur/almira_app/node_modules/@react-native-community/cli-platform-android/native_modules.gradle': 418: [Static type checking] - No such property: inputStream for class: java.lang.Process
@ line 418, column 31.
def output = process.inputStream.text.trim()
^
script '/Users/mehmetsozd/Desktop/almiratur/almira_app/node_modules/@react-native-community/cli-platform-android/native_modules.gradle': 418: [Static type checking] - No such property: text for class: java.lang.Object
@ line 418, column 43.
f output = process.inputStream.text.trim
^
script '/Users/mehmetsozd/Desktop/almiratur/almira_app/node_modules/@react-native-community/cli-platform-android/native_modules.gradle': 418: [Static type checking] - Cannot find matching method java.lang.Object#trim(). Please check if the declared type is correct and if the method exists.
@ line 418, column 24.
def output = process.inputStream.text.trim()
^
3 errors
* 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.
BUİLD FAILED in 332ms
有人在升级 React Native 后遇到过类似的问题吗?可能是什么原因造成的?我该如何解决?
任何帮助将不胜感激。谢谢!
当我进行清理时,我没有这个问题,但我确实在 Android 的条纹相关内容上遇到了构建问题