用kotlin设置领域时出错
我在现有的Android项目中使用了一些kotlin类(已经有领域),kotlin类没有使用任何领域功能,现在在运行时我得到这个错误
: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.
我的应用程序的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.daggerCompiler kapt presentationDependencies.butterKnifeCompiler
可能修复它。
- 将生成的值添加到RealmObject
- 领域和自动增量行为(Android)
- 错误:Parceler:无法找到类型io.realm.RealmList的读/写生成器
- TransformException:java.util.zip.ZipException:重复条目:io / realm / annotations / Ignore.class
- 在Kotlin项目中应用Realm插件会导致编译错误
- Kotlin没有领域的吸气二传手
- Android的测试在领域的kotlin
- Realm插件导致“app:compileInstantrunconfigDebugKotlin”任务失败
- 境界不是kotlin架构的一部分