Edd*_*ddy 8 android build.gradle react-native
我是 React Native 和 Android 开发的新手。目前我想构建一个APK,但我遇到了这个错误。
**失败:构建因异常而失败。* 出了什么问题:无法确定任务“:app:lintVitalRelease”的依赖关系。
无法解析配置“:app:releaseRuntimeClasspath”的所有任务依赖项。无法解析项目:react-native-cookies。要求者:project :app 无法找到project :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')
}
Run Code Online (Sandbox Code Playgroud)
在 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
}
}
Run Code Online (Sandbox Code Playgroud)
我不知道如何解决,因为我多次尝试修改buildToolsVersion、buildTypes等。有解决这个问题的想法吗?请帮忙。
小智 -1
替换android/app/build.gradle
:
...
androidTestImplementation 'androidx.test:runner:1.2.1' // old
androidTestImplementation 'androidx.test:runner:1.3.0-alpha03' // new
...
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.1' // old
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha03' // new
...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
18304 次 |
| 最近记录: |