react-native Android release打包失败

npm run build报错(android)

react-native 0.5x在安卓环境 gradle 3.x版本下编译release版本的时候提示编译失败,但是debug模式下是没有问题的。

错误信息

Could not find com.android.tools.lint:lint-gradle:26.1.1
Execution failed for task ‘:app:processReleaseResources’
Execution failed for task ‘:app:lintVitalRelease’

解决方案

  1. android/gradle.properties 里添加
 android.enableAapt2=false
  1. android/app/build.gradle中添加
lintOptions {
  abortOnError false checkReleaseBuilds false
}

ps: 这一步可能不需要

猜你喜欢

转载自www.cnblogs.com/qiqi715/p/9404383.html