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.

Anvil doesn't merge the interface: Component is not abstract and does not override abstract method

See original GitHub issue

Hi there,

I am running into this issue. Anvil merges modules but when i contribute an interface to scope, it results in this error: DaggerComponent is not abstract and does not override abstract method exampleMethod() in ExampleInterface

Example code:

abstract class AnvilAppScope private constructor()


@ContributesTo(AnvilAppScope::class)
interface ExampleInterface {
    fun exampleMethod(): ExampleClass
}



@AppScope
@MergeComponent(
    scope = AnvilAppScope::class,
    modules = [AndroidInjectionModule::class],
    dependencies = [Component1::class, Component2::class]
)
interface AppComponent {

   @Component.Builder
    interface Builder { ... }
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
vRallevcommented, Apr 6, 2021

No, the first example in the README shows that. This code snippet is very specific to your sample.

0reactions
sanginovscommented, Apr 6, 2021

great it works. thank you @vRallev. do you think it’s worth adding this example to README? (AppComponent.builder().build() as ComponentInterface).injectActivity(this)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Class is not abstract and does not override abstract method
The error I am receiving when I compile is: MyTestApp.Rectangle is not abstract and does not override abstract method drawEllipse(java.awt.
Read more >
is not abstract and does not override abstract method
I think this has something to do with the line containing the getSelectedItem() method.
Read more >
square/anvil: A Kotlin compiler plugin to make ... - GitHub
Anvil is a Kotlin compiler plugin to make dependency injection with Dagger easier by automatically merging Dagger modules and component interfaces.
Read more >
How do we fix the " is not abstract and does not override ...
This is an error message that points out that your method has a return type of String while the method you are trying...
Read more >
I keep getting an error: java: GUI is not abstract and does not ...
Your class implements an interface but does not override the interface method. You have a typo in your actionPerformed method name.
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