错误:任务':app:kaptDebugKotlin'的执行失败 [英] Error:Execution failed for task ':app:kaptDebugKotlin'
本文介绍了错误:任务':app:kaptDebugKotlin'的执行失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是刚开始使用Kotlin并尝试使用Dagger2进行设置的人,我已经看到了一些示例,但似乎没有一个适合我.
I'm new to using Kotlin and trying to set it up with Dagger2, I've seen some few examples but none of them seem to work for me.
我不断得到这个
错误:任务':app:kaptDebugKotlin'的执行失败.
Error:Execution failed for task ':app:kaptDebugKotlin'.
内部编译器错误.请参阅日志以获取更多详细信息
Internal compiler error. See log for more details
我有我的build.gradle(模块:应用程序)
I have my build.gradle (Module: app)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.exampleapp"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
kapt {
generateStubs = true
}
dexOptions {
javaMaxHeapSize "2048M"
}
}
ext {
supportLibVer = '25.0.0'
daggerVer = '2.8'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// Support lib
compile "com.android.support:appcompat-v7:${supportLibVer}"
kapt "com.google.dagger:dagger-compiler:${daggerVer}"
compile "com.google.dagger:dagger:${daggerVer}"
provided "javax.annotation:jsr250-api:${javaxVer}"
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}
repositories {
mavenCentral()
}
推荐答案
使用./gradlew clean build
命令运行您的应用程序,以查看您的代码到底有什么问题.只需将其粘贴到Android Studio的终端中即可.
Run your application with ./gradlew clean build
command to see what's exactly wrong with your code. Just paste it into the Terminal in Android Studio.
这篇关于错误:任务':app:kaptDebugKotlin'的执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文