Kotlin room database crash on kotlin 1.2.40 version - android

after upgrading to kotlin 1.2.40 I have the following error at build:
e: [kapt] An exception occurred: java.lang.NoClassDefFoundError: org/jetbrains/kotlin/serialization/jvm/JvmProtoBufUtil
at me.eugeniomarletti.kotlin.metadata.KotlinClassMetadata$data$2.invoke(KotlinMetadata.kt:51)
at me.eugeniomarletti.kotlin.metadata.KotlinClassMetadata$data$2.invoke(KotlinMetadata.kt:50)
at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:131)
at me.eugeniomarletti.kotlin.metadata.KotlinClassMetadata.getData(KotlinMetadata.kt)
at android.arch.persistence.room.ext.KotlinMetadataProcessor$DefaultImpls.getParameterNames(KotlinMetadataProcessor.kt:33)
at android.arch.persistence.room.processor.PojoProcessor.getParameterNames(PojoProcessor.kt:73)
at android.arch.persistence.room.processor.PojoProcessor.getParamNames(PojoProcessor.kt:245)
at android.arch.persistence.room.processor.PojoProcessor.chooseConstructor(PojoProcessor.kt:263)
at android.arch.persistence.room.processor.PojoProcessor.doProcess(PojoProcessor.kt:207)
at android.arch.persistence.room.processor.PojoProcessor.access$doProcess(PojoProcessor.kt:73)
at android.arch.persistence.room.processor.PojoProcessor$process$1.invoke(PojoProcessor.kt:104)
at android.arch.persistence.room.processor.PojoProcessor$process$1.invoke(PojoProcessor.kt:73)
at android.arch.persistence.room.processor.cache.Cache$Bucket.get(Cache.kt:46)
at android.arch.persistence.room.processor.PojoProcessor.process(PojoProcessor.kt:101)
at android.arch.persistence.room.processor.EntityProcessor.doProcess(EntityProcessor.kt:68)
at android.arch.persistence.room.processor.EntityProcessor.access$doProcess(EntityProcessor.kt:50)
at android.arch.persistence.room.processor.EntityProcessor$process$1.invoke(EntityProcessor.kt:57)
at android.arch.persistence.room.processor.EntityProcessor$process$1.invoke(EntityProcessor.kt:50)
at android.arch.persistence.room.processor.cache.Cache$Bucket.get(Cache.kt:46)
at android.arch.persistence.room.processor.EntityProcessor.process(EntityProcessor.kt:56)
at android.arch.persistence.room.processor.DatabaseProcessor.processEntities(DatabaseProcessor.kt:248)
at android.arch.persistence.room.processor.DatabaseProcessor.doProcess(DatabaseProcessor.kt:63)
at android.arch.persistence.room.processor.DatabaseProcessor.process(DatabaseProcessor.kt:53)
at android.arch.persistence.room.RoomProcessor$DatabaseProcessingStep.process(RoomProcessor.kt:57)
at com.google.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:318)
at com.google.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:171)
at org.jetbrains.kotlin.kapt3.ProcessorWrapper.process(annotationProcessing.kt:131)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1039)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1180)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1068)
at org.jetbrains.kotlin.kapt3.AnnotationProcessingKt.doAnnotationProcessing(annotationProcessing.kt:87)
at org.jetbrains.kotlin.kapt3.AnnotationProcessingKt.doAnnotationProcessing$default(annotationProcessing.kt:45)
at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.runAnnotationProcessing(Kapt3Extension.kt:257)
at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:212)
at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:95)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM$analyzeFilesWithJavaIntegration$2.invoke(TopDownAnalyzerFacadeForJVM.kt:97)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:107)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:84)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:374)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:64)
at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:101)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:365)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:130)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:161)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:63)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:107)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:51)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:96)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:405)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:98)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:920)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:98)
at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:950)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:919)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:404)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.jetbrains.kotlin.serialization.jvm.JvmProtoBufUtil
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 77 more
After I changed to version 1.2.30 in my build-gradle the build worked, but now I have a mismatch between the version used by gradle (1.2.30) and the one bundled into the IDE plugin (1.2.40).
Is there anything I am doing wrong with the new kotlin version ? Or how can I downgrade to the 1.2.30 version ?
Thank you for the attention.

