无法修复:找不到 kotlin-reflect-1.3.72.jar (org.jetbrains.kotlin:kotlin-reflect:1.3.72)
Posted
技术标签:
【中文标题】无法修复:找不到 kotlin-reflect-1.3.72.jar (org.jetbrains.kotlin:kotlin-reflect:1.3.72)【英文标题】:cannot fix: Could not find 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 代码或插件。
我尝试:
-
下载他告诉我的库并添加它。
添加依赖项:
实现“org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version”
类路径“org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version”
编译“org.jetbrains.kotlin:kotlin-stdlib-jdk8”
添加 maven url "https://jitpack.io"
清理项目
重启 android Studio 和我的电脑
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
【问题讨论】:
【参考方案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')它不起作用但是现在当我复制你粘贴的版本时它起作用了,我不知道为什么,谢谢你以上是关于无法修复:找不到 kotlin-reflect-1.3.72.jar (org.jetbrains.kotlin:kotlin-reflect:1.3.72)的主要内容,如果未能解决你的问题,请参考以下文章
无法解析配置“:classpath”的所有工件。无法解析 org.jetbrains.kotlin:kotlin-reflect:1.2.71