【发布时间】: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
}
【问题讨论】:
标签: android android-studio gradle