.NET MAUI error after binding android library (.aar)

Nikhil Sathawara 0 Reputation points
2025-03-19T16:23:37.7166667+00:00

I am using android library called "autoreplyprint.aar" , this library contains another.jar file called "jna-4.5.1.jar".

I have used following code to bind it in my MAUI project,

<ItemGroup Condition="$(TargetFramework.Contains('-android'))">
        <LibraryProjectZip Include="Libs/autoreplyprint.aar" />
</ItemGroup>

After binding the .aar, I am getting many auto generated files which is expected but most of them have errors.

One of the errors is as following which is related to "jna-4.5.1.jar"

Error : 'JNIEnv' does not contain a definition for 'GetString'

0

Developer technologies | .NET | .NET MAUI
{count} votes

1 answer

Sort by: Most helpful
  1. Nikhil Sathawara 0 Reputation points
    2025-03-26T05:44:52.7933333+00:00

    Its started working after making changes suggested by jonpryor


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.