Skip to content
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

[path_provider] how to use path_provider_tizen? #333

Closed
iMro0t opened this issue Feb 27, 2022 · 7 comments
Closed

[path_provider] how to use path_provider_tizen? #333

iMro0t opened this issue Feb 27, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@iMro0t
Copy link

iMro0t commented Feb 27, 2022

I added path_provider_tizen in my pubspec but when some other packages like google_font try to get path it's not calling path_provider_tizen and throwing an error.

OS: Tizen TV
Error:

[E] [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: FileSystemException: Creation failed, path = '/home/owner/.local' (OS Error: Permission denied, errno = 13)
[E] [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: FileSystemException: Creation failed, path = '/home/owner/.local' (OS Error: Permission denied, errno = 13)
#0      _Directory.create.<anonymous closure> (dart:io/directory_impl.dart:117:11)
#1      _rootRunUnary (dart:async/zone.dart:1434:47)
#2      _CustomZone.runUnary (dart:async/zone.dart:1335:19)
<asynchronous suspension>
#3      PathProviderLinux.getApplicationSupportPath (package:path_provider_linux/src/path_provider_linux.dart:65:5)
<asynchronous suspension>
#4      getApplicationSupportDirectory (package:path_provider/path_provider.dart:77:24)
<asynchronous suspension>
#5      _localPath (package:google_fonts/src/file_io_desktop_and_mobile.dart:28:21)
<asynchronous suspension>
#6      _localFile (package:google_fonts/src/file_io_desktop_and_mobile.dart:33:16)
<asynchronous suspension>
#7      saveFontToDeviceFileSystem (package:google_fonts/src/file_io_desktop_and_mobile.dart:7:16)
<asynchronous suspension>

@swift-kim
Copy link
Member

Hmm. That's weird. Can you see the tizen/flutter/generated_main.dart file in your project directory and does it contain the following content?

import 'package:path_provider_tizen/path_provider_tizen.dart';

@pragma('vm:entry-point')
class _PluginRegistrant {
  @pragma('vm:entry-point')
  static void register() {
    PathProviderPlugin.register();
  }
}

@iMro0t
Copy link
Author

iMro0t commented Feb 27, 2022

Hmm. That's weird. Can you see the tizen/flutter/generated_main.dart file in your project directory and does it contain the following content?

import 'package:path_provider_tizen/path_provider_tizen.dart';

@pragma('vm:entry-point')
class _PluginRegistrant {
  @pragma('vm:entry-point')
  static void register() {
    PathProviderPlugin.register();
  }
}

Yes. It contains those lines

@iMro0t
Copy link
Author

iMro0t commented Feb 27, 2022

I noticed that TargetPlatform is linux for TizenTV and therefore path_provider_linux is being used instead of path_provider_tizen

@swift-kim
Copy link
Member

I noticed that TargetPlatform is linux for TizenTV

This is normal because Tizen OS is Linux-kernel based.

Could you share your flutter-tizen doctor -v result and the path_provider_tizen version?

@iMro0t
Copy link
Author

iMro0t commented Feb 27, 2022

❯ flutter-tizen doctor -v
[✓] Flutter (Channel unknown, 2.10.1, on macOS 12.2 21D49 darwin-arm, locale en-IN)
    • Flutter version 2.10.1 at /Users/abhi/tools/flutter-tizen/flutter
    • Upstream repository unknown
    • Framework revision db747aa133 (3 weeks ago), 2022-02-09 13:57:35 -0600
    • Engine revision ab46186b24
    • Dart version 2.16.1
    • DevTools version 2.9.2

[✓] Tizen toolchain - develop for Tizen devices
    • Framework revision 20c53c9a6c (12 days ago), 2022-02-15 11:43:02 +0900
    • Engine revision 789ddaff1f
    • Tizen Studio 4.5.1 at /Users/abhi/tizen-studio
    • .NET SDK 6.0.102 at /usr/local/bin/dotnet

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/abhi/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/abhi/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.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.11+0-b60-7772763)

[✓] VS Code (version 1.64.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.34.0

[✓] Connected device (3 available)
    • macOS (desktop)               • macos              • darwin-arm64   • macOS 12.2 21D49 darwin-arm
    • Chrome (web)                  • chrome             • web-javascript • Google Chrome 98.0.4758.109
    • Tizen QA55LS03AAKLXL (mobile) • 192.0.236.17:26101 • flutter-tester • Tizen 6.0

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!


path_provider_tizen: ^2.0.2

@swift-kim
Copy link
Member

https://github.com/flutter-tizen/flutter-tizen/wiki/Limitations#plugins

Currently path_provider_tizen must be invoked from root isolates only. Your error might be related to this limitation. Is your code that invokes the google_fonts package being run on a non-root isolate? Have you tried invoking getApplicationSupportDirectory from elsewhere in your app?

@swift-kim swift-kim added the bug Something isn't working label Mar 30, 2022
@swift-kim
Copy link
Member

#123 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants