@@ -94,29 +94,30 @@ ObjectBoxC? _tryObjectBoxLibFile() {
9494
9595// Require the minimum C API version of all supported platform-specific
9696// libraries.
97- // Library | C API | Core
97+ // Library | C API | Database
9898// ------------------------|-------|-----------------
99- // objectbox-c | 4.1 .0 | 4.1 .0-2025-01-28
100- // ObjectBox Swift 4.1 .0 | 4.1 .0 | 4.1 .0-2025-01-30
101- // objectbox-android 4.1 .0 | 4.1 .0 | 4.1 .0-2025-01-28
99+ // objectbox-c | 4.2 .0 | 4.2 .0-2025-03-04
100+ // ObjectBox Swift 4.2 .0 | 4.2 .0 | 4.2 .0-2025-03-27
101+ // objectbox-android 4.2 .0 | 4.2 .0 | 4.2 .0-2025-03-04
102102var _obxCminMajor = 4 ;
103- var _obxCminMinor = 1 ;
103+ var _obxCminMinor = 2 ;
104104var _obxCminPatch = 0 ;
105- // Require minimum core version guaranteeing actual C API availability.
106- var _obxCoreMinVersion = "4.1 .0-2025-01-28 " ;
105+ // Require minimum database version guaranteeing actual C API availability.
106+ var _obxDatabaseMinVersion = "4.2 .0-2025-03-04 " ;
107107
108108bool _isSupportedVersion (ObjectBoxC obxc) {
109+ // Require a minimum C API version
109110 if (! obxc.version_is_at_least (_obxCminMajor, _obxCminMinor, _obxCminPatch)) {
110111 return false ;
111112 }
112- // Require a minimum core version.
113- // As the core version string uses the
113+ // Require a minimum database version.
114+ // As the database version string uses the
114115 // "major.minor.build-YYYY-MM-DD (<flags>)"
115116 // format it should have a stable order.
116117 // Note: if the version+date is the same the compare value will be negative as
117118 // the flags make the string longer than the expected min version+date string.
118- final coreVersion = dartStringFromC (obxc.version_core_string ());
119- return _obxCoreMinVersion .compareTo (coreVersion ) <= 0 ;
119+ final databaseVersion = dartStringFromC (obxc.version_core_string ());
120+ return _obxDatabaseMinVersion .compareTo (databaseVersion ) <= 0 ;
120121}
121122
122123ObjectBoxC loadObjectBoxLib () {
@@ -126,17 +127,17 @@ ObjectBoxC loadObjectBoxLib() {
126127
127128 if (obxc == null ) {
128129 throw UnsupportedError (
129- 'Could not load ObjectBox core dynamic library. Platform: ${Platform .operatingSystem }' );
130+ 'Could not load ObjectBox dynamic database library. Platform: ${Platform .operatingSystem }' );
130131 }
131132
132133 if (! _isSupportedVersion (obxc)) {
133134 final version = dartStringFromC (obxc.version_string ());
134- final coreVersion = dartStringFromC (obxc.version_core_string ());
135+ final databaseVersion = dartStringFromC (obxc.version_core_string ());
135136 throw UnsupportedError (
136- 'ObjectBox platform-specific library not compatible: is $version ($coreVersion ),'
137- ' expected $_obxCminMajor .$_obxCminMinor .$_obxCminPatch ($_obxCoreMinVersion ) or newer.'
138- ' For Flutter, check if the ObjectBox Pod or objectbox-android-objectbrowser need to be updated.'
139- ' For Dart, re-run the install.sh script to download the latest version.' );
137+ 'ObjectBox platform-specific database library not compatible: is $version ($databaseVersion ),'
138+ ' expected $_obxCminMajor .$_obxCminMinor .$_obxCminPatch ($_obxDatabaseMinVersion ) or newer.'
139+ ' For Flutter apps , check if the ObjectBox Pod or the Android Admin dependency need to be updated.'
140+ ' For unit tests or Dart Native apps , re-run the install.sh script to download the latest version.' );
140141 }
141142
142143 return obxc;
0 commit comments