Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

apk

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?

like image 293
carolina Avatar asked Aug 16 '18 13:08

carolina


1 Answers

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

like image 87
Doflaminhgo Avatar answered Nov 15 '22 03:11

Doflaminhgo