代码之家  ›  专栏  ›  技术社区  ›  mohsinali1317

Gradle构建失败的lint问题

  •  0
  • mohsinali1317  · 技术社区  · 6 年前

    当我跑步的时候

    gradlew构建--刷新依赖项

    我会犯这样的错误

    任务“:react native fcm:lint”的执行失败。

    当我看到皮棉的结果。我得到的错误是

    ../../建筑格雷德尔:好的。安卓支持库必须使用完全相同的版本规范(混合版本可能会导致运行时崩溃)。找到了版本26.1.0和23.4.0。例如com。安卓支持:支持compat:26.1.0和com。安卓支持:动画矢量可绘制:23.4.0 ../../建筑gradle:所有gms/firebase库必须使用完全相同的版本规范(混合版本可能会导致运行时崩溃)。找到了版本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。例如com。谷歌。firebase:firebase消息:17.3.4和com。谷歌。firebase:firebase iid:17.0.4

    我的身材。格雷德尔看起来像这样

    应用插件:“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'
    

    我不确定问题出在哪里。我补充说

      lintOptions {
          abortOnError false
      }
    

    但我还是犯了这个错误。我想解决这个错误。有什么见解吗?

    0 回复  |  直到 6 年前