Forum Xamarin.Android

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

ERROR BINDING LIBRARY-JNI DETECTED ERROR IN APPLICATION: JNI FindClass called with pending exception

Erar2rErar2r USMember ✭✭
edited January 2019 in Xamarin.Android

Hi,

I'm doing a binding of a .aar, which is satisfactory in my binding I have all the namespace but in one method I drop the application with the following error:
JNI DETECTED ERROR IN APPLICATION: JNI FindClass called with pending exception.

I use the same .aar in a Java native application and it works correctly.
The .aar isn't obfuscated.

Someone has an idea that it can be.

Thanks

Answers

  • jezhjezh Member, Xamarin Team Xamurai

    Could you please post the full log of this error?

  • Erar2rErar2r USMember ✭✭

    @jezh said:
    Could you please post the full log of this error?

    From line 51 you find the error

  • jezhjezh Member, Xamarin Team Xamurai

    I noticed there is a error in line 14: Access denied finding property "camera.hal1.packagelist".
    Besides, the log of from com.facephi.sdk.matcher.AuthenticationResult com.facephi.sdk.matcher.Matcher.nAuthenticateRetrain(long, byte[], byte[]) in line 53, imply
    us that we can try to recheck the method AuthenticationResult to find which specific call to this method.

  • Erar2rErar2r USMember ✭✭
    edited January 2019

    I don't think the error is Access denied finding property "camera.hal1.packagelist" I used different .aar that is part of an SDK of Java, perform the binding of each .aar, the camera is working and my permissions are:
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-feature android:name="android.hardware.camera" />
    <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

    I only have the .aar of com.facephi.sdk.matcher not source code.

    I use Java Decompiler the method used from Binding is:
    public AuthenticationResult authenticateRetrain(byte[] user, byte[] templateData)
    throws MatcherException, LicenseActivationException
    {
    if (user == null) {
    throw new NullPointerException();
    }
    if (templateData == null) {
    throw new NullPointerException();
    }
    return nAuthenticateRetrain(this.ptr, user, templateData);
    }

    It's method is call:

    private native AuthenticationResult nAuthenticateRetrain(long paramLong, byte[] paramArrayOfByte1, byte[] paramArrayOfByte2);

    And the AuthenticationResult is a class that has nothing special just a few methods to verify the status for example:
    public AuthenticationResult()
    {
    this.ptr = nCreate();
    }

    public boolean getIsPositiveMatch()
    {
    return nGetIsPositiveMatch(this.ptr);
    }

Sign In or Register to comment.