react native 命令打包时候的 Execution failed for task ':react-native-icons:verifyReleaseResources'.解决

在打包过程中 遇到:Execution failed for task ':react-native-icons:verifyReleaseResources'.,这是因为在项目中添加了第三防组件。这个问题原本不是rn版本的问题,原因是0.61.3将Android SDK的版本更新到28了,这与有些原生代码的插件不兼容了,因为第三方更新不及时,SDK还是旧的版本。

例如我遇到的是 react-native-icons版本问题 那么在rn项目中node_modules找到react-native-iconsandroid下的build.gradle文件改成新版的型号就好了。

 1 android {
 2     compileSdkVersion 28
 3     buildToolsVersion "23.0.1"
 4 
 5     defaultConfig {
 6         minSdkVersion 16
 7         targetSdkVersion 28
 8         versionCode 1
 9         versionName "1.0"
10     }
11     lintOptions {
12         abortOnError false
13     }
14 }
15 
16 repositories {
17     mavenCentral()
18 }
19 
20 dependencies {
21     implementation 'com.facebook.react:react-native:0.16.+'
22 }

compileSdkVersiontargetSdkVersion都改为28,把dependenciescompile改成implementation,再重新打包就不报错了

posted @ 2021-01-15 18:07  创客未来  阅读(982)  评论(0)    收藏  举报