tensorflow: TFLite No implementation found for long org.tensorflow.lite.NativeInterpreterWrapper.createErrorReporter(int)

System information

  • OS Platform and Distribution: Android 5.1.1, API 22
  • Mobile device: Xiaomi Redmi 3
  • TensorFlow installed from: official binary
  • TensorFlow version : tensorflow-lite:1.14.0

Describe the current behavior Tensorflow-lite 1.13.1 works fine on all devices I tested. Whereas tensorflow-lite 1.14.0 is broken for Xiaomi Redmi 3 (Android 5.1.1, API 22), other devices are ok. I get a runtime error when Interpreter is created.

Describe the expected behavior No error.

Code to reproduce the issue

interpreter = new Interpreter(tfliteModel, null);

Other info / logs

W/linker: /data/app/eu.yesse.readerdemo.debug-2/lib/arm64/libtensorflowlite_jni.so: unused DT entry: type 0x6ffffffe arg 0x2020
    /data/app/eu.yesse.readerdemo.debug-2/lib/arm64/libtensorflowlite_jni.so: unused DT entry: type 0x6fffffff arg 0x3
E/art: dlopen("/data/app/eu.yesse.readerdemo.debug-2/lib/arm64/libtensorflowlite_jni.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "__register_atfork" referenced by "/data/app/eu.yesse.readerdemo.debug-2/lib/arm64/libtensorflowlite_jni.so"...
W/System.err: TensorFlowLite: failed to load native library: dlopen failed: cannot locate symbol "__register_atfork" referenced by "/data/app/eu.yesse.readerdemo.debug-2/lib/arm64/libtensorflowlite_jni.so"...
W/linker: /data/app/eu.yesse.readerdemo.debug-2/lib/arm64/libtensorflowlite_jni.so: unused DT entry: type 0x6ffffffe arg 0x2020
    /data/app/eu.yesse.readerdemo.debug-2/lib/arm64/libtensorflowlite_jni.so: unused DT entry: type 0x6fffffff arg 0x3
E/art: dlopen("/data/app/eu.yesse.readerdemo.debug-2/lib/arm64/libtensorflowlite_jni.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "__register_atfork" referenced by "/data/app/eu.yesse.readerdemo.debug-2/lib/arm64/libtensorflowlite_jni.so"...
W/System.err: TensorFlowLite: failed to load native library: dlopen failed: cannot locate symbol "__register_atfork" referenced by "/data/app/eu.yesse.readerdemo.debug-2/lib/arm64/libtensorflowlite_jni.so"...
E/art: No implementation found for long org.tensorflow.lite.NativeInterpreterWrapper.createErrorReporter(int) (tried Java_org_tensorflow_lite_NativeInterpreterWrapper_createErrorReporter and Java_org_tensorflow_lite_NativeInterpreterWrapper_createErrorReporter__I)
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: eu.yesse.readerdemo.debug, PID: 12710
    java.lang.UnsatisfiedLinkError: No implementation found for long org.tensorflow.lite.NativeInterpreterWrapper.createErrorReporter(int) (tried Java_org_tensorflow_lite_NativeInterpreterWrapper_createErrorReporter and Java_org_tensorflow_lite_NativeInterpreterWrapper_createErrorReporter__I)
        at org.tensorflow.lite.NativeInterpreterWrapper.createErrorReporter(Native Method)
        at org.tensorflow.lite.NativeInterpreterWrapper.<init>(NativeInterpreterWrapper.java:58)
        at org.tensorflow.lite.Interpreter.<init>(Interpreter.java:224)
        at eu.yesse.reader.commons.internal.detector.BlockingCornersClassSingleDetector.<init>(BlockingCornersClassSingleDetector.java:76)
        at eu.yesse.reader.commons.internal.detector.BlockingCornersClassMultiDetector.<init>(BlockingCornersClassMultiDetector.java:25)
        at eu.yesse.reader.commons.shared.detector.AsyncCornersClassMultiDetectorImpl.<init>(AsyncCornersClassMultiDetectorImpl.java:36)
        at eu.yesse.reader.tempregdoc.internal.TempRegDocReaderManager.createDetector(TempRegDocReaderManager.java:79)
        at eu.yesse.reader.tempregdoc.internal.TempRegDocReaderManager.<init>(TempRegDocReaderManager.java:48)
        at eu.yesse.reader.TempRegDocReader.getReader(TempRegDocReader.java:20)
        at eu.yesse.readerdemo.activities.TempRegDocActivity.onCreate(TempRegDocActivity.java:24)
        at android.app.Activity.performCreate(Activity.java:6093)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2295)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2404)
        at android.app.ActivityThread.access$900(ActivityThread.java:154)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1315)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5296)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 28 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I had the same issue. I fixed it by adding

ndk {
            abiFilters "armeabi-v7a", "x86"
        }

to the defaultConfig in app/build.gradle file.

Did you solve it?

Firebase crashlytics reports this issue for Android 5 users of my app

I added Tensorflow like this:

implementation 'org.tensorflow:tensorflow-lite:0.0.0-nightly'
implementation 'org.tensorflow:tensorflow-lite-gpu:0.0.0-nightly'

Fatal Exception: java.lang.UnsatisfiedLinkError No implementation found for long org.tensorflow.lite.NativeInterpreterWrapper.createErrorReporter(int) (tried Java_org_tensorflow_lite_NativeInterpreterWrapper_createErrorReporter and Java_org_tensorflow_lite_NativeInterpreterWrapper_createErrorReporter__I)

Hi all, apologies for the delayed response, just now seeing this issue.

We set our Android NDK API level to 18 when building, but it’s possible there’s something wrong with the config and it’s assuming API 23. I’ll take a look.

Got the same problem with org.tensorflow:tensorflow-lite:2.0.0 Device T8-PLUS, Android 5.1

Hi @jdduke , thanks for the fix. Just to understand how we can resolve this issue on android, would we be able to pull in the nightly build of TFL in gradle and have this fixed

dependencies: {
     implementation 'org.tensorflow:tensorflow-lite:0.0.0-nightly'
}

or do we have to also reconvert our models to TFL using the nightly build?

This is fixed in the latest nightly, and we’ll try to pull the fix in to the 2.1 release (https://github.com/tensorflow/tensorflow/pull/34419). Thanks again for your patience.

@kongaskristjan and @FunmiKesa - big thanks for investigating and sharing that! Said that, I feel propsed changes are more like workarounds and not solutions. It still would be nice to have a fix inside the tensorflow lib.

Any updates on this? It’s still happening on 1.15.0! This seems like a critical bug to me, tflite instantly crashes on some devices.

I will bump my minApi to 23 for a while, and later revert to 21 when this gets fixed 😃

EDIT: Excluding 64bit architectures as some of you are doing is not a viable solution, Google Play store enforces all apps to support 64bit since 1st of August 2019: https://android-developers.googleblog.com/2019/01/get-your-apps-ready-for-64-bit.html

I confirm - 2.1.0 works on the device I originally issued the problem with 😃 Big thanks to all contributors! 🥇

The 2.1 release is now available (org.tensorflow:tensorflow-lite:2.1.0), please give it a try.

There won’t be any backport, however, you can safely use the latest 2.x or nightly version with both 1.X and 2.X TF models.

@liyunlu0618 are there any updates on that?