java - Android Studio 3 无法构建我的项目

标签 java android kotlin

我正在使用 Android Studio 3 预览版来编码和构建一个 android kotlin 项目,但由于此错误,它似乎无法编译:

: java.lang.Exception: Unable to get response from daemon in 10000 ms

Could not perform incremental compilation: Could not connect to Kotlin compile daemon Could not connect to kotlin daemon. Using fallback strategy.

Error:Failed to complete Gradle execution.

Cause:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

这是我的 gradle 构建文件

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.1.3-2'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha9'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


    apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.1'

    defaultConfig {
        applicationId "com.jr.app"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        buildConfigField "String", "DEMO_SERVER_URL", "https://demoserver.restlet.net/v1/"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:26.0.0'
    implementation 'com.android.support:design:26.0.0'
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.android.support:support-v4:26.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.0'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.0'
}

谢谢

最佳答案

也许你遇到了和我一样的错误。 我解决了here

关于java - Android Studio 3 无法构建我的项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45587932/

相关文章:

java - Android 错误 : Error generating final archive: java. io.FileNotFoundException:

java - 在 Java 中格式化大数字

java - 查找 AAR 依赖项

android - 尝试使用 react-native-dialogflow 分配给只读属性 - 错误

android - 无法从 Google 相册应用中选取图片

android - Gradle Kotlin DSL 的 versionCodeOverride 等价物

java - 获取 Facebook 通知 API 3.0

java - 由于 continue,for 循环数组中的基本 else 语句被忽略

java - 当第二次运行时,如何将两个不同的变量放入 recyclerview 中的 TextView 中?

java - 重写 Kotlin 的属性 setter 会导致两个 JPA @Id