react native Task :expo-av:configureCMakeDebug[arm64-v8a] FA



我转移到M1机器并获得expo-av的此错误,我找不到与此错误相关的任何内容,它只发生在android中…

项目运行命令:npx react-native run-android构建错误:

> Task :expo-av:configureCMakeDebug[arm64-v8a] FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':expo-av:configureCMakeDebug[arm64-v8a]'.
> [CXX1405] exception while building Json A problem occurred starting process 'command '/Users/macbook/Library/Android/sdk/cmake/3.18.1/bin/cmake''
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

Package.json

"expo": "^46.0.0",
"expo-av": "~12.0.4",
"react-native": "0.69.6",

npx react-native info输出:

info Fetching system and libraries information...
System:
OS: macOS 12.5
CPU: (8) arm64 Apple M1
Memory: 227.61 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 19.0.1 - /opt/homebrew/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 7.24.2 - ~/Desktop/project/node_modules/.bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
Android SDK:
API Levels: 29, 30, 31, 33
Build Tools: 30.0.3, 31.0.0, 33.0.0
System Images: android-31 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9123335
Xcode: 14.1/14B47b - /usr/bin/xcodebuild
Languages:
Java: 11.0.17 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0 
react-native: 0.69.6 => 0.69.6 
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found

这可能是一个小问题?我不确定……

Android Studio config:

SDK Platforms
Android Tiramisu (Tiramisu)
-> Android SDK Platform 33 (installed)
-> Google APIs ARM 64 v8a System Image (installed)
-> Google Play ARM 64 v8a System Image (installed)
Android 12.0 (S)
-> Android SDK Platform 31 (installed) // as per my project's build.gradle
-> Google APIs ARM 64 v8a System Image (installed)
-> Google Play ARM 64 v8a System Image (installed)
Android 11.0 (R)
-> Android SDK Platform 30 (installed)
Android 10.0 (Q)
-> Android SDK Platform 29 (installed)
SDK Tools
-> 33.0.0 (installed)
-> 31.0.0 (installed)
-> 30.0.3 (installed)
NDK (side by side)
-> 21.4.7075529 (installed)
-> 24.0.8215888 (installed) // as per my project's build.gradle
Android SDK Command-line Tools (latest)
-> Android SDK Command-line Tools (latest)  8.0 (installed)
CMake
-> 3.22.1  (installed)
-> 3.18.1  (installed)
Android Emulator  31.3.13 (installed)
Android SDK Platform-Tools   33.0.3 (installed)

我试了:cd android/ && ./gradlew clean && cd .. && npx react-native run-android但没有运气…

UPDATE - 1:

我能够使用以下步骤重现完全相同的构建错误,并且我还共享了一个可重复的repo: https://github.com/theartificialguy/rn-m1

1) on an M1 MacBook -> npx react-native init m1project --version 0.69.6
2) npx react-native run-android -> It was working.
3) npx install-expo-modules@latest
4) npx expo install expo-av
5) npx react-native run-android -> Got the same build error as mentioned in the title.

有人能解释一下这个问题吗?

如果有人需要更多的信息,我可以提供,只要问你需要什么…

打开Android Studio ->SDK管理器->SDK工具->CMake取消选中检查选项并重新安装它并尝试重新构建它

不要手动更新expo

获取之前的expo版本并安装该版本。

相关内容

最新更新