objectbox/objectbox-dart

Build error on Android emulator for API 35 and PIXEL 8: dlopen failed: empty/missing DT_HASH/DT_GNU_HASH

Opened this issue · 3 comments

Is there an existing issue?

Build info

  • objectbox version: 4.0.2
  • Flutter/Dart version: Flutter 3.24.3
  • Build OS: macOS 15.0.1
  • Deployment OS or device: Android 15, API 35

Steps to reproduce

  1. Have 2 android emulator, one pixel 6 Android 15 API 35 and the other one same but `pixel 8
  2. flutter builds and runs for pixel 6 but gives out error for pixel 8
  3. I tried to delete the pixel 8 emulator and re-create but the error persists.
7 W/linker  ( 4843): Warning: "/data/app/~~I9jU7h4Jwsk2ehJa3Ci35w==/com.example.evercrypted-wdU4XCSJY-w_FHDsJAk2EQ==/lib/arm64/libobjectbox-jni.so" unused DT entry: unknown (type 0x1d1fe0 arg 0x1d1fe0) (ignoring)
W/linker  ( 4843): Warning: "/data/app/~~I9jU7h4Jwsk2ehJa3Ci35w==/com.example.evercrypted-wdU4XCSJY-w_FHDsJAk2EQ==/lib/arm64/libobjectbox-jni.so" unused DT entry: unknown (type 0x1d1fe0 arg 0x0) (ignoring)
I/flutter ( 4843): Failed to load ObjectBox library. For Flutter apps, check if objectbox_flutter_libs is added to dependencies. For unit tests and Dart apps, check if the ObjectBox library was downloaded (https://docs.objectbox.io/getting-started).
E/flutter ( 4843): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libobjectbox-jni.so': dlopen failed: empty/missing DT_HASH/DT_GNU_HASH in "/data/app/~~I9jU7h4Jwsk2ehJa3Ci35w==/com.example.evercrypted-wdU4XCSJY-w_FHDsJAk2EQ==/lib/arm64/libobjectbox-jni.so" (new hash type from the future?)
E/flutter ( 4843): #0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:43)
E/flutter ( 4843): #1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12)
E/flutter ( 4843): #2      _tryObjectBoxLibFile (package:objectbox/src/native/bindings/bindings.dart:84:29)
E/flutter ( 4843): #3      loadObjectBoxLib (package:objectbox/src/native/bindings/bindings.dart:123:12)
E/flutter ( 4843): #4      C (package:objectbox/src/native/bindings/bindings.dart:144:22)
E/flutter ( 4843): #5      C (package:objectbox/src/native/bindings/bindings.dart)
E/flutter ( 4843): #6      new Model (package:objectbox/src/native/model.dart:19:31)
E/flutter ( 4843): #7      new Store (package:objectbox/src/native/store.dart:237:21)
E/flutter ( 4843): #8      openStore (package:evercrypted/objectbox.g.dart:437:14)
E/flutter ( 4843): <asynchronous suspension>
E/flutter ( 4843): #9      ObjectBox.create (package:evercrypted/core/entities/objectbox.dart:35:19)
E/flutter ( 4843): <asynchronous suspension>
E/flutter ( 4843): #10     main (package:evercrypted/main.dart:51:9)
E/flutter ( 4843): <asynchronous suspension>
E/flutter ( 4843): 
D/ProfileInstaller( 4843): Installing profile for com.example.evercrypted
image

Thanks for reporting!

The relevant error appears to be:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)]
Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libobjectbox-jni.so': dlopen failed: empty/missing DT_HASH/DT_GNU_HASH in "/data/app/~~I9jU7h4Jwsk2ehJa3Ci35w==/com.example.evercrypted-wdU4XCSJY-w_FHDsJAk2EQ==/lib/arm64/libobjectbox-jni.so" (new hash type from the future?)

Someone from the Square Cash team noted this is error went away after supporting Android 16 KB page sizes. (Edit: there is an issue for the ObjectBox Java library to support this objectbox/objectbox-java#1178).

@ugran As you appear to not use a 16-KB enabled image, did you enable 16 KB support any other way? Interestingly, developer options for 16 KB support also appear to only be available on Pixel 8.

Thanks for reporting!

The relevant error appears to be:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)]
Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libobjectbox-jni.so': dlopen failed: empty/missing DT_HASH/DT_GNU_HASH in "/data/app/~~I9jU7h4Jwsk2ehJa3Ci35w==/com.example.evercrypted-wdU4XCSJY-w_FHDsJAk2EQ==/lib/arm64/libobjectbox-jni.so" (new hash type from the future?)

Someone from the Square Cash team noted this is error went away after supporting Android 16 KB page sizes. (Edit: there is an issue for the ObjectBox Java library to support this objectbox/objectbox-java#1178).

@ugran As you appear to not use a 16-KB enabled image, did you enable 16 KB support any other way? Interestingly, developer options for 16 KB support also appear to only be available on Pixel 8.

Hello, thanks for the prompt reply!

It appears that you are right, I selected the 16kb size image for pixel 8 and there is no such for pixel 6.

So does object box need to support 16kb page size devices, or do we need to configure android in some other way?

This is something ObjectBox needs to support. See objectbox/objectbox-java#1178 for details. This also only impacts running an app on some yet to be released future devices.