1

最初,一切正常,我试图更新 build:gradle 和 SDK 版本

我在构建项目时得到以下信息

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)

下面是 react-native-fetch-blob 的 build.gradlew 文件

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}
}

我不知道是怎么回事

期待非常需要帮助

谢谢你

4

1 回答 1

3

google-services 3.3.0 似乎存在问题

将其更改为classpath 'com.google.gms:google-services:3.2.1',它应该可以正常工作。

于 2018-05-14T07:34:00.067 回答