(AndroidStudio)Fix not Implemented exception when using Java and Kotlin in multi-module project

23 views Asked by At

This is sample code for multi-module project of mine.

Module A

// Test.java
package com.test

public interface Test {
  @NonNull
  String getTestName();
}

Module B

// Test.kt
package com.test

interface Test {
  val testName: String
}
// ATest.java
package com.test.impl

public class ATest implements Test {
  @NonNull
  @Override
  public String getTestName() {
    return "It`s ATest";
  }
}
// BTest.kt
package com.test.impl

interface BTest : Test
// FinalTest.kt
package com.test.impl

class FinalTest : ATest(), BTest

For FinalTest, IDE warns that Class 'FinalTest' is not abstract and does not implement abstract member public abstract val testName: String defined in com.test.impl.BTest. But it works without compliation error. What should I do to remove that waring.

I know a simple way is remove Test in Module A. But, assume there is some reason, so that we can't edit ATest or Test in Module A

I want use FinalTest without warning

0

There are 0 answers