0

When I am running

gradlew build --refresh-dependencies

I get errors like

Execution failed for task ':react-native-fcm:lint'.

When I see lint-results.html I get error like

../../build.gradle: All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 26.1.0, 23.4.0. Examples include com.android.support:support-compat:26.1.0 and com.android.support:animated-vector-drawable:23.4.0 ../../build.gradle: All gms/firebase libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 17.3.4, 17.0.4, 17.0.1, 16.2.4, 16.0.6, 16.0.5, 16.0.4, 16.0.3, 16.0.1, 16.0.0. Examples include com.google.firebase:firebase-messaging:17.3.4 and com.google.firebase:firebase-iid:17.0.4

my build.gradle looks like this

apply plugin: "com.android.application"

    import com.android.build.OutputFile


    project.ext.react = [
        entryFile: "index.js",
        entryFileforesatte: "index.foresatte.js",
        bundleInRelease: true,
        bundleInelevRelease: true,
        bundleInforesatteRelease: true
    ]

    apply from: "../flavored-react.gradle"
    apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"


    def enableProguardInReleaseBuilds = false

    android {

      lintOptions {
            abortOnError false
        }

        compileSdkVersion 27
        flavorDimensions "default"
        buildToolsVersion '27.0.3'

        defaultConfig {
            applicationId "com.osloskolen"
            minSdkVersion 16
            targetSdkVersion 26
            versionCode 28
            versionName "1.28.0"
            multiDexEnabled true
            ndk {
                abiFilters "armeabi-v7a", "x86"
            }
        }

        splits {
            abi {
                reset()
                enable enableSeparateBuildPerCPUArchitecture
                universalApk false  // If true, also generate a universal APK
                include "armeabi-v7a", "x86"
            }
        }
        productFlavors {
            elev {
                minSdkVersion 16
                applicationId ''
                targetSdkVersion 22

            }
            foresatte {
                minSdkVersion 16
                applicationId ''
                targetSdkVersion 22


            }
        }
        signingConfigs {
            release {
                if (project.hasProperty('OSLOSKOLEN_RELEASE_STORE_FILE')) {
                    storeFile rootProject.file(OSLOSKOLEN_RELEASE_STORE_FILE)
                    storePassword OSLOSKOLEN_RELEASE_STORE_PASSWORD
                    keyAlias OSLOSKOLEN_RELEASE_KEY_ALIAS
                    keyPassword OSLOSKOLEN_RELEASE_KEY_PASSWORD
                }
            }
        }
        buildTypes {
            debug {
                buildConfigField "String", "CODEPUSH_KEY", ''
                manifestPlaceholders = [excludeSystemAlertWindowPermission: "false"]
            }

            /*releaseStaging  {
                minifyEnabled enableProguardInReleaseBuilds
                proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
                signingConfig signingConfigs.release
                buildConfigField "String", "CODEPUSH_KEY", ''
            }*/

            release {
                minifyEnabled enableProguardInReleaseBuilds
                proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
                signingConfig signingConfigs.release
                manifestPlaceholders = [excludeSystemAlertWindowPermission: "true"]
                //buildConfigField "String", "CODEPUSH_KEY", ''
            }

        }
        // applicationVariants are e.g. debug, release
        applicationVariants.all { variant ->
            variant.outputs.each { output ->
                // For each separate APK per architecture, set a unique version code as described here:
                // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
                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
                }
            }
        }
    }

    dependencies {
        compile project(':react-native-code-push')
        compile project(':react-native-vector-icons')
        compile project(':react-native-sound')
        compile project(':react-native-fs')
        compile project(':react-native-fcm')
        compile 'com.google.firebase:firebase-core:16.0.0'
        compile project(':react-native-document-picker')
        compile project(':react-native-doc-viewer')
        compile project(':react-native-splash-screen')
        compile project(':appcenter-crashes')
        compile project(':appcenter-analytics')
        compile project(':appcenter')
        compile project(':react-native-code-push')
        compile fileTree(dir: "libs", include: ["*.jar"])
        compile "com.android.support:appcompat-v7:23.0.1"
        compile "com.facebook.react:react-native:+"  // From node_modules
    }

    // Run this once to be able to run the application with BUCK
    // puts all compile dependencies into folder libs for BUCK to use
    task copyDownloadableDepsToLibs(type: Copy) {
        from configurations.compile
        into 'libs'
    }

    apply plugin: 'com.google.gms.google-services'

I am not sure where the issue is. I have added

  lintOptions {
      abortOnError false
  }

but still I get this error. I want to solve this error. Any insight?

mohsinali1317
  • 4,255
  • 9
  • 46
  • 85
  • Did you check this: https://stackoverflow.com/questions/42374151/all-com-android-support-libraries-must-use-the-exact-same-version-specification ? – Rudy Jan 30 '19 at 08:04
  • yes I did checked it but couldn't solved the issue at hand. – mohsinali1317 Jan 30 '19 at 08:20

0 Answers0