运行react-native 代码react-native run-android时出现以下错误.它工作正常.但在从git和npm ci获得新的拉力之后,在我运行之后,就会出现这个错误.

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
   > The minCompileSdk (30) specified in a
     dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
     is greater than this module's compileSdkVersion (android-29).
     Dependency: androidx.core:core:1.7.0-alpha01.
     AAR metadata file: C:\Users\gauraab\.gradle\caches\transforms-2\files-2.1\9e02d64f5889006a671d0a7165c73e72\core-1.7.0-alpha01\META-INF\com\android\build\gradle\aar-metadata.properties.

推荐答案

我只是把compileSdkVersion=29改为compileSdkVersion=30

React-native相关问答推荐

为什么我的expoav视频不会自动播放?

React Native 组件中两次使用map的问题

useState 函数似乎阻止了 Animated.timing 事件?

RNMK - 超级表达式必须为空或函数

错误发生意外错误:https://registry.yarnpkg.com/react-native-template-react-native-template-typescript:未找到

在 iOS 模拟器中运行 React Native 应用程序时找不到 UMModuleRegistryAdapter.h

redux-saga:如何以编程方式为yields 创建多个calls/side-effects?

打包程序无法启动

Soundcloud API /stream 端点给出 401 错误

React-Native:Facebook 和 Google 登录

使用带有 react-native 的 WebView 设置用户代理

React Native - 如何判断 UI/元素?

Yarn 在哪里存储离线包?

如何将 View 定位在 ScrollView 的底部?

React Native - Firebase 身份验证持久性不起作用

React Native onLayout 与 React Hooks

当前未启用语法nullishCoalescingOperator

如何升级 react-native gradle 版本

如何在 react-native 中为带有图标的按钮建模

React-Native 获取 XML 数据