Error getting native address of native library

Nathan Sokalski 4,116 Reputation points
2022-09-02T19:29:22.887+00:00

When running my Xamarin.Android app, I receive the following message:

Java.Lang.IllegalStateException: 'Error getting native address of native library: task_vision_jni'

This occurs on the following line:

ObjectDetector objdetector = ObjectDetector.CreateFromFile(Application.Context, "model.tflite");  

I know what NuGet package task_vision_jni is referring to (Xamarin.TensorFlow.Lite.Task.Vision), but I don't know where the jni file is or how to fix it. I have looked at the following:

https://learn.microsoft.com/en-us/xamarin/android/platform/java-integration/working-with-jni?source=recommendations
https://learn.microsoft.com/en-us/xamarin/android/platform/native-libraries

But they didn't seem to help. What can I do fix this? Thanks.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,294 questions
{count} votes