You can downgrade by downloading a plugin zip corresponding to your android studio version here: http://plugins.jetbrains.com/plugin/6954-kotlin
And use Settings | Plugins | Install plugin from disk and select the downloaded zip file.

The problem is that they've introduced a binary incompatibility in compiler-embeddable in Kotlin 1.2.40. There're a few options right now:
Downgrade Kotlin to the 1.2.30
Use the latest Kotlin version with the stable Room version (1.1.0). Then you must substitute the kotlin-compiler-embeddable dependency (see below).
Use the latest Kotlin version with the latest Room version (1.1.0-rc1). They've fix bug in RC1.
I'd use the 3d way and keep an eye on the Room's releases. But if you choose the 2nd one then you must insert this in your root build.gradle:
subprojects {
configurations.all {
resolutionStrategy {
eachDependency {
if (requested.name == "kotlin-compiler-embeddable") {
useVersion("1.2.30")
}
}
}
}
}

Related

java.lang.IllegalStateException: failed to analyze: com.sun.tools.javac.util.ClientCodeException: java.lang.NullPointerException

I am trying to adopt MVVM structure for that created some classes to get remote or local data using repo class with the help of ViewModel and I am also using DI to simplify the process
JDK version:
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
I am using java 8 like defined in: build.gradle
minSdkVersion 21
targetSdkVersion 28
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
Exception at compile time:
> Task :module-app:kaptDebugKotlin FAILED
e: java.lang.IllegalStateException: failed to analyze: com.sun.tools.javac.util.ClientCodeException: java.lang.NullPointerException
at org.jetbrains.kotlin.analyzer.AnalysisResult.throwIfError(AnalysisResult.kt:56)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:123)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:166)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:56)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:84)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:42)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:104)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:442)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:102)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:1005)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:102)
at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:138)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:1047)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:1004)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:441)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.sun.tools.javac.util.ClientCodeException: java.lang.NullPointerException
at com.sun.tools.javac.api.ClientCodeWrapper$WrappedTaskListener.finished(ClientCodeWrapper.java:685)
at com.sun.tools.javac.api.MultiTaskListener.finished(MultiTaskListener.java:111)
at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:987)
at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing(annotationProcessing.kt:67)
at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing$default(annotationProcessing.kt:36)
at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.runAnnotationProcessing(Kapt3Extension.kt:223)
at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:187)
at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:98)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM$analyzeFilesWithJavaIntegration$2.invoke(TopDownAnalyzerFacadeForJVM.kt:95)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:105)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:80)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:398)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:65)
at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:107)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:389)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:118)
... 30 more
Caused by: java.lang.NullPointerException
at org.jetbrains.kotlin.kapt3.base.incremental.TypeTreeVisitor.visitVariable(javacVisitors.kt:112)
at org.jetbrains.kotlin.kapt3.base.incremental.TypeTreeVisitor.visitVariable(javacVisitors.kt:50)
at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:864)
at com.sun.source.util.SimpleTreeVisitor.visit(SimpleTreeVisitor.java:53)
at org.jetbrains.kotlin.kapt3.base.incremental.TypeTreeVisitor.visitClass(javacVisitors.kt:75)
at org.jetbrains.kotlin.kapt3.base.incremental.TypeTreeVisitor.visitClass(javacVisitors.kt:50)
at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:720)
at org.jetbrains.kotlin.kapt3.base.incremental.MentionedTypesTaskListener.finished(javacVisitors.kt:39)
at com.sun.tools.javac.api.ClientCodeWrapper$WrappedTaskListener.finished(ClientCodeWrapper.java:681)
... 45 more
e: java.lang.IllegalStateException: failed to analyze: com.sun.tools.javac.util.ClientCodeException: java.lang.NullPointerException
Execution failed for task ':module-app:kaptDebugKotlin'.
> Internal compiler error. See log for more details
I am not able to find out what will be the error is? I have search a lot but still there is no relavent answer I have found. Is this Android studio error Or kotlin error or JDK error or eny code related error
Found that it can be due to filenames duplication.
https://discuss.kotlinlang.org/t/illegalstateexception-during-incremental-annotation-processing/14232
In my case it was a slightly different story (but similar in a term of duplication) - due to bad conflict resolution there were two similar companion objects in one class.
Spent two days, trying to identify the problem by commits comparisons

