问题
Initially, everything was working fine, I was trying to update the build:gradle and SDK versions
I am getting the following while building the project
Gradle sync failed: More than one variant of project :react-native-fetch-blob matches the consumer attributes:
- Configuration ':react-native-fetch-blob:debugApiElements' variant android-aidl:
- Found artifactType 'android-aidl' but wasn't required.
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
- Configuration ':react-native-fetch-blob:debugApiElements' variant android-classes:
- Found artifactType 'android-classes' but wasn't required.
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wa... (show balloon)
Below is the build.gradlew file of react-native-fetch-blob
apply plugin: 'com.android.library'
repositories {
mavenCentral()
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile 'com.facebook.react:react-native:+'
//{RNFetchBlob_PRE_0.28_DEPDENDENCY}
}
I have no idea what's going on
looking forward for much need help
thank you
回答1:
There seems to be an issue with google-services 3.3.0
Change it to classpath 'com.google.gms:google-services:3.2.1'
and it should work fine.
来源:https://stackoverflow.com/questions/50324269/react-native-error-while-building-project