Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ugran opened this issue Oct 14, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@ugran
Copy link

ugran commented Oct 14, 2024

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
@ugran ugran added the bug Something isn't working label Oct 14, 2024
@greenrobot-team
Copy link
Member

greenrobot-team commented Oct 15, 2024

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.

@greenrobot-team greenrobot-team self-assigned this Oct 15, 2024
@ugran
Copy link
Author

ugran commented Oct 15, 2024

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?

@greenrobot-team
Copy link
Member

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.

@greenrobot-team greenrobot-team changed the title Build error on Android emulator for API 35 and PIXEL 8 Build error on Android emulator for API 35 and PIXEL 8: dlopen failed: empty/missing DT_HASH/DT_GNU_HASH Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants