[英]android studio generate signed apk problem ( Could not find kotlin-compiler-27.0.1.jar )
當我想在 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 工作室版本 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
}
您需要使用代理或 vpn 來解決此問題。或者可以更改:
classpath "com.android.tools.build:gradle:4.0.1"
至
classpath "com.android.tools.build:gradle:4.0.0"
並使用 gradle 插件版本 6.5
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.