Android Databinding V2 fails for multi-module project

I have a multi-module Android project, with Kotlin, databinding v2, under Android Studio 3.1.3. Most of my databinding-enabled layouts are enclosed in library modules, which the final application module aggregates.
Problem starts when I want to add new layout in my application module, or override layout from one of library modules. After adding a test layout with <layout> tag to the application module, databinding stops generating, with the following error:
error: cannot find symbol
public static TestBinding bind(#NonNull View view, #Nullable DataBindingComponent component) {
^
symbol: class DataBindingComponent
location: class TestBinding
e: error: cannot generate view binders java.lang.NullPointerException
at android.databinding.tool.store.SetterStore.getMatchingMultiAttributeSetters(SetterStore.java:633)
at android.databinding.tool.store.SetterStore.getMultiAttributeSetterCalls(SetterStore.java:520)
at android.databinding.tool.BindingTarget.resolveMultiSetters(BindingTarget.java:220)
at android.databinding.tool.LayoutBinder.<init>(LayoutBinder.java:256)
at android.databinding.tool.DataBinder.<init>(DataBinder.java:55)
at android.databinding.tool.CompilerChef.ensureDataBinder(CompilerChef.java:95)
at android.databinding.tool.CompilerChef.sealModels(CompilerChef.java:259)
at android.databinding.annotationprocessor.ProcessExpressions.writeResourceBundle(ProcessExpressions.java:213)
at android.databinding.annotationprocessor.ProcessExpressions.onHandleStep(ProcessExpressions.java:111)
at android.databinding.annotationprocessor.ProcessDataBinding$ProcessingStep.runStep(ProcessDataBinding.java:203)
at android.databinding.annotationprocessor.ProcessDataBinding$ProcessingStep.access$000(ProcessDataBinding.java:188)
at android.databinding.annotationprocessor.ProcessDataBinding.doProcess(ProcessDataBinding.java:90)
at android.databinding.annotationprocessor.ProcessDataBinding.process(ProcessDataBinding.java:65)
at org.jetbrains.kotlin.kapt3.ProcessorWrapper.process(annotationProcessing.kt:131)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1068)
at org.jetbrains.kotlin.kapt3.AnnotationProcessingKt.doAnnotationProcessing(annotationProcessing.kt:87)
at org.jetbrains.kotlin.kapt3.AnnotationProcessingKt.doAnnotationProcessing$default(annotationProcessing.kt:45)
at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.runAnnotationProcessing(Kapt3Extension.kt:257)
at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:212)
at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:95)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM$analyzeFilesWithJavaIntegration$2.invoke(TopDownAnalyzerFacadeForJVM.kt:97)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:107)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:84)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:374)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:64)
at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:101)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:365)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:130)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:161)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:63)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:107)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:51)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:96)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:405)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:98)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:920)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:98)
at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:950)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:919)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:404)
at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
All DataBindingComponent interfaces from library modules are being generated, only the one from the application module is not generated.
I've had similar issue after migrating to androidx namespace. Make sure you've updated:
1.your gradle wrapper to 4.10.1 in gradle-wrapper-properties
2.you use gradle build plugin 3.3.0-beta-1
With this configuration everything works fine. Make also sure you don't have any databinding kapt or apt annotated dependencies in app.gradle as since 3.2.0 it is already bundled to gradle

Could not get unknown property 'manifestFile'

