android-studio - 下载kotlin-stdlib-1.3.71.pom时,Android Studio似乎卡住了

标签 android-studio kotlin gradle

我有一个仅使用Java代码的android项目。但是我想同时使用Kotlin和Java进行开发。
所以我只是通过向我的项目中添加了Kotlin类文件New -> Kotlin File/ Class
由于这是该项目第一次暴露给Kotlin,因此它会自动将一些依赖项添加到Gradle文件中。
但是现在我同步了我的项目,但是似乎android studio卡住了,而现在下载kotlin-stdlib-1.3.71.pom差不多22分钟了
Reference Image
我的网络连接稳定,但似乎根本无法完成
供你引用 :
应用程序级别build.gradle文件

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
    compileSdkVersion 29
    buildToolsVersion '29.0.3'
    defaultConfig {
        applicationId "in.morningbell.app"
        minSdkVersion 19
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true

    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    buildFeatures{
        viewBinding = true
    }


}

dependencies {

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation "androidx.core:core-ktx:1.3.0"                    // added automatically actually it was ktx:+ i replaced it to 1.3.0
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72" // added automatically, it was jdk7:$kotlin_version I replaced version
}
repositories {
    mavenCentral()
}
项目级别的build.gradle文件
buildscript {
    ext.kotlin_version = '1.3.72'
    repositories {
        google()
        jcenter()
        
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"  // added automatically 
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io'
        }

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
我只是想知道Gradle文件有什么问题吗?我感谢您的帮助
谢谢

最佳答案

最后,我通过更改摆脱了这个错误

 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72"
 implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.72"
并通过添加
apply plugin: 'kotlin-android-extensions'
在应用程序级别build.gradle文件的顶部

关于android-studio - 下载kotlin-stdlib-1.3.71.pom时,Android Studio似乎卡住了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62790532/

相关文章:

java - android studio中的应用程序源代码给了我很多错误

android-studio - Flutter-如何将容器小部件与图像以及图像下方的文本/图标一起使用

android - 如何从 Kotlin 函数类型返回

bash - Gradle Wrapper编译和构建代码并运行单个单元测试

spring-boot - 在Kotlin/Spring Boot中使用Gradle属性扩展

android-studio - Android模拟器时区在启动时发出警告

android - 构造函数在 kotlin 派生类中采用 Parcelable 构造函数

android - 运行 Spek 测试显示错误 "Empty test suite"

eclipse - 将Eclipse Android Junit测试迁移到Android Studio Gradle

java - 如何将我在 EditText 框中键入的数据添加到数组中以在另一个 Activity 中列出?