0

In MyClass.java I have

package com.example.foo;
public class MyClass {
    public native void MyMethod();

and in MyClass.cpp I have

JNIEXPORT void JNICALL xJava_com_example_foo_MyClass_MyMethod(JNIEnv* env, jobject thiz)
{
    blah blah blah
}

Elsewhere in the Java code there's a call MyMethod(); However, as the eagle-eyed amongst you will have spotted, I've accidentally splatted an "x" at the start of my native method name, and this causes an uncaught exception runtime error No implementation found for void com.example.foo.MyClass.MyMethod(). Is there some linty magic I can turn on that checks whether all my public native methods have an implementation and throws a build-timer error if they don't? Thanks.

kbro
  • 4,754
  • 7
  • 29
  • 40

1 Answers1

0

Android Studio 3.6.3 shows this error pop-up for me if I rename the Java...boe function to xJava...boe. Android Studio catches it

Botje
  • 26,269
  • 3
  • 31
  • 41