JAVA Android APK release mode error Could not download kotlin-compiler.jar

六月ゝ 毕业季﹏ 提交于 2020-01-24 09:19:46

问题


When i build a new APK or generate a signed APK in release mode I get the following error:

Could not download kotlin-compiler.jar (com.android.tools.external.com-intellij:kotlin-compiler:26.1.4): No cached version available for offline mode

This is my Gradle code:

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
    applicationId "com.example.caro.customelements"
    minSdkVersion 23
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
 }
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}

I am not using Kotlin, just regular Java Android.

What should I do to fix this issue?


回答1:


1) make sure you are connected to the internet.
2) go to file->settings->build, execution, deployment -> gradle -> make sure you have unchecked the "offline work" checkbox
3) rebuild the project and try build apk again



来源:https://stackoverflow.com/questions/51878497/java-android-apk-release-mode-error-could-not-download-kotlin-compiler-jar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!