简体   繁体   English

为什么集成React Native时compileSdkVersion错误?

[英]Why compileSdkVersion is wrong when integrating React Native?

While integrating React Native into an existing Android project, we get the following error when we try to sync the project:在将 React Native 集成到现有 Android 项目时,我们在尝试同步项目时收到以下错误:

A problem occurred evaluating project ':react-native-restart'.评估项目“:react-native-restart”时出现问题。 Unsupported value: 28. Format must be one of:不支持的值:28。格式必须是以下之一:

  • android-31 android-31
  • android-31-ext2 android-31-ext2
  • android-T机器人-T
  • vendorName:addonName:31供应商名称:插件名称:31

The error is thrown by node_modules/react-native-restart/android/build.gradle , on this line:该错误由node_modules/react-native-restart/android/build.gradle ,在这一行:

compileSdkVersion safeExtGet('compileSdkVersion')

In the Android project build.gradle we have:在 Android 项目build.gradle ,我们有:

compileSdkVersion 31
minSdkVersion 26
targetSdkVersion 31

Any idea?任何的想法?

Because it is defined in a package level here https://github.com/avishayil/react-native-restart/blob/master/android/gradle.properties因为它是在包级别定义的https://github.com/avishayil/react-native-restart/blob/master/android/gradle.properties

compileSdkVersion=28
minSdkVersion=16
targetSdkVersion=28

You can change it in your node_modules and save changes using patch-package您可以在 node_modules 中更改它并使用 patch-package 保存更改

https://github.com/ds300/patch-package https://github.com/ds300/patch-package

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 React Native 中未指定 compileSdkVersion 错误 Android - compileSdkVersion is not specified error in React Native Android 集成React Native Navigation时无法运行React Native应用 - Unable to run React Native app when integrating React Native Navigation 在反应本机中集成本机UI? - Integrating native UI in react native? 将Crashlytics集成到React Native - Android - Integrating Crashlytics into React Native - Android 为什么清单文件中有 compileSdkVersion? - Why is there compileSdkVersion in manifest file? react-native-audio-recorder-player 错误 未找到 ID 为“kotlin-android”的插件。 compileSdkVersion 未指定 - react-native-audio-recorder-player error Plugin with id "kotlin-android" not found. compileSdkVersion is not specified 配置项目“:@react-native-firebase_messaging”时出现问题。 > compileSdkVersion 未指定 - A problem occurred configuring project ':@react-native-firebase_messaging'. > compileSdkVersion is not specified 我有两个不同的反应原生包需要不同的android compileSdkVersion,我该如何解决这个问题? - I've two different react native packages which require different android compileSdkVersion, how do I fix this? REACT NATIVE由于不存在额外的属性扩展,因此无法获取属性“ compileSdkVersion” - REACT NATIVE Cannot get property 'compileSdkVersion' on extra properties extension as it does not exist 将本机代码集成到现有的 android 项目中 - Integrating react native code into existing android project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM