【问题标题】:android studio generate signed apk problem ( Could not find kotlin-compiler-27.0.1.jar )android studio生成签名apk问题(找不到kotlin-compiler-27.0.1.jar)
【发布时间】: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
}

【问题讨论】:

标签: java android-studio


【解决方案1】:

你需要使用代理或vpn来解决这个问题。或者可以改变:

classpath "com.android.tools.build:gradle:4.0.1"

classpath "com.android.tools.build:gradle:4.0.0"

并使用 gradle 插件版本 6.5

【讨论】:

    猜你喜欢
    • 2021-01-05
    • 1970-01-01
    • 1970-01-01
    • 2018-09-23
    • 1970-01-01
    • 2013-12-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多