android-使用kotlin设置领域时出错

android-使用kotlin设置领域时出错,第1张

概述我在现有的Android项目中使用了一些kotlin类(已经具有领域),kotlin类未使用任何领域功能,现在在运行时出现此错误:app:compileDebugKotlinUsingkotlinincrementalcompilation:app:compileDebugJavaWithJavacDestinationforgeneratedsourceswasmodifiedbykapt.Previ

我在现有的Android项目中使用了一些kotlin类(已经具有领域),kotlin类未使用任何领域功能,现在在运行时出现此错误

:app:compileDeBUGKotlinUsing kotlin incremental compilation:app:compileDeBUGJavaWithJavacDestination for generated sources was modifIEd by kapt. PrevIoUs value = /home/debu/AndroIDStudioProjects/WT_Application/app/build/generated/source/apt/deBUGerror: Annotation processor '__gen.AnnotationProcessorWrapper_deBUG_io_realm_processor_RealmProcessor' not found1 error:app:compileDeBUGJavaWithJavac Failed:app:copyDeBUGKotlinClasses SKIPPEDFAILURE: Build Failed with an exception. 

我的应用程序的build.gradle

apply plugin: 'com.androID.application'apply plugin: 'kotlin-androID'apply plugin: 'realm-androID'androID {    def globalConfiguration = rootProject.extensions.getByname("ext")    compileSdkVersion globalConfiguration.getAt("androIDCompileSdkVersion")    buildToolsversion globalConfiguration.getAt("androIDBuildToolsversion")    defaultConfig {        applicationID globalConfiguration.getAt("androIDApplicationID")        minSdkVersion globalConfiguration.getAt("androIDMinSdkVersion")        targetSdkVersion globalConfiguration.getAt("androIDTargetSdkVersion")        versionCode globalConfiguration.getAt("androIDVersionCode")        versionname globalConfiguration.getAt("androIDVersionname")        testInstrumentationRunner globalConfiguration.getAt("testInstrumentationRunner")        /*jackOptions {            enabled true        }*/    }    buildTypes {        release {            MinifyEnabled false            proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro'        }    }    compileOptions {        sourceCompatibility JavaVersion.VERSION_1_7        targetCompatibility JavaVersion.VERSION_1_7    }    dataBinding {        enabled = true    }}dependencIEs {    def presentationDependencIEs = rootProject.ext.presentationDependencIEs    def presentationTestDependencIEs = rootProject.ext.presentationTestDependencIEs    def developmentDependencIEs = rootProject.ext.developmentDependencIEs    compile presentationDependencIEs.dagger    compile presentationDependencIEs.butterKnife    compile presentationDependencIEs.recyclerVIEw    compile presentationDependencIEs.cardvIEw    compile presentationDependencIEs.rxJava    compile presentationDependencIEs.rxAndroID    compile presentationDependencIEs.appcompat    compile presentationDependencIEs.constraintLayout    compile presentationDependencIEs.design    compile presentationDependencIEs.retrofit    compile presentationDependencIEs.gsonconverter    compile presentationDependencIEs.rxjavaadapter    compile presentationDependencIEs.glIDe    compile presentationDependencIEs.flexBox    compile presentationDependencIEs.maps    compile presentationDependencIEs.mapUtils    compile presentationDependencIEs.pagerIndicator    annotationProcessor presentationDependencIEs.daggerCompiler    annotationProcessor presentationDependencIEs.butterKnifeCompiler    provIDed presentationDependencIEs.javaxAnnotation    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"    androIDTestCompile presentationTestDependencIEs.junit    androIDTestCompile presentationTestDependencIEs.mockito    androIDTestCompile presentationTestDependencIEs.dexmaker    androIDTestCompile presentationTestDependencIEs.dexmakerMockito    androIDTestCompile presentationTestDependencIEs.espresso    androIDTestCompile presentationTestDependencIEs.testingSupportlib    //Development    compile developmentDependencIEs.leakCanary    compile files('libs/YouTubeAndroidplayerAPI.jar')}repositorIEs {    mavenCentral()}

项目build.gradle

apply from: 'buildsystem/dependencIEs.gradle'buildscript {    ext.kotlin_version = '1.1.2-4'    repositorIEs {        jcenter()        mavenCentral()    }    dependencIEs {        classpath 'com.androID.tools.build:gradle:2.3.2'        classpath "io.realm:realm-gradle-plugin:3.2.0"        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 {    ext {        androIDApplicationID = 'com.wandertrails'        androIDVersionCode = 1        androIDVersionname = "1.0"        testInstrumentationRunner = "androID.support.test.runner.AndroIDJUnitRunner"        testApplicationID = 'com.wandertrails.test'    }}task clean(type: Delete) {    delete rootProject.buildDir}

现在有人可以找出这个错误的原因吗?

解决方法:

apply plugin: 'com.androID.application'apply plugin: 'kotlin-androID'apply plugin: 'kotlin-kapt'apply plugin: 'realm-androID'

kapt presentationDependencIEs.daggerCompilerkapt presentationDependencIEs.butterKnifeCompiler

可能会修复它.

总结

以上是内存溢出为你收集整理的android-使用kotlin设置领域时出错全部内容,希望文章能够帮你解决android-使用kotlin设置领域时出错所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/web/1080460.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存