【发布时间】:2020-07-11 13:01:54
【问题描述】:
我是 react native 和 android 开发的新手。 目前我想构建一个 APK,但我遇到了这个错误。
**FAILURE:构建失败并出现异常。 * 什么地方出了错: 无法确定任务 ':app:lintVitalRelease' 的依赖关系。
无法解析配置“:app:releaseRuntimeClasspath”的所有任务依赖项。 无法解析项目:react-native-cookies。 要求: 项目:应用程序 无法找到项目的匹配配置:react-native-cookies:所有可消耗的配置都没有属性。**
在 build.gradle 文件中
release {
signingConfig signingConfigs.release
matchingFallbacks = ['release', 'debug']
}
}
dependencies {
implementation project(':react-native-cookies')
implementation project(':react-native-clear-app-cache')
implementation project(':react-native-vector-icons')
implementation project(':react-native-image-picker')
implementation project(':react-native-linear-gradient')
implementation project(':react-native-gesture-handler')
implementation project(':react-native-reanimated')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation project(':react-native-orientation')
}
在 app/build.gradle 文件中
buildscript {
ext {
buildToolsVersion = "28.0.3" //28.0.3
minSdkVersion = 16
compileSdkVersion = 28 //28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
我不知道如何解决,因为我多次尝试修改 buildToolsVersion、buildTypes 等。有什么想法可以解决这个问题吗?请帮忙。
【问题讨论】:
-
我通过 ./gradlew clean build --refresh-dependencies 解决了这个问题
标签: android react-native build.gradle