question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[2.30] NoSuchElementException in KotlinMetadata.java

See original GitHub issue

Since updating to 2.30, compiling is failing during the kapt step. Here’s the bottom of the stacktrace. Unfortunately I can’t tell from this error where the problem occurs.

Caused by: java.util.NoSuchElementException
	at dagger.internal.codegen.extension.DaggerCollectors$ToOptionalState.getElement(DaggerCollectors.java:145)
	at dagger.internal.codegen.extension.DaggerCollectors.lambda$static$1(DaggerCollectors.java:61)
	at dagger.internal.codegen.kotlin.KotlinMetadata.findProperty(KotlinMetadata.java:260)
	at dagger.internal.codegen.kotlin.KotlinMetadata.lambda$mapFieldToAnnotationMethod$8(KotlinMetadata.java:226)
	at dagger.internal.codegen.kotlin.KotlinMetadata.mapFieldToAnnotationMethod(KotlinMetadata.java:222)
	at dagger.internal.codegen.kotlin.KotlinMetadata.lambda$new$4(KotlinMetadata.java:122)
	at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:167)
	at dagger.internal.codegen.kotlin.KotlinMetadata.isMissingSyntheticAnnotationMethod(KotlinMetadata.java:321)
	at dagger.internal.codegen.kotlin.KotlinMetadataUtil.isMissingSyntheticPropertyForAnnotations(KotlinMetadataUtil.java:77)
	at dagger.internal.codegen.validation.DependencyRequestValidator.checkQualifiers(DependencyRequestValidator.java:77)
	at dagger.internal.codegen.validation.DependencyRequestValidator.validateDependencyRequest(DependencyRequestValidator.java:68)
	at dagger.internal.codegen.validation.InjectValidator.validateDependencyRequest(InjectValidator.java:256)
	at dagger.internal.codegen.validation.InjectValidator.validateField(InjectValidator.java:212)
	at dagger.internal.codegen.validation.InjectValidator.validateMembersInjectionType(InjectValidator.java:268)
	at dagger.internal.codegen.validation.InjectBindingRegistryImpl.tryRegisterMembersInjectedType(InjectBindingRegistryImpl.java:281)
	at dagger.internal.codegen.validation.InjectBindingRegistryImpl.tryRegisterMembersInjectedType(InjectBindingRegistryImpl.java:265)
	at dagger.internal.codegen.InjectProcessingStep$1.visitVariableAsField(InjectProcessingStep.java:54)
	at dagger.internal.codegen.InjectProcessingStep$1.visitVariableAsField(InjectProcessingStep.java:44)
	at jdk.compiler/com.sun.tools.javac.code.Symbol$VarSymbol.accept(Symbol.java:1576)
	at dagger.internal.codegen.InjectProcessingStep.process(InjectProcessingStep.java:76)
	at dagger.internal.codegen.validation.TypeCheckingProcessingStep.lambda$process$0(TypeCheckingProcessingStep.java:51)
	at com.google.common.collect.RegularImmutableMap.forEach(RegularImmutableMap.java:185)
	at dagger.internal.codegen.validation.TypeCheckingProcessingStep.process(TypeCheckingProcessingStep.java:48)
	at dagger.internal.codegen.validation.TypeCheckingProcessingStep.process(TypeCheckingProcessingStep.java:34)
	at dagger.shaded.auto.common.BasicAnnotationProcessor$ProcessingStepAsStep.process(BasicAnnotationProcessor.java:495)
	at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:228)
	at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:208)
	at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.process(incrementalProcessors.kt)
	at org.jetbrains.kotlin.kapt3.base.ProcessorWrapper.process(annotationProcessing.kt:161)
	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:980)
	... 42 more

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:14
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
danysantiagocommented, Nov 21, 2020

By any chance do you use Kotlin’s Android extensions (apply plugin: 'kotlin-android-extensions')?

1reaction
GuilhEcommented, Nov 23, 2020

Yes, our module has kotlin-android-extension. I noticed that in that module, we didnt setup Kotlin extensions just for parcelizer. After adding androidExtensions { features = ['parcelize'] }, build finished without NoSuchElementException.

I’ll complement this answer with androidExtensions .kts version:

androidExtensions {
    features = mutableSetOf("parcelize")
}

Just a small not also: Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix the No Such Element Exception in Java - Rollbar
The NoSuchElementException in Java can be thrown by various accessor methods to indicate that the element being requested does not exist.
Read more >
NoSuchElementException java.lang.Scanner - Stack Overflow
I would just use val input = Scanner(System.`in`). If you enter 9 integers in the console the initialization of the Packing objects should ......
Read more >
How to Fix java.util.NoSuchElementException in Java?
NoSuchElementException: It is the child class of RuntimeException and hence it is an unchecked exception.
Read more >
NoSuchElementException (Java Platform SE 8 )
Constructs a NoSuchElementException , saving a reference to the error message string s for later retrieval by the getMessage method.
Read more >
A crash -- java.util.NoSuchElementException: List is empty.
I could not replicate in any of my devices or emulators, It's reported in firebase crashlytics. Error log: Fatal Exception: java.util.NoSuchElementException: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found