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

isar community fails on 16 KB page size Android images (even with legacy packaging enabled) #120

Open
3 tasks done
JakobLichterfeld opened this issue Feb 1, 2025 · 3 comments

Comments

@JakobLichterfeld
Copy link

JakobLichterfeld commented Feb 1, 2025

Steps to Reproduce

Using a Android Emulator with an image of Type 16 KB Page Size Google APIs PlayStore and Using legacy packaging as suggested by Google results in the following exception:

IsarError (IsarError: Could not initialize IsarCore library for processor architecture "android_arm64". If you create a Flutter app, make sure to add isar_flutter_libs to your dependencies.
Invalid argument(s): Failed to load dynamic library 'libisar.so': dlopen failed: empty/missing DT_HASH/DT_GNU_HASH in "/data/app/<redacted>/lib/arm64/libisar.so" (new hash type from the future?))

without legacy packaging the app fails to install on those images.

(Other images without 16KB page size run fine)

Code sample

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:isar/isar.dart';
import 'package:path_provider/path_provider.dart';

void main() {
  final dir = await getApplicationDocumentsDirectory();
  final isar = await Isar.open(
    [UserSchema],
    directory: dir.path,
  );

  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
        body: Center(
          child: Text('Hello World!'),
        ),
      ),
    );
  }
}

Details

  • Platform: Android Emulator with an image of Type 16 KB Page Size Google APIs PlayStore
  • Flutter version: 3.27.3
  • Isar-community version: 3.1.8

  • I searched for similar issues already
  • I filled the details section with the exact device model and version
  • I am able to provide a reproducible example
@JakobLichterfeld
Copy link
Author

JakobLichterfeld commented Feb 1, 2025

Updating:

  • Gradle to 8.7
  • AGP to 8.6.1
  • KGP to 2.1.0

didn't help as well

@JakobLichterfeld
Copy link
Author

JakobLichterfeld commented Feb 3, 2025

This seems to be related with a potential fix: getsentry/sentry-dart#2237

The page sizes are aligned for our Android dependency, but we need to check Isar and SQLite dependencies.

And

I updated our sample app to support 16kb pages by bumping NDK to 27 and updating the app/build.gradle as described in here . I works on a 16KB emulator device, also with our Isar and SQFlite packages.  

-> https://developer.android.com/guide/practices/page-sizes#compile-r27

@JakobLichterfeld
Copy link
Author

JakobLichterfeld commented Feb 3, 2025

No success with:

android {
  ...
  ndkVersion = "28.0.12916984"
  ...
  defaultConfig {
    ...
    // This block is different from the one you use to link Gradle
    // to your CMake or ndk-build script.
    externalNativeBuild {
      // For ndk-build, instead use the ndkBuild block.
      cmake {
        // Passes optional arguments to CMake.
        arguments "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
      }
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant