-1

I have an interface that was once functional. Now I'd like it to have more abstract methods so I added them to the interface and changed all implementations to override those methods. I use retrolambda in my project. When I run the app I get the following error:

Error:incompatible types: DeviceCheckCallback is not a functional interface multiple non-overriding abstract methods found in interface DeviceCheckCallback

Why am I seeing this? I don't want this interface to be functional anymore?

Booyaches
  • 1,669
  • 4
  • 27
  • 40
  • 1
    Either, you still have the `@FunctionalInterface` annotation at that interface or you have lambda expressions where that interface type is expected. Or you didn’t recompile all classes. But it’s strange that you get this *at runtime*. – Holger Jul 06 '16 at 11:18

1 Answers1

4

The interface you are trying to provide a Lambda for has more than one method. Lambda's can only be used for interfaces that have a single method (which they call a "Functional Interface")

john16384
  • 7,800
  • 2
  • 30
  • 44
  • 1
    I have found all the usages of that interface and changed the implementation to override newly defined methods. I do not try to provide lambda to that interface and I do not have `@FunctionalInterface` annotaion. – Booyaches Jul 06 '16 at 11:25
  • 1
    Perhaps you are including a Jar or something that is still expecting the old unchanged interface. It sounds like you did not change all the users of that interface or didn't recompile the code as Holger suggested. – john16384 Jul 06 '16 at 11:34