0

I am trying to bind aar library called "autoreplyprint.aar", following is the aar file link

autoreplyprint.aar

I have added following itemgroups for the .aar and its .so files

<ItemGroup Condition="$(TargetFramework.Contains('-android'))">
    <LibraryProjectZip Include="Platforms/Android/Jar/autoreplyprint.aar" />
    <TransformFile Include="Platforms/Android/Transforms/Metadata.xaml" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-android'))">
    <AndroidNativeLibrary Include="Platforms/Android/libs/arm64-v8a/libautoreplyprint.so">
        <Abi>arm64-v8a</Abi>
    </AndroidNativeLibrary>
    <AndroidNativeLibrary Include="Platforms/Android/libs/arm64-v8a/libjnidispatch.so">
        <Abi>arm64-v8a</Abi>
    </AndroidNativeLibrary>
    <AndroidNativeLibrary Include="Platforms/Android/libs/armeabi/libautoreplyprint.so">
        <Abi>armeabi</Abi>
    </AndroidNativeLibrary>
    <AndroidNativeLibrary Include="Platforms/Android/libs/armeabi/libjnidispatch.so">
        <Abi>armeabi</Abi>
    </AndroidNativeLibrary>
    <AndroidNativeLibrary Include="Platforms/Android/libs/armeabi-v7a/libautoreplyprint.so">
        <Abi>armeabi-v7a</Abi>
    </AndroidNativeLibrary>
    <AndroidNativeLibrary Include="Platforms/Android/libs/armeabi-v7a/libjnidispatch.so">
        <Abi>armeabi-v7a</Abi>
    </AndroidNativeLibrary>
    <AndroidNativeLibrary Include="Platforms/Android/libs/x86/libautoreplyprint.so">
        <Abi>x86</Abi>
    </AndroidNativeLibrary>
    <AndroidNativeLibrary Include="Platforms/Android/libs/x86/libjnidispatch.so">
        <Abi>x86</Abi>
    </AndroidNativeLibrary>
    <AndroidNativeLibrary Include="Platforms/Android/libs/x86_64/libautoreplyprint.so">
        <Abi>x86_64</Abi>
    </AndroidNativeLibrary>
    <AndroidNativeLibrary Include="Platforms/Android/libs/x86_64/libjnidispatch.so">
        <Abi>x86_64</Abi>
    </AndroidNativeLibrary>
</ItemGroup>

Now I am trying to access one of the property like below;

var _autoReplyPrint = IAutoReplyPrint.Instance;

But that gives me an error "java.lang.ClassNotFoundException: Didn't find class "com.caysn.autoreplyprint.AutoReplyPrint""

enter image description here

I have tried making couple of changes in metadata.xml but it didn't work.

Any help or suggestion would be appreciated, thanks!!!

0

1 Answer 1

0

I have found solution for the issue,

  • I have created android native binding project and added .aar file into that.

  • Used binding project as reference into main project and the error was gone.

Don't know why it was not working via directly adding .aar to main project.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.