【发布时间】:2020-11-21 13:28:03
【问题描述】:
当我想在 android studio 中生成签名的 apk(发布版本不是调试版本)时,导致这个错误:
找不到 kotlin-compiler-27.0.1.jar (com.android.tools.external.com-intellij:kotlin-compiler:27.0.1)。 在以下位置搜索: https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/kotlin-compiler/27.0.1/kotlin-compiler-27.0.1.jar
构建项目并运行没有错误但生成签名的apk显示顶部错误
我在 android studio 3.6 版中遇到了这个问题,我更新到 4.0.1 版,gradle 是 6.1.1 但没有任何改变,我仍然有这个错误
我还创建了空的新项目并且不再添加代码,但是当生成签名 apk 时存在错误.. 我的代码中没有使用 kotlin
我的 gradle 内容:
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.example.testapp"
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://maven.google.com' }
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://maven.google.com' }
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
【问题讨论】:
-
dl.google.com/dl/android/maven2/com/android/tools/external/… 是一个有效链接并指向正确的 JAR。您是否可能在干扰的代理背后?
-
你解决了吗?我面临同样的错误
标签: java android-studio