in Android studio gradle versions
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-4.5-20171123235935+0000-all.zip
classpath 'com.android.tools.build:gradle:3.1.0-alpha04'
its getting this error
Error:Could not get unknown property 'manifestFile' for task ':backend:generateDebugRFile' of type com.android.build.gradle.internal.res.GenerateLibraryRFileTask.
Trying to change gradle, Studio version etc no affect
First off, regular caveats about using pre-release (alpha) software apply: if you don't need to use the alpha for any particular reason, consider using the stable versions instead. Right now that means
Android Studio 3.0.1
Android Gradle Plugin 3.0.1 (a.k.a. com.android.tools.build:gradle:3.0.1)
With that out of the way....it could be that the 3.1.0-alpha04 plugin removed support for manifestFile, and some other plugin you're using still depends on that. After all, the tools team did remove the similarly-named manifestOutputFile in 3.0.
I tried building a project with
Gradle dist 4.4-rc-3
Android Gradle plugin 3.1.0-alpha04
Fabric Gradle plugin 1.25.0
that applied the fabric plugin and got an error message that looks a lot like the one you posted:
Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'manifestFile' for task ':libs:generateProdDebugRFile' of type com.android.build.gradle.internal.res.GenerateLibraryRFileTask.
at org.gradle.internal.metaobject.AbstractDynamicObject.getMissingProperty(AbstractDynamicObject.java:83)
at org.gradle.internal.metaobject.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:61)
at com.android.build.gradle.internal.res.GenerateLibraryRFileTask_Decorated.getProperty(Unknown Source)
at com.crashlytics.tools.gradle.CrashlyticsPlugin.addPluginTasks(CrashlyticsPlugin.groovy:239)
at com.crashlytics.tools.gradle.CrashlyticsPlugin.this$2$addPluginTasks(CrashlyticsPlugin.groovy)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at com.crashlytics.tools.gradle.CrashlyticsPlugin$_addPluginTasksToLibraryVariantsIn_closure4.doCall(CrashlyticsPlugin.groovy:122)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:71)
at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:160)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:106)
at org.gradle.util.ConfigureUtil$1.execute(ConfigureUtil.java:123)
at org.gradle.internal.ImmutableActionSet$SingletonSet.execute(ImmutableActionSet.java:155)
at org.gradle.internal.MutableActionSet.execute(MutableActionSet.java:35)
at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:204)
at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:198)
at com.android.build.gradle.LibraryExtension.addVariant(LibraryExtension.java:90)
at com.android.build.gradle.FeatureExtension.addVariant(FeatureExtension.java:108)
at com.android.build.gradle.internal.ApiObjectFactory.create(ApiObjectFactory.java:132)
at com.android.build.gradle.BasePlugin.lambda$createAndroidTasks$6(BasePlugin.java:709)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81)
at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:695)
at com.android.build.gradle.BasePlugin.lambda$null$4(BasePlugin.java:613)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81)
at com.android.build.gradle.BasePlugin.lambda$createTasks$5(BasePlugin.java:609)
at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:91)
at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:80)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42)
at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:230)
at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:149)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58)
at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:324)
at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:234)
at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:140)
at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy26.afterEvaluate(Unknown Source)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:76)
... 81 more
Had a similar problem with Crashlytics integration and found that I needed to add
crashlytics { instantAppSupport true }
This was needed even though I am not using Instant Apps.
Found from this answer in SO

taskdef A class needed by class com.android.ant.GetUiTargetTask cannot be found: com/android/utils/ILogger

