我遇到以下错误
Android依赖项'com.android.support:appcompat-v7'对于编译(25.3.1)和运行时(27.1.0)类路径具有不同的版本。您应该通过DependencyResolution手动设置相同的版本
以下是我的build.gradle文件
apply plugin: "com.android.application"
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.hauz"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0.1"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
lintOptions {
abortOnError false
disable 'MissingTranslation'
}
allprojects {
repositories {
// The order in which you list these repositories matter.
google()
jcenter()
}
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support:appcompat-v7'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.0.1"
}
}
}
}
}
dependencies {
implementation project(':react-native-share')
implementation project(':react-native-svg')
implementation project(':react-native-navigation')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7"
implementation "com.facebook.react:react-native"
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native"
implementation project(':react-native-navigation')}
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}