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

about init #22

Open
jtaxiexpress opened this issue Dec 15, 2024 · 0 comments
Open

about init #22

jtaxiexpress opened this issue Dec 15, 2024 · 0 comments

Comments

@jtaxiexpress
Copy link

jtaxiexpress commented Dec 15, 2024

This would be a nice package.
Perhaps await tagger.init(“assets/ipadic”, true); is no possible.

スクリーンショット 2024-12-15 15 18 15

assets/ipadic

スクリーンショット 2024-12-15 15 36 57

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.27.0, on macOS 15.1.1 24B91 darwin-arm64, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.95.3)
[✓] Connected device (5 available)
[✓] Network resources

• No issues found!

error

[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: Invalid argument(s): Failed to lookup symbol 'initMecab': dlsym(RTLD_DEFAULT, initMecab): symbol not found
#0      DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:33:70)
#1      initMecabPointer (package:mecab_dart/mecab_dart.dart:30:18)
#2      initMecabPointer (package:mecab_dart/mecab_dart.dart)
#3      initMecabFfi (package:mecab_dart/mecab_dart.dart:31:22)
#4      initMecabFfi (package:mecab_dart/mecab_dart.dart)
#5      Mecab.initWithIpadicDir (package:mecab_dart/mecab_dart.dart:132:16)
#6      Mecab.init (package:mecab_dart/mecab_dart.dart:118:5)
<asynchronous suspension>
#7      _HomeScreenState.initPlatformState (package:xxxxxxxxxx/homescreen.dart:185:7)
<asynchronous suspension>

code

class _HomeScreenState extends State<HomeScreen> {
  var tagger = Mecab();

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  @override
  Future<void> initPlatformState() async {
    String platformVersion;
    try {
      platformVersion = await Mecab.platformVersion;
      await tagger.init("assets/ipadic", true);
    } on PlatformException {
      platformVersion = 'Failed to get platform version.';
    }

    if (!mounted) return;

    setState(() {
      _platformVersion = platformVersion;
      print(platformVersion);
    });
  }

pubspec.yaml

dependencies:
  flutter:
    sdk: flutter

  mecab_dart:
    git:
      url: https://github.com/dttvn0010/mecab_dart.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant