React Native: Error while building project

馋奶兔 提交于 2019-12-12 23:41:00

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!