Skip to content

Commit

Permalink
2.3.1 hotfix: allow 0.18.1 on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
greenrobot committed Oct 2, 2023
1 parent 3a95d4b commit 9c020b7
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 17 deletions.
4 changes: 2 additions & 2 deletions flutter_libs/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Superfast NoSQL Flutter / Dart database. This package contains Flut
# Link to actual directory in repository so file links on pub.dev work.
repository: https://github.com/objectbox/objectbox-dart/tree/main/flutter_libs
homepage: https://objectbox.io
version: 2.3.0
version: 2.3.1

environment:
sdk: '>=2.14.0 <4.0.0'
Expand All @@ -14,7 +14,7 @@ dependencies:
sdk: flutter
# This is here just to ensure compatibility between objectbox-dart code and the libraries used
# You should still depend on objectbox directly in your Flutter application.
objectbox: 2.3.0
objectbox: 2.3.1
path_provider: ^2.0.0

dev_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion generator/lib/src/version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ class Version {
///
/// This string is updated by the /tool/set-version.sh script
/// as part of the release process.
static const String current = "2.3.0";
static const String current = "2.3.1";
}
4 changes: 2 additions & 2 deletions generator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ description: ObjectBox Flutter / Dart database binding code generator - finds an
# Link to actual directory in repository so file links on pub.dev work.
repository: https://github.com/objectbox/objectbox-dart/tree/main/generator
homepage: https://objectbox.io
version: 2.3.0
version: 2.3.1

environment:
sdk: '>=2.18.0 <4.0.0'

dependencies:
objectbox: 2.3.0
objectbox: 2.3.1
analyzer: '>=5.2.0 <7.0.0' # 5.1.0 has a bug where DartType.element has been removed.
build: ^2.0.0
collection: ^1.15.0
Expand Down
4 changes: 3 additions & 1 deletion objectbox/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## latest
## 2.3.1 (2023-10-02)

* Fix "Loaded ObjectBox core dynamic library has unsupported version 0.18.1" on Android

## 2.3.0 (2023-09-19)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
flutter:
sdk: flutter

objectbox: ^2.3.0
objectbox: ^2.3.1
objectbox_flutter_libs: any
intl: any

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
flutter:
sdk: flutter

objectbox: ^2.3.0
objectbox: ^2.3.1
objectbox_flutter_libs: any
intl: any

Expand Down
2 changes: 1 addition & 1 deletion objectbox/example/flutter/objectbox_demo/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environment:
dependencies:
flutter:
sdk: flutter
objectbox: ^2.3.0
objectbox: ^2.3.1
objectbox_flutter_libs: any
intl: any
path_provider: ^2.0.10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environment:
dependencies:
flutter:
sdk: flutter
objectbox: ^2.3.0
objectbox: ^2.3.1
objectbox_flutter_libs: any
intl: any
path_provider: ^2.0.10 # 2.0.11+ requires Flutter 2.8.0
Expand Down
2 changes: 1 addition & 1 deletion objectbox/example/flutter/objectbox_demo_sync/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environment:
dependencies:
flutter:
sdk: flutter
objectbox: ^2.3.0
objectbox: ^2.3.1
objectbox_sync_flutter_libs: any # For Sync support use this instead of objectbox_flutter_libs.
intl: any
path_provider: ^2.0.10
Expand Down
15 changes: 13 additions & 2 deletions objectbox/lib/src/native/bindings/bindings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,19 @@ ObjectBoxC? _tryObjectBoxLibFile() {
return ObjectBoxC(_lib!);
}

bool _isSupportedVersion(ObjectBoxC obxc) => obxc.version_is_at_least(
OBX_VERSION_MAJOR, OBX_VERSION_MINOR, OBX_VERSION_PATCH);
bool _isSupportedVersion(ObjectBoxC obxc) {
// Default: require "current" version exactly
var minMajor = OBX_VERSION_MAJOR;
var minMinor = OBX_VERSION_MINOR;
var minPatch = OBX_VERSION_PATCH;
// Special cases (if any):
if (Platform.isAndroid) {
minMajor = 0;
minMinor = 18;
minPatch = 1;
}
return obxc.version_is_at_least(minMajor, minMinor, minPatch);
}

ObjectBoxC loadObjectBoxLib() {
ObjectBoxC? obxc;
Expand Down
2 changes: 1 addition & 1 deletion objectbox/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ homepage: https://objectbox.io
# Link to actual directory in repository so file links on pub.dev work.
repository: https://github.com/objectbox/objectbox-dart/tree/main/objectbox
documentation: https://docs.objectbox.io
version: 2.3.0
version: 2.3.1

environment:
# minimum Dart SDK (also see generator and flutter_libs)
Expand Down
4 changes: 2 additions & 2 deletions sync_flutter_libs/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Fast Flutter database for persisting Dart objects. This package con
# Link to actual directory in repository so file links on pub.dev work.
repository: https://github.com/objectbox/objectbox-dart/tree/main/sync_flutter_libs
homepage: https://objectbox.io
version: 2.3.0
version: 2.3.1

environment:
sdk: '>=2.14.0 <4.0.0'
Expand All @@ -14,7 +14,7 @@ dependencies:
sdk: flutter
# This is here just to ensure compatibility between objectbox-dart code and the libraries used
# You should still depend on objectbox directly in your Flutter application.
objectbox: 2.3.0
objectbox: 2.3.1
path_provider: ^2.0.0

dev_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion tool/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msys=false
case "$( uname )" in #(
MSYS* | MINGW* ) msys=true ;; #(
esac
if [ $msys ]; then
if [ "$msys" = true ]; then
YQCMD="${root}/tool/yq_windows_amd64.exe"
else
YQCMD="${root}/tool/yq_linux_amd64"
Expand Down
Empty file modified tool/yq_linux_amd64
100644 → 100755
Empty file.

0 comments on commit 9c020b7

Please sign in to comment.