Closed FredJul closed 2 years ago
I have the same problem. This is an IOS 15 vs objectbox incompatibility issue. If I change the simulator version to IOS 14.3, everything is fine.
@ebadta81 you're totally right! I downloaded the iOS 14 simulator and yes, it's working fine. I just changed the title, thanks for that info.
I can confirm this is reproducible with the example in the repo by wrapping q.find()
with try-catch and printing the error...
Still trying to figure out an alternative without sacrificing performance. I've also opened an SO question https://stackoverflow.com/questions/69324507/ios-15-sdk-memcpy-not-exported
So far no reaction on SO; maybe also try the Dart bug tracker? Are stdlib functions treated differently (e.g. less calling overhead) than "our" code? If not, we could provide our own C wrapper for memcpy, I guess?
I've also encountered a similar issue in our application, but this only seems to be a problem on iOS Simulators. So far, there have been no issues reported on real devices.
I've created a Flutter GH issue https://github.com/flutter/flutter/issues/90896
we could provide our own C wrapper for memcpy
Yes, that's an option I've had in mind as a "last resort" (because it requires more symbols just for dart/flutter). There should be no performance degradation.
It seems to be a confirmed issue with Flutter itself; can someone confirm it's fixed in the Flutter beta channel? See https://github.com/flutter/flutter/issues/90896#issuecomment-930052186
Issue doesn't seem to be fixed yet on Flutter beta channel 2.6.0
Stack Trace:
[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: Invalid argument(s): Failed to lookup symbol 'memcpy': dlsym(RTLD_DEFAULT, memcpy): symbol not found
#0 DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:31:29)
#1 memcpy (package:objectbox/src/native/bindings/nativemem.dart)
#2 memcpy (package:objectbox/src/native/bindings/nativemem.dart)
#3 ReaderWithCBuffer.access (package:objectbox/src/native/bindings/flatbuffers.dart:128:7)
#4 CursorHelper.readData (package:objectbox/src/native/bindings/helpers.dart:111:36)
#5 Box.getAll.<anonymous closure> (package:objectbox/src/native/box.dart:258:58)
#6 Store._runInTransaction (package:objectbox/src/native/store.dart:305:24)
#7 InternalStoreAccess.runInTransaction (package:objectbox/src/native/store.dart:365:13)
#8 Box.getAll (package:objectbox/src/native/box.dart:250:43)
I have the same problem when making a query with conditions. The information I have is summarized in the following paragraphs.
Framework • revision 93da78f896 (2 days ago) • 2021-10-16 07:18:02 -0400
Engine • revision faa45f497f
Tools • Dart 2.15.0 (build 2.15.0-226.0.dev)
Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 2.6.0-12.0.pre.379, on macOS 11.6 20G165 darwin-x64, locale es)
[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 13.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] Connected device (2 available)
Invalid argument(s): Failed to lookup symbol 'memcpy': dlsym(RTLD_DEFAULT, memcpy): symbol not found.
flutter: #0 ObjectCollectorError.throwIfError (package:objectbox/src/native/bindings/data_visitor.dart:56:24)
#1 Query.find (package:objectbox/src/native/query/query.dart:807:18)
#2 UsuarioDataSource.getFiltered (package:cetursa/data/datasources/local/database/usuario_datasource.dart:37:36)
#3 UsuarioRepo.validateUser (package:cetursa/domain/repositories/usuario_repository.dart:32:25)
#4 LoginScreen.onPressedAcceder (package:cetursa/presentation/screens/login/login_screen.dart:162:18)
#5 LoginScreen._buildSignInButton.<anonymous closure> (package:cetursa/presentation/screens/login/login_screen.dart:149:11)
#6 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:989:21)
#7 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:198:24)
#8 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:608:11)
#9 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:296:5)
Update: not fixed by latest Flutter versions https://github.com/flutter/flutter/issues/90896#issuecomment-953704933
We have released the preview version 1.2.1-dev.0
which should fix this issue. Can anyone confirm?
Updating to the preview version fixed it for me.
it also works for me with the new version 1.2.1-dev.0
1.2.1-dev.0
fixed it for me.
1.2.1-dev.0 on IOS 15 box.getAll() FIXED. Nice...
It still doesn't work on each machine with XCode 13.1. Also this 1.2.1-dev.0 version contains Android bug: Failed to lookup symbol (undefined symbol: obx_txn_mark_success)
@slavamarchenko A little more information would be nice; e.g. to reproduce and ensure it's not a local configuration issue on your side.
@slavamarchenko A little more information would be nice; e.g. to reproduce and ensure it's not a local configuration issue on your side.
For the Android issue I am using 1.2.1-dev.0 (Flutter 2.5.3, XCode 13.1) release and running:
return boxStorage.store.runInTransaction<void>(TxMode.write, () {
// remove all properties with such key
box.removeMany(_findPropertiesByKey(key).map((e) => e.id).toList());
// add new property
box.put(ObjBoxProperty.fromValue(key, value));
});
and that I have as error:
Unhandled Exception: Unhandled error Invalid argument(s): Failed to lookup symbol (undefined symbol: obx_txn_mark_success) occurred in Instance of 'TrailNavigationBloc'.
E/flutter ( 1221): #0 DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:31:29)
E/flutter ( 1221): #1 ObjectBoxC._txn_mark_success_ptr (package:objectbox/src/native/bindings/objectbox-c.dart:1329:55)
E/flutter ( 1221): #2 ObjectBoxC._txn_mark_success_ptr (package:objectbox/src/native/bindings/objectbox-c.dart)
E/flutter ( 1221): #3 ObjectBoxC._txn_mark_success (package:objectbox/src/native/bindings/objectbox-c.dart:1331:7)
E/flutter ( 1221): #4 ObjectBoxC._txn_mark_success (package:objectbox/src/native/bindings/objectbox-c.dart)
E/flutter ( 1221): #5 ObjectBoxC.txn_mark_success (package:objectbox/src/native/bindings/objectbox-c.dart:1322:12)
E/flutter ( 1221): #6 Transaction._mark (package:objectbox/src/native/transaction.dart:57:18)
E/flutter ( 1221): #7 Transaction.markFailed (package:objectbox/src/native/transaction.dart:63:24)
E/flutter ( 1221): #8 Store._runInTransaction (package:objectbox/src/native/store.dart:314:47)
E/flutter ( 1221): #9 Store.runInTransaction (package:objectbox/src/native/store.dart:292:12)
On 1.2.0 it works perfect.
Sorry, I have no possibility to get details for IOS Simulator issue, that happened not on my machine actually.
I get the same error:
Unhandled Exception: Invalid argument(s): Failed to lookup symbol (undefined symbol: obx_txn_mark_success)
(only if transaction used)
After upgrading to version 3.0.1 (3.0.0 same error) https://github.com/objectbox/objectbox-dart/commit/92fd183af6e5fe49de4a88caab36347d7f6554f8#diff-963235985f7c9ab2052d5d82863dd8aba3c6e3b805ae87046f6d9cca7ab55547R19
As i can see, issue has happened because function obx_txn_mark_success
was removed from export on new version of libobjectbox-jni.so
https://github.com/objectbox/objectbox-c/blob/5ab1a43077eb2cf24c36dbc2f4272cab25fc8836/include/objectbox.h#L758
v2.9.2-RC3 - version ok.
Why flutter package needs to link with android aar package and not with native shared library directly?
@slavamarchenko @clouddevil Thanks for reporting. This should be fixed in the latest preview release 1.2.1-dev.1
. Can you confirm?
@slavamarchenko @clouddevil Thanks for reporting. This should be fixed in the latest preview release
1.2.1-dev.1
. Can you confirm?
Yes, have not tried on IOS but on Android works fine. Thanks)
The 1.2.1
release that resolves this issue is now available. Thanks again everyone!
After upgrading XCode to the very recent version 13.0, our flutter app crashes when doing a box.get(id) with an exception : ArgumentError (Invalid argument(s): Failed to lookup symbol (dlsym(RTLD_DEFAULT, memcpy): symbol not found))
Basic info (please complete the following information):
Additionally, you can choose to provide more details, e.g. the output of:
pub deps --no-dev
flutter doctor -v
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/f.julian/Library/Android/sdk ✗ cmdline-tools component is missing Run
path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details. ✗ Android license status unknown. Runflutter doctor --android-licenses
to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.[✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 13.0, Build version 13A233 • CocoaPods version 1.11.2
[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3) • Android Studio at /Applications/Android Studio.app/Contents • 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 11.0.10+0-b96-7281165)
[✓] VS Code (version 1.60.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.26.0
[✓] Connected device (3 available) • iPhone 13 (mobile) • A8BA3F65-5DE2-4CBF-BD80-D7006EC695D1 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator) • macOS (desktop) • macos • darwin-x64 • macOS 11.6 20G165 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 93.0.4577.82
! Doctor found issues in 1 category.
0 DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:31:29)
1 memcpy (package:objectbox/src/native/bindings/nativemem.dart)
2 memcpy (package:objectbox/src/native/bindings/nativemem.dart)
3 ReaderWithCBuffer.access (package:objectbox/src/native/bindings/flatbuffers.dart:128:7)
4 CursorHelper.readData (package:objectbox/src/native/bindings/helpers.dart:111:36)
5 CursorHelper.get (package:objectbox/src/native/bindings/helpers.dart:130:41)
6 Box.get. (package:objectbox/src/native/box.dart:229:67)
7 Store._runInTransaction (package:objectbox/src/native/store.dart:305:24)
8 InternalStoreAccess.runInTransaction (package:objectbox/src/native/store.dart:365:13)
9 Box.get (package:objectbox/src/native/box.dart:228:41)
10 Dao.getById (package:sign/services/dao.dart:29:29)
11 Dao.getByIdOrDefault (package:sign/services/dao.dart:33:12)
12 Dao.getFirstOrDefault (package:sign/services/dao.dart:28:46)
13 MyApp.build. (package:sign/main.dart:74:50)
14 Consumer.build (package:flutter_riverpod/src/consumer.dart:269:20)
15 _ConsumerState.build (package:flutter_riverpod/src/consumer.dart:371:19)
16 StatefulElement.build (package:flutter/src/widgets/framework.dart:4782:27)
17 ConsumerStatefulElement.build (package:flutter_riverpod/src/consumer.dart:430:20)
18 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4665:15)
19 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4840:11)
20 Element.rebuild (package:flutter/src/widgets/framework.dart:4355:5)
21 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4643:5)
22 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4831:11)
23 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4638:5)
24 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3673:14)
25 Element.updateChild (package:flutter/src/widgets/framework.dart:3425:18)
26 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4690:16)
27 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4840:11)
28 Element.rebuild (package:flutter/src/widgets/framework.dart:4355:5)
29 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4643:5)
30 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4831:11)
31 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4638:5)
32 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3673:14)
33 Element.updateChild (package:flutter/src/widgets/framework.dart:3425:18)
34 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4690:16)
35 Element.rebuild (package:flutter/src/widgets/framework.dart:4355:5)
36 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4643:5)
37 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4638:5)
38 _UncontrolledProviderScopeElement.mount (package:flutter_riverpod/src/framework.dart:252:11)
39 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3673:14)
40 Element.updateChild (package:flutter/src/widgets/framework.dart:3425:18)
41 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4690:16)
42 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4840:11)
43 Element.rebuild (package:flutter/src/widgets/framework.dart:4355:5)
44 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4643:5)
45 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4831:11)
46 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4638:5)
47 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3673:14)
48 Element.updateChild (package:flutter/src/widgets/framework.dart:3425:18)
49 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:1198:16)
50 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:1167:5)
51 RenderObjectToWidgetAdapter.attachToRenderTree. (package:flutter/src/widgets/binding.dart:1112:18)
52 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2573:19)
53 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:1111:13)
54 WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:944:7)
55 WidgetsBinding.scheduleAttachRootWidget. (package:flutter/src/widgets/binding.dart:924:7)
56 _rootRun (dart:async/zone.dart:1420:47)
57 _CustomZone.run (dart:async/zone.dart:1328:19)
58 _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
59 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1276:23)
60 _rootRun (dart:async/zone.dart:1428:13)
61 _CustomZone.run (dart:async/zone.dart:1328:19)
62 _CustomZone.bindCallback. (dart:async/zone.dart:1260:23)
63 Timer._createTimer. (dart:async-patch/timer_patch.dart:18:15)
64 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:395:19)
65 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:426:5)
66 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)