After I update Android Studio to version 2.3, When I make my project I got this error
/Users/xxx/Work/yyy/build.xml:96: taskdef A class needed by class com.android.ant.GetUiTargetTask cannot be found: com/android/utils/ILogger
using the classloader AntClassLoader[/Users/xxx/Library/Android/sdk/tools/lib/ant-tasks.jar:/Users/xxx/Library/Android/sdk/tools/lib/kxml2-2.3.0.jar:/Users/xxx/Library/Android/sdk/tools/lib/gson-2.2.4.jar:/Users/xxx/Library/Android/sdk/tools/lib/commons-compress-1.8.1.jar:/Users/xxx/Library/Android/sdk/tools/lib/httpclient-4.1.1.jar:/Users/xxx/Library/Android/sdk/tools/lib/httpmime-4.1.jar:/Users/xxx/Library/Android/sdk/tools/lib/httpcore-4.1.jar:/Users/xxx/Library/Android/sdk/tools/lib/commons-logging-1.1.1.jar:/Users/xxx/Library/Android/sdk/tools/lib/commons-codec-1.4.jar]
at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:612)
at org.apache.tools.ant.taskdefs.Definer.loadProperties(Definer.java:408)
at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:264)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:180)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:93)
at org.apache.tools.ant.Main.runBuild(Main.java:832)
at org.apache.tools.ant.Main.startAnt(Main.java:236)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:287)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:113)
Caused by: java.lang.NoClassDefFoundError: com/android/utils/ILogger
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:579)
... 16 more
Caused by: java.lang.ClassNotFoundException: com.android.utils.ILogger
at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1384)
at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1333)
at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1088)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 19 more
And this is the code line in build.xml that mentioned
<taskdef resource="anttasks.properties" classpathref="android.antlibs" />
<property name="exe" value="" />
<property name="bat" value="" />
Before update I never see this error. How I fix this error.
You need to copy the mentioned files from tools that still have them, like windows version:
ant/*
lib/ant-tasks.jar
lib/common.jar
lib/sdklib.jar
lib/guava-17.0.jar
lib/manifest-merger.jar
I've downloaded and installed android tools version 25.2.3 that still have ant that fix this problem

Migration to Gradle plugin v.1.1.2 caused failing lint checks

My team recently decided to use newly announced unit-testing integration in Android studio, which requires upgrading Gradle plugin version to 1.1.0 or higher. But this update caused failing of Lint task for one of our modules, with very weird error. Can anyone give an idea what might be a problem here?
Caused by: java.lang.ArrayIndexOutOfBoundsException: 2459
at org.eclipse.jdt.internal.compiler.lookup.TypeSystem.getUnannotatedType(TypeSystem.java:82)
at org.eclipse.jdt.internal.compiler.lookup.TypeSystem.getParameterizedType(TypeSystem.java:138)
at org.eclipse.jdt.internal.compiler.lookup.TypeSystem.getParameterizedType(TypeSystem.java:172)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createParameterizedType(LookupEnvironment.java:946)
at org.eclipse.jdt.internal.compiler.lookup.Scope$Substitutor.substitute(Scope.java:511)
at org.eclipse.jdt.internal.compiler.lookup.Scope.substitute(Scope.java:435)
at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.superclass(ParameterizedTypeBinding.java:1212)
at com.android.tools.lint.EcjParser$EcjResolvedClass.isSubclassOf(EcjParser.java:1025)
at com.android.tools.lint.checks.CleanupDetector.checkResourceRecycled(CleanupDetector.java:219)
at com.android.tools.lint.checks.CleanupDetector.visitMethod(CleanupDetector.java:180)
at com.android.tools.lint.client.api.JavaVisitor$DelegatingJavaVisitor.visitMethodInvocation(JavaVisitor.java:1314)
at lombok.ast.MethodInvocation.accept(MethodInvocation.java:114)
at lombok.ast.BinaryExpression.accept(BinaryExpression.java:131)
at lombok.ast.ExpressionStatement.accept(ExpressionStatement.java:63)
at lombok.ast.Block.accept(Block.java:106)
at lombok.ast.Try.accept(Try.java:107)
at lombok.ast.Block.accept(Block.java:106)
at lombok.ast.MethodDeclaration.accept(MethodDeclaration.java:240)
at lombok.ast.NormalTypeBody.accept(NormalTypeBody.java:57)
at lombok.ast.ClassDeclaration.accept(ClassDeclaration.java:239)
at lombok.ast.NormalTypeBody.accept(NormalTypeBody.java:57)
at lombok.ast.ClassDeclaration.accept(ClassDeclaration.java:239)
at lombok.ast.CompilationUnit.accept(CompilationUnit.java:83)
at com.android.tools.lint.client.api.JavaVisitor.visitFile(JavaVisitor.java:263)
at com.android.tools.lint.client.api.LintDriver.checkJava(LintDriver.java:1491)
at com.android.tools.lint.client.api.LintDriver.runFileDetectors(LintDriver.java:1026)
at com.android.tools.lint.client.api.LintDriver.checkProject(LintDriver.java:882)
at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.java:433)
at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.java:374)
at com.android.tools.lint.LintCliClient.run(LintCliClient.java:130)
at com.android.build.gradle.internal.LintGradleClient.run(LintGradleClient.java:112)
at com.android.build.gradle.internal.LintGradleClient$run.call(Unknown Source)
at com.android.build.gradle.tasks.Lint.runLint(Lint.groovy:198)
at com.android.build.gradle.tasks.Lint.this$4$runLint(Lint.groovy)
at com.android.build.gradle.tasks.Lint$this$4$runLint$1.callCurrent(Unknown Source)
at com.android.build.gradle.tasks.Lint.lintSingleVariant(Lint.groovy:173)
at com.android.build.gradle.tasks.Lint$lintSingleVariant$0.callCurrent(Unknown Source)
at com.android.build.gradle.tasks.Lint.lint(Lint.groovy:75)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:579)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:562)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 47 more

Categories

Resources