Skip to content

bug: unsupported operation: Loaded ObjectBox core dynamic library has unsupported version 0.13.0, expected ^0.14.0 #309

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

Closed
yeikel16 opened this issue Sep 7, 2021 · 12 comments
Labels
bug Something isn't working more info required Needs more info to become actionable. Auto-closed if no response.

Comments

@yeikel16
Copy link

yeikel16 commented Sep 7, 2021

  • ObjectBox version: 1.2.0
  • Flutter/Dart SDK: 2.2.3/2.13.4
  • Null-safety enabled: yes
  • Reproducibility: always in test
  • OS: Windows 10
  • Device/Emulator: Redmi Note 7

Additionally, you can choose to provide more details, e.g. the output of:

  • pub deps --no-dev
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Versión 10.0.19043.1165], locale es-US)
    • Flutter version 2.2.3 at C:\src\flutter
    • Framework revision f4abaa0735 (10 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at E:\Programas\SDK
    • Platform android-30, build-tools 30.0.2
    • ANDROID_SDK_ROOT = E:\Programas\SDK
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.9.0)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.9.31025.194
    • Windows 10 SDK version 10.0.18362.0

[√] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.60.0)
    • VS Code at C:\Users\Yeikel\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.26.0

[√] Connected device (4 available)
    • Redmi Note 7 (mobile) • d97ede0d • android-arm64  • Android 10 (API 29)
    • Windows (desktop)     • windows  • windows-x64    • Microsoft Windows [Versión 10.0.19043.1165]
    • Chrome (web)          • chrome   • web-javascript • Google Chrome 92.0.4515.131
    • Edge (web)            • edge     • web-javascript • Microsoft Edge 93.0.961.38

Steps to reproduce

I'm creating a unit test for a method that returns a Stream<List<Card>> and the test fails in all the ways I tried.

Code

  Stream<List<Card>> getAllCardsStream() {
    final _stream = _cardsBox
        .query()
        .watch(triggerImmediately: true)
        .map((query) => query.find());

    return _stream;
  }

Test:

test('should return a [Stream<List<Card>>]', () async {
      final result = <List<Card>>[];
      final box = testEnv.box;

      cardsDataBase.getAllCardsStream().listen(result.add);

      box.put(tCardModel);

      await yieldExecution();

      expect(result, [
        [tCardModel],
      ]);
    });

If applicable, add code to help explain your problem.

  • Include your pubspec.yaml.
name: cards_repository
description: A Very Good Project created by Very Good CLI.
version: 1.0.0+1
publish_to: none

environment:
  sdk: ">=2.13.0 <3.0.0"

dependencies:
  flutter:
      sdk: flutter
  equatable: ^2.0.3
  objectbox: ^1.2.0
  objectbox_flutter_libs: any

dev_dependencies:
  build_runner: any
  objectbox_generator: any
  test: ^1.17.0
  mocktail: ^0.1.4
  very_good_analysis: ^2.3.0
  • Include affected entity classes.
import 'package:objectbox/objectbox.dart';

/// [Card] model for database
@Entity()
class Card {
  ///
  Card({
    required this.bankName,
    required this.cardNumber,
    required this.ownersName,
    required this.phoneNumber,
    required this.expDate,
    required this.moneyType,
  });

  ///
  int id = 0;

  /// Bank name
  final String bankName;

  /// Card number
  final String cardNumber;

  /// Owners name
  final String ownersName;

  /// Phone number
  final String phoneNumber;

  /// Expire date
  final String expDate;

  /// Money type
  final String moneyType;

  @override
  bool operator ==(Object other) {
    if (identical(this, other)) return true;

    return other is Card &&
        other.bankName == bankName &&
        other.cardNumber == cardNumber &&
        other.ownersName == ownersName &&
        other.phoneNumber == phoneNumber &&
        other.expDate == expDate &&
        other.moneyType == moneyType;
  }

  @override
  int get hashCode {
    return bankName.hashCode ^
        cardNumber.hashCode ^
        ownersName.hashCode ^
        phoneNumber.hashCode ^
        expDate.hashCode ^
        moneyType.hashCode;
  }

  Card copyWith({
    String? bankName,
    String? cardNumber,
    String? ownersName,
    String? phoneNumber,
    String? expDate,
    String? moneyType,
  }) {
    return Card(
      bankName: bankName ?? this.bankName,
      cardNumber: cardNumber ?? this.cardNumber,
      ownersName: ownersName ?? this.ownersName,
      phoneNumber: phoneNumber ?? this.phoneNumber,
      expDate: expDate ?? this.expDate,
      moneyType: moneyType ?? this.moneyType,
    );
  }
}

Logs, stack traces

Unsupported operation: Loaded ObjectBox core dynamic library has unsupported version 0.13.0, expected ^0.14.0
loadObjectBoxLib
package:objectbox/…/bindings/bindings.dart:75
C
package:objectbox/…/bindings/bindings.dart:84
package:objectbox/src/native/bindings/bindings.dart        C
package:objectbox/…/bindings/bindings.dart:1
new Model
package:objectbox/…/native/model.dart:19
new Store
package:objectbox/…/native/store.dart:105
new TestEnv
test\test_env.dart:13
main.<fn>

Additional context

This is a package that manages the card database

@yeikel16 yeikel16 added the bug Something isn't working label Sep 7, 2021
@greenrobot-team
Copy link
Member

