首页 > 解决方案 > 错误处理 kotlin-stdlib-1.4.0.jar - 反应原生

问题描述

我想运行我的项目,但收到以下错误消息:

BUILD FAILED in 4s
162 actionable tasks: 2 executed, 160 up-to-date
error processing /private/var/root/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.4.0/63e75298e93d4ae0b299bb869cf0c627196f8843/kotlin-stdlib-1.4.0.jar

我的 build.gradle 文件:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.3.0'
    repositories {
        google()
       jcenter ()
        mavenCentral()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        maven {
            url 'https://dl.google.com/dl/android/maven2/'
            name 'Google'
        }
        maven { url "https://jitpack.io" }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        // classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.google.gms:google-services:4.0.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
              //mavenLocal()
         maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
               
         google()
         // maven { url 'http://jcenter.bintray.com' }

        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
         // ADD THIS
      maven { url 'https://maven.google.com' }

      // ADD THIS
      maven { url "https://jitpack.io" }
      jcenter()


        flatDir {
        dirs 'src/main/assets/libs'
        }
        
    }
}


subprojects {
    // project.configurations.all {
    //     resolutionStrategy.eachDependency { details ->
    //         if (details.requested.group == 'com.android.support'
    //                 && !details.requested.name.contains('multidex') ) {
    //             details.useVersion "27.0.2"
    //         }
    //     }
    // }
        project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "26.+"
            }
            if (details.requested.group == 'com.google.android.gms'
            && !details.requested.name.contains('multidex') && !details.requested.name.contains('play-services-stats')) {
                details.useVersion "12.+"
            }
            if (details.requested.group == 'com.google.android.gms'
            && !details.requested.name.contains('multidex') && details.requested.name.contains('play-services-stats')) {
                details.useVersion "+"
            }
        }
    }
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion rootProject.ext.compileSdkVersion
                buildToolsVersion rootProject.ext.buildToolsVersion
            }
        }
    }    
}

ext {
    buildToolsVersion = "28.0.3"
    compileSdkVersion = 28
    targetSdkVersion = 28

    //compileSdkVersion   = 27
    //targetSdkVersion    = 27
    //buildToolsVersion   = "27.0.3"
    supportLibVersion   = "28.0.3"
    googlePlayServicesVersion = "15.0.1"
    minSdkVersion       = 19
    // firebaseVersion     = "16.0.3"
    // firebaseMessageVersion = "17.3.2"
    googlePlayServicesAuthVersion = "15.0.1"
    googlePlayServicesAuthVersionNew = "16.0.0"
    // firebaseDatabase = "16.0.2"
}

我正在使用 RN 0.55.4。

标签: javascriptreact-nativekotlin

解决方案


推荐阅读