【问题标题】:cannot fix: Could not find kotlin-reflect-1.3.72.jar (org.jetbrains.kotlin:kotlin-reflect:1.3.72)无法修复:找不到 kotlin-reflect-1.3.72.jar (org.jetbrains.kotlin:kotlin-reflect:1.3.72)
【发布时间】:2021-04-02 00:38:11
【问题描述】:

我提取了我的朋友写的代码,现在我得到了这个错误:

Could not find kotlin-reflect-1.3.72.jar (org.jetbrains.kotlin:kotlin-reflect:1.3.72).
Searched in the following locations:
    https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.3.72/kotlin-reflect-1.3.72.jar

我的 Fried 怎么没有使用任何 kotlin 代码或插件。

我尝试:

  1. 下载他告诉我的库并添加它。
  2. 添加依赖项:
      实现“org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version”
      类路径“org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version”
      编译“org.jetbrains.kotlin:kotlin-stdlib-jdk8”
  3. 添加 maven { url "https://jitpack.io" }
  4. 清理项目
  5. 重启 Android Studio 和我的电脑
  6. delete gradle cash(没成功)

我的朋友没有收到此错误,但我收到了,当我返回版本时,错误消失了,但随后我们丢失了代码。
我觉得我别无选择

这是我的 gradle(应用程序):

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.example.rems"
        minSdkVersion 17
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        vectorDrawables.useSupportLibrary = true

        testInstrumentationRunner "androidx.mini_window_style.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main {
            resources {
                srcDirs 'src/main/resources'
            }
            java {
                srcDirs 'src/main/java', 'src/main/java/module'
            }
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.navigation:navigation-fragment:2.1.0'
    implementation 'androidx.navigation:navigation-ui:2.1.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.viewpager2:viewpager2:1.0.0'
    implementation 'com.google.android.material:material:1.1.0'
    implementation files('libs\\natty-0.13.jar')
    implementation files('libs/antlr-4.9-complete.jar')
    implementation files('libs\\antlr-4.9-complete.jar')
    implementation files('libs\\slf4j-android-1.7.30.jar')
    testImplementation 'junit:junit:4.12'
    implementation 'org.slf4j:slf4j-api:1.7.30'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    //noinspection GradleCompatible
    implementation "com.android.support:support-compat:28.0.0"
    implementation files('libs\\natty-0.13.jar')
    implementation files('libs\\antlr-4.9-complete.jar')

}

这就是我的 gradle(android 项目):

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

buildscript {
    
    repositories {
        google()
        jcenter()
        
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.1'

        

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

【问题讨论】:

    标签: android android-studio gradle


    【解决方案1】:

    您的build.gradle(Project:android) 文件应如下所示:

    buildscript {
        repositories {
            google()
            jcenter()
        }
        dependencies {
            classpath "com.android.tools.build:gradle:3.4.1"
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31"
        }
    }
    
    allprojects {
        repositories {
            google()
            jcenter()
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    

    【讨论】:

    • 好的,当我保留我的版本时(类路径'com.android.tools.build:gradle:4.1.1')它不起作用但是现在当我复制你粘贴的版本时它起作用了,我不知道为什么,谢谢你
    猜你喜欢
    • 2017-10-24
    • 2020-01-31
    • 1970-01-01
    • 2020-03-05
    • 2019-06-15
    • 2017-01-25
    • 2019-05-22
    • 2017-01-29
    • 1970-01-01
    相关资源
    最近更新 更多