JAVA Android APK发布模式错误无法下载kotlin-compiler.jar [英] JAVA Android APK release mode error Could not download kotlin-compiler.jar

查看:110
本文介绍了JAVA Android APK发布模式错误无法下载kotlin-compiler.jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在发布模式下构建新APK或生成签名APK时,出现以下错误:

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

无法下载kotlin-compiler.jar(com.android.tools.external.com-intellij:kotlin-compiler:26.1.4):离线模式没有可用的缓存版本

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

这是我的Gradle代码:

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'
}

我不是使用Kotlin,而是普通的Java Android.

I am not using Kotlin, just regular Java Android.

我该怎么做才能解决此问题?

What should I do to fix this issue?

推荐答案

1)确保您已连接到互联网.
2)转到文件->设置->构建,执行,部署-> gradle->确保您未选中离线工作"复选框
3)重建项目,然后再次尝试构建apk

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

这篇关于JAVA Android APK发布模式错误无法下载kotlin-compiler.jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