Your screenshot suggests that your jniLibs contains a jar file with prebuilt native library. I did not know that this is even possible, but yes, it works in Android Studio 2.3 and higher. Nice!
Anyways, as I explained elsewhere, don't expect Android Studio to resolve magically the native method declarations into a prebuilt library (even if it is unpacked into src/main/jnLibs
).
You can simply ignore this error message: your APK will still install the prebuilt library, and the native method will be resolved at run time.
You can add @SuppressWarnings("JniMissingFunction")
annotation for this method, or for the entire class:
@SuppressWarnings("JniMissingFunction")
public class ProximityInfo {
or configure this kind of Lint inspections for the given project, or for all projects:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…