Closed kundankuldeep closed 8 months ago
This crash originates in the path_provider
package, not objectbox
:
2023-08-17 17:41:59.449447+0530 Jeevansathi[1927:1023140] [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
#0 PathProviderApi.getDirectoryPath (package:path_provider_foundation/messages.g.dart:42)
<asynchronous suspension>
#1 getApplicationDocumentsDirectory (package:path_provider/path_provider.dart:121)
<asynchronous suspension>
#2 ObjectBox.create (package:flutter_lib/objectBox/ObjectBoxManager.dart:28)
After googling a bit there does not appear to be a single cause (might be permissions, might be outdated versions). So please have a look yourself. If you solve this we would love to hear your solution in case other users are affected by this.
Thanks @greenrobot-team, Debugging the same!! Will update the solution when we found solution to this.
Without additional information, we are unfortunately not sure how to resolve this issue. Therefore this issue has been automatically closed. Feel free to comment with additional details and we can re-open this issue.
This Issue currently active on path provider, and no solution is provided from the developer yet.
but We have managed to resolve this issue by getting the path from native IOS Platform through channel while creating the box.
Thanks.
Overview: Building a framework with flutter to integrate in existing native IOS Application. The framework consisting of Objectbox for some data persistence, which is not getting initialised when run as framework, giving out channel-error
Basic info:
ObjectBox version: ^2.2.0
ObjectBox flutter libs: ^2.2.0
path_provider: ^2.1.0
Flutter/Dart SDK: Flutter 3.13.0 , Tools • Dart 3.1.0 • DevTools 2.25.0
Reproducible: occurring every time
Build OS: macOs 13.4.1 (c)
Deployment device or OS: iOS 16.6
output of - pub deps --no-dev
Dart SDK 3.1.0 Flutter SDK 3.13.0 flutter_lib 1.0.0+1 ├── another_flushbar 1.12.30 │ └── flutter... ├── cupertino_icons 1.0.5 ├── dio 4.0.6 │ ├── http_parser 4.0.2 │ │ ├── source_span 1.10.0 │ │ │ ├── term_glyph 1.2.1 │ │ │ ├── collection... │ │ │ └── path... │ │ ├── string_scanner 1.2.0 │ │ │ └── source_span... │ │ ├── typed_data 1.3.2 │ │ │ └── collection... │ │ └── collection... │ └── path... ├── flutter 0.0.0 │ ├── characters 1.3.0 │ ├── collection 1.17.2 │ ├── material_color_utilities 0.5.0 │ │ └── collection... │ ├── meta 1.9.1 │ ├── sky_engine 0.0.99 │ ├── vector_math 2.1.4 │ └── web 0.1.4-beta ├── flutter_inappwebview 5.7.2+3 │ └── flutter... ├── flutter_overlay_loader 2.0.0 │ └── flutter... ├── flutter_svg 1.1.6 │ ├── path_drawing 1.0.1 │ │ ├── path_parsing 1.0.1 │ │ │ ├── meta... │ │ │ └── vector_math... │ │ ├── flutter... │ │ ├── meta... │ │ └── vector_math... │ ├── xml 6.3.0 │ │ ├── petitparser 5.4.0 │ │ │ └── meta... │ │ ├── collection... │ │ └── meta... │ ├── flutter... │ ├── meta... │ └── vector_math... ├── internet_connection_checker 1.0.0+1 ├── json_annotation 4.8.1 │ └── meta... ├── numberpicker 2.1.2 │ ├── infinite_listview 1.1.0 │ │ └── flutter... │ └── flutter... ├── objectbox 2.2.0 │ ├── ffi 2.1.0 │ ├── flat_buffers 2.0.5 │ ├── collection... │ ├── meta... │ └── path... ├── objectbox_flutter_libs 2.2.0 │ ├── flutter... │ ├── objectbox... │ └── path_provider... ├── path 1.8.3 ├── path_provider 2.1.0 │ ├── path_provider_android 2.1.0 │ │ ├── flutter... │ │ └── path_provider_platform_interface... │ ├── path_provider_foundation 2.3.0 │ │ ├── flutter... │ │ └── path_provider_platform_interface... │ ├── path_provider_linux 2.2.0 │ │ ├── xdg_directories 1.0.2 │ │ │ ├── meta... │ │ │ └── path... │ │ ├── ffi... │ │ ├── flutter... │ │ ├── path... │ │ └── path_provider_platform_interface... │ ├── path_provider_platform_interface 2.1.0 │ │ ├── platform 3.1.1 │ │ ├── flutter... │ │ └── plugin_platform_interface... │ ├── path_provider_windows 2.2.0 │ │ ├── win32 5.0.6 │ │ │ └── ffi... │ │ ├── ffi... │ │ ├── flutter... │ │ ├── path... │ │ └── path_provider_platform_interface... │ └── flutter... ├── provider 6.0.5 │ ├── nested 1.0.0 │ │ └── flutter... │ ├── collection... │ └── flutter... ├── shared_preferences 2.2.0 │ ├── shared_preferences_android 2.2.0 │ │ ├── flutter... │ │ └── shared_preferences_platform_interface... │ ├── shared_preferences_foundation 2.3.3 │ │ ├── flutter... │ │ └── shared_preferences_platform_interface... │ ├── shared_preferences_linux 2.3.0 │ │ ├── file 6.1.4 │ │ │ ├── meta... │ │ │ └── path... │ │ ├── flutter... │ │ ├── path... │ │ ├── path_provider_linux... │ │ ├── path_provider_platform_interface... │ │ └── shared_preferences_platform_interface... │ ├── shared_preferences_platform_interface 2.3.0 │ │ ├── plugin_platform_interface 2.1.5 │ │ │ └── meta... │ │ └── flutter... │ ├── shared_preferences_web 2.2.0 │ │ ├── flutter_web_plugins 0.0.0 │ │ │ ├── characters... │ │ │ ├── collection... │ │ │ ├── flutter... │ │ │ ├── material_color_utilities... │ │ │ ├── meta... │ │ │ ├── vector_math... │ │ │ └── web... │ │ ├── flutter... │ │ └── shared_preferences_platform_interface... │ ├── shared_preferences_windows 2.3.0 │ │ ├── file... │ │ ├── flutter... │ │ ├── path... │ │ ├── path_provider_platform_interface... │ │ ├── path_provider_windows... │ │ └── shared_preferences_platform_interface... │ └── flutter... └── url_launcher 6.1.12 ├── url_launcher_android 6.0.38 │ ├── flutter... │ └── url_launcher_platform_interface... ├── url_launcher_ios 6.1.4 │ ├── flutter... │ └── url_launcher_platform_interface... ├── url_launcher_linux 3.0.5 │ ├── flutter... │ └── url_launcher_platform_interface... ├── url_launcher_macos 3.0.6 │ ├── flutter... │ └── url_launcher_platform_interface... ├── url_launcher_platform_interface 2.1.3 │ ├── flutter... │ └── plugin_platform_interface... ├── url_launcher_web 2.0.18 │ ├── flutter... │ ├── flutter_web_plugins... │ └── url_launcher_platform_interface... ├── url_launcher_windows 3.0.7 │ ├── flutter... │ └── url_launcher_platform_interface... └── flutter...output of - flutter doctor -v
[✓] Flutter (Channel stable, 3.13.0, on macOS 13.4.1 22F770820d darwin-arm64, locale en-IN) • Flutter version 3.13.0 on channel stable at /Users/kundankumar/kundan/FlutterDev/sdk/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision efbf63d9c6 (35 hours ago), 2023-08-15 21:05:06 -0500 • Engine revision 1ac611c64e • Dart version 3.1.0 • DevTools version 2.25.0
[!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) • Android SDK at /Users/kundankumar/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 14.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14E300c • CocoaPods version 1.12.1
[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.1) • 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.15+0-b2043.56-8887301)
[✓] VS Code (version 1.80.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.70.0
[✓] Connected device (2 available) • macOS (desktop) • macos • darwin-arm64 • macOS 13.4.1 22F770820d darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 115.0.5790.170
[✓] Network resources • All expected network resources are available.
! Doctor found issues in 1 category.
Steps to reproduce
For reference - https://docs.flutter.dev/add-to-app
Expected behavior
The Object box should work fine as its working when running directly from flutter to device
Code
Logs, stack traces
Additional context