I'm creating a unit test for a method that returns a Stream<List> and the test fails in all the ways I tried.

Loaded ObjectBox core dynamic library has unsupported version 0.13.0, expected ^0.14.0

You may have to update the ObjectBox library on your development machine. See the last step at https://github.com/objectbox/objectbox-dart/blob/main/objectbox/README.md#flutter about "In order to run Flutter unit tests locally on your machine".

@greenrobot-team greenrobot-team added the more info required Needs more info to become actionable. Auto-closed if no response. label Dec 20, 2021
@greenrobot-team
Copy link
Member

Closing because this issue is missing details. Feel free to comment with additional details and we can re-open it.

@agavrel
Copy link

agavrel commented Sep 20, 2023

Got the same problem with version 2.3.0 and was able to have the error gone after downgrading to 2.2.0 (wasted 1 hour on this).
Specifically the error was Loaded ObjectBox core dynamic library has unsupported version 0.18.1, expected ^0.19.0

Was testing on a physical Android Device.

@quebrandolink
Copy link

Got the same problem with version 2.3.0 and was able to have the error gone after downgrading to 2.2.0 (wasted 1 hour on this). Specifically the error was Loaded ObjectBox core dynamic library has unsupported version 0.18.1, expected ^0.19.0

Was testing on a physical Android Device.

mesmo problema para mim.

@PKiman
Copy link

PKiman commented Sep 21, 2023

Same problem on Android after upgrading to Objectbox 2.3.0. iOS is fine.

E/flutter ( 3783): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Unsupported operation: Loaded ObjectBox core dynamic library has unsupported version 0.18.1, expected ^0.19.0
E/flutter ( 3783): #0      loadObjectBoxLib (package:objectbox/src/native/bindings/bindings.dart:110:5)
E/flutter ( 3783): #1      C (package:objectbox/src/native/bindings/bindings.dart:119:22)
E/flutter ( 3783): #2      C (package:objectbox/src/native/bindings/bindings.dart)
E/flutter ( 3783): #3      new Model (package:objectbox/src/native/model.dart:19:31)
E/flutter ( 3783): #4      new Store (package:objectbox/src/native/store.dart:192:21)
E/flutter ( 3783): <asynchronous suspension>
E/flutter ( 3783): 

@quebrandolink
Copy link

quebrandolink commented Sep 21, 2023

Tive o mesmo problema com a versão 2.3.0 e consegui eliminar o erro após fazer o downgrade para 2.2.0 (perdi 1 hora com isso). Especificamente, o erro foiLoaded ObjectBox core dynamic library has unsupported version 0.18.1, expected ^0.19.0

Estava testando em um dispositivo Android físico.

Mesmo fazendo o downgrade da versão no pubspec ainda continuo recebendo o mesmo problema.

E/flutter (10233): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Unsupported operation: Loaded ObjectBox core dynamic library has unsupported version 0.18.1, expected ^0.19.0
E/flutter (10233): #0 loadObjectBoxLib
E/flutter (10233): #1 C
E/flutter (10233): #2 C (package:objectbox/src/native/bindings/bindings.dart)
E/flutter (10233): #3 new Model
E/flutter (10233): #4 new Store
E/flutter (10233): #5 openStore
E/flutter (10233): #6 Objectbox.create
E/flutter (10233):
E/flutter (10233): #7 main
E/flutter (10233):
E/flutter (10233):

@PKiman
Copy link

PKiman commented Sep 21, 2023

Downgrade to 2.2.0 works but remove the caret syntax ^2.2.0

dependencies:
  flutter:
    sdk: flutter
 
  # Do not use caret syntax: objectbox: ^2.2.0 
  objectbox: 2.2.0 
  objectbox_sync_flutter_libs: 2.2.0
  objectbox_generator: 2.2.0 

@quebrandolink
Copy link

físico

Downgrade to 2.2.0 works but remove the caret syntax ^2.2.0

dependencies:
  flutter:
    sdk: flutter
 
  # Do not use caret syntax: objectbox: ^2.2.0 
  objectbox: 2.2.0 
  objectbox_sync_flutter_libs: 2.2.0
  objectbox_generator: 2.2.0 

Funcionou aqui, muito obrigado. Já estava ficando desesperado.

@fisromildojr
Copy link

Mesmo problema após atualizar para 2.3.0, problema resolvido após downgrade para 2.2.0.

@pablopantaleon
Copy link

same problem here — I've downgraded to 2.2.1

@greenrobot-team
Copy link
Member

greenrobot-team commented Oct 9, 2023

The Unsupported operation: Loaded ObjectBox core dynamic library has unsupported version 0.18.1, expected ^0.19.0 error was fixed with 2.3.1 (which allows the new library version). See #563.

Thanks for reporting!

@youngyouth22
Copy link

Downgrade to 2.2.0 works but remove the caret syntax ^2.2.0

dependencies:
  flutter:
    sdk: flutter
 
  # Do not use caret syntax: objectbox: ^2.2.0 
  objectbox: 2.2.0 
  objectbox_sync_flutter_libs: 2.2.0
  objectbox_generator: 2.2.0 

Thank 🙏🙏🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working more info required Needs more info to become actionable. Auto-closed if no response.
Projects
None yet
Development

No branches or pull requests

8 participants