Error configuring scope with kotlin

I am using some kotlin classes in an existing android project (already having scope), kotlin classes do not use any realm function, now at runtime I get this error

:app:compileDebugKotlin
Using kotlin incremental compilation
:app:compileDebugJavaWithJavac
Destination for generated sources was modified by kapt. Previous value = /home/debu/AndroidStudioProjects/WT_Application/app/build/generated/source/apt/debug

error: Annotation processor '__gen.AnnotationProcessorWrapper_debug_io_realm_processor_RealmProcessor' not found
1 error

:app:compileDebugJavaWithJavac FAILED
:app:copyDebugKotlinClasses SKIPPED

FAILURE: Build failed with an exception. 

      

my app 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()
}

      

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

      

Now can someone figure out what is the cause of this error ????

+3


source to share


1 answer


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

      

and



kapt presentationDependencies.daggerCompiler
kapt presentationDependencies.butterKnifeCompiler

      

You can fix this.

+3


source







All Articles