Error getting native address of native library

Nathan Sokalski 4,111 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.

Developer technologies .NET Xamarin
{count} votes

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.