Error:(100, 48) error: static interface method invocations are not supported in -source 1.7 (use -source 8 or higher to enable static interface method invocations)
the line looks like this:
field = SomeInterface.someMethod("","","");
and the interface:
public interface SomeInterface extends AnotherInterface {
public static SomeInterface someMethod(String arg1,String arg2,String arg3) throws IOException {
return someMethod(arg1,arg2,arg3,SOME_CONSTANT,ANOTHER_CONSTANT);
}
}
How to fix this?
Since static interface method invocations were introduced in Java 8, you have to add the Java 8 compatibility options in your build.gradle file to enable Java 8 language features:
android {
...
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With