realm-dart icon indicating copy to clipboard operation
realm-dart copied to clipboard

Could provide a version adapted for Android 15 with a 16KB size limit?

Open wyqlxf opened this issue 1 year ago • 4 comments

What happened?

https://developer.android.com/guide/practices/page-sizes?hl=zh-cn

Can you provide a version adapted to Android 15 16KB?

Repro steps

  1. dependencies: realm: ^20.0.0
  2. flutter pub run realm generate
  3. Running in Android 15 emulator 16kb environment

Version

20.0.0

What Atlas Services are you using?

Local Database only

What type of application is this?

Dart standalone application

Client OS and version

Android15

Code snippets

No response

Stacktrace of the exception/crash you're getting

======== Exception caught by widgets library =======================================================
The following RealmException was thrown building Builder:
Cannot get app directory. Error: Realm error : Could not open librealm_dart.so. Tried:
- "librealm_dart.so"
Hint: Did you forget to add a dependency on the realm package?

The relevant error-causing widget was: 
  MaterialApp MaterialApp:file:///Users/wyqlxf/Desktop/FlutterProjects/flutter_so_demo/lib/main.dart:16:12
When the exception was thrown, this was the stack: 
#0      RealmCore.getAppDirectory (package:realm_dart/src/handles/native/realm_core.dart:107:7)
#1      Configuration.defaultStoragePath (package:realm_dart/src/configuration.dart:86:22)
#2      Configuration.defaultRealmPath (package:realm_dart/src/configuration.dart:93:47)
#3      Configuration.defaultRealmPath (package:realm_dart/src/configuration.dart)
#4      Configuration._defaultPath (package:realm_dart/src/configuration.dart:107:44)
#5      new Configuration._ (package:realm_dart/src/configuration.dart:103:50)
#6      new LocalConfiguration._ (package:realm_dart/src/configuration.dart:257:14)
#7      Configuration.local (package:realm_dart/src/configuration.dart:152:26)
#8      _MyHomePageState.write (package:flutter_so_demo/main.dart:139:32)
#9      _MyHomePageState.initState (package:flutter_so_demo/main.dart:66:5)
#10     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:5618:55)
#11     ComponentElement.mount (package:flutter/src/widgets/framework.dart:5463:5)
...     Normal element mounting (228 frames)
#239    Element.inflateWidget (package:flutter/src/widgets/framework.dart:4340:16)
#240    MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6904:36)
#241    MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6916:32)
...     Normal element mounting (489 frames)
#730    Element.inflateWidget (package:flutter/src/widgets/framework.dart:4340:16)
#731    Element.updateChild (package:flutter/src/widgets/framework.dart:3849:18)
#732    _RawViewElement._updateChild (package:flutter/src/widgets/view.dart:291:16)
#733    _RawViewElement.mount (package:flutter/src/widgets/view.dart:314:5)
...     Normal element mounting (7 frames)
#740    Element.inflateWidget (package:flutter/src/widgets/framework.dart:4340:16)
#741    Element.updateChild (package:flutter/src/widgets/framework.dart:3849:18)
#742    RootElement._rebuild (package:flutter/src/widgets/binding.dart:1581:16)
#743    RootElement.mount (package:flutter/src/widgets/binding.dart:1550:5)
#744    RootWidget.attach.<anonymous closure> (package:flutter/src/widgets/binding.dart:1503:18)
#745    BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2845:19)
#746    RootWidget.attach (package:flutter/src/widgets/binding.dart:1502:13)
#747    WidgetsBinding.attachToBuildOwner (package:flutter/src/widgets/binding.dart:1239:27)
#748    WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:1221:5)
#749    WidgetsBinding.scheduleAttachRootWidget.<anonymous closure> (package:flutter/src/widgets/binding.dart:1207:7)
#753    _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
(elided 3 frames from class _Timer and dart:async-patch)
====================================================================================================

Relevant log output

No response

wyqlxf avatar Oct 10 '24 01:10 wyqlxf

➤ PM Bot commented:

Jira ticket: RDART-1104

sync-by-unito[bot] avatar Oct 10 '24 01:10 sync-by-unito[bot]

I ran into this problem and I don't really know what to do, damn it

AmirSamyan avatar Oct 22 '24 18:10 AmirSamyan

I also encounter this problem, and I use realm version is 1.9.0.

Invalid argument(s): Failed to load dynamic library 'librealm_dart.so': dlopen
failed: cannot locate symbol "__read_chk" referenced by "librealm_dart.so"... Invalid argument(s): Failed to load dynamic library '/system/bin/librealm_dart.so': dlopen
failed: library "/system/bin/librealm_dart.so" not found Invalid argument(s): Failed to load dynamic library 'librealm_dart.so': dlopen failed: cannot
locate symbol "__read_chk" referenced by "librealm_dart.so"...

zhazha208 avatar Jan 09 '25 00:01 zhazha208

realm: 20.0.1 or 20.1.0 Emulator with Android API 35.

======== Exception caught by widgets library =======================================================
The following RealmException was thrown building MyApp(dirty):
Cannot get app directory. Error: Realm error : Could not open librealm_dart.so. Tried:
- "librealm_dart.so"
Hint: Did you forget to add a dependency on the realm package?

smiera avatar May 14 '25 07:05 smiera

Também estou aguardando a resolução. O prazo da loja está chegando e não queria ter que usar outro package de base de dados.

Zeca-dev avatar Sep 08 '25 18:09 Zeca-dev

I'll try and look into this at the end of next week. Going to lock this for now as the daily notifications are not really productive.

nirinchev avatar Sep 12 '25 10:09 nirinchev

Hey folks, we have a build for Android that pulls in this fix: https://github.com/realm/realm-dart/pull/1861. Can someone check that these new binaries are correctly aligned? If they are, happy to cut a new release as soon as we are confident things work.

librealm-android.zip

nirinchev avatar Sep 24 '25 13:09 nirinchev

Hey @nirinchev

Looks like they are aligned Output from the terminal:

user ~ % /Users/user/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-objdump -p ~/Downloads/librealm-android/arm64-v8a/librealm_dart.so | grep LOAD
    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**14
    LOAD off    0x0000000000941d00 vaddr 0x0000000000945d00 paddr 0x0000000000945d00 align 2**14
    LOAD off    0x00000000009cad30 vaddr 0x00000000009d2d30 paddr 0x00000000009d2d30 align 2**14
user ~ % /Users/user/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-objdump -p ~/Downloads/librealm-android/armeabi-v7a/librealm_dart.so | grep LOAD 
    LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**14
    LOAD off    0x0055c610 vaddr 0x00560610 paddr 0x00560610 align 2**14
    LOAD off    0x005a3650 vaddr 0x005ab650 paddr 0x005ab650 align 2**14
user ~ % /Users/user/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-objdump -p ~/Downloads/librealm-android/x86_64/librealm_dart.so | grep LOAD 
    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**14
    LOAD off    0x0000000000a07750 vaddr 0x0000000000a0b750 paddr 0x0000000000a0b750 align 2**14
    LOAD off    0x0000000000a92b80 vaddr 0x0000000000a9ab80 paddr 0x0000000000a9ab80 align 2**14

Don't mind the NDK version. The output from the version 28.2.13676358 is the same

IshchikGL avatar Sep 24 '25 13:09 IshchikGL

@nirinchev Hello, do you think you could release a version on the 3.4 branch that supports 16kb page size ?

tanguy-penfen avatar Sep 29 '25 10:09 tanguy-penfen

No, there's no plan to backport this as the 3.4 branch is supporting Atlas Device Sync - now a deprecated product. If you have been granted an extension to continue using device sync while you migrate away from it, please reach out to your account executive and we'll coordinate options with them. If you're not using sync, I strongly advice migrating to version 20.x - it's almost identical to 3.x, with the exception that a lot of code has been removed.

nirinchev avatar Sep 29 '25 10:09 nirinchev

We were assured the 3.4 branch would be maintained until the deprecation is in effect which is very soon but not yet. So that would be nice if we could get a 3.4.3 with it. And yes we got an extension so that is why we are interested in it.

tanguy-penfen avatar Sep 29 '25 10:09 tanguy-penfen

@nirinchev We too have received extension for the Device Sync and require the newer adapted version.

Shouldn't this be relatively easier backport this or am I missing something?

Shreedhar73 avatar Oct 06 '25 08:10 Shreedhar73

As mentioned above, you'd need to reach out to your AE or open a support ticket to request the backport. The problem isn't so much with the difficulty as it is that we want to have a proper process for all work related to deprecated products.

nirinchev avatar Oct 06 '25 09:10 nirinchev