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

Error when running in Macos after clicking transcribe #13

Open
LiveRock opened this issue Feb 24, 2023 · 9 comments
Open

Error when running in Macos after clicking transcribe #13

LiveRock opened this issue Feb 24, 2023 · 9 comments

Comments

@LiveRock
Copy link

Hi
I followed the instructions to build the file in native_lib.

I got a libwhisper.dylib file
I renamed it libwhisper.so and copied it into the futter lib folder
I am able to build and run but when I click transcribe, I get the following error:

flutter: Invalid argument(s): Failed to lookup symbol 'request': dlsym(RTLD_DEFAULT, request): symbol not found

══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
The following _TypeError was thrown while handling a gesture:
type 'Future<dynamic>' is not a subtype of type 'String'

When the exception was thrown, this was the stack:
#0      _HomePageState.build.<anonymous closure>.<anonymous closure> (package:whisper_dart_my_first_test_v2/pages/home_page.dart:82:19)
dart-lang/ffi#1      State.setState (package:flutter/src/widgets/framework.dart:1133:30)
dart-lang/ffi#2      _HomePageState.build.<anonymous closure> (package:whisper_dart_my_first_test_v2/pages/home_page.dart:80:17)
dart-lang/ffi#3      _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1096:21)
dart-lang/ffi#4      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:253:24)
dart-lang/ffi#5      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:627:11)
dart-lang/ffi#6      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:306:5)
dart-lang/ffi#7      BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:239:7)
dart-lang/ffi#8      PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:615:9)
dart-lang/ffi#9      PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:98:12)
dart-lang/ffi#10     PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:143:9)
dart-lang/ffi#11     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:625:13)
dart-lang/ffi#12     PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:141:18)
dart-lang/ffi#13     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:127:7)
dart-lang/ffi#14     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:460:19)
dart-lang/ffi#15     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:440:22)
dart-lang/ffi#16     RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:336:11)
dart-lang/ffi#17     GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:395:7)
dart-lang/ffi#18     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:357:5)
dart-lang/ffi#19     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:314:7)
dart-lang/ffi#20     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:295:7)
dart-lang/ffi#21     _invoke1 (dart:ui/hooks.dart:164:13)
dart-lang/ffi#22     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:361:7)
dart-lang/ffi#23     _dispatchPointerDataPacket (dart:ui/hooks.dart:91:31)

Handler: "onTap"
Recognizer:
  TapGestureRecognizer#b6523
════════════════════════════════════════════════════════════════════════════════════════════════════

What did I do wrong here?

@azkadev
Copy link
Owner

azkadev commented Feb 24, 2023

I don't have a mac device so I don't know

@LiveRock
Copy link
Author

Where should I place the whisper.so file?

@ibrahimdevs
Copy link
Contributor

@LiveRock I'm stucked with the same error.

@azkadev @JeisonSanches please provide step by step documentation at least for running the example flutter project. So ,you can save lots of our time. I'm a flutter developer, so I don't know how to compile and make c files. For now,

  1. I pulled this project
  2. Change directory package/whisper_flutter/src
  3. Run your command:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
  1. My build folder;
    Screenshot 2023-03-03 at 16 17 18

I didn't make anything else and run example project which inside the whisper_flutter/example.

Is there anything else need to do?

@JeisonSanches
Copy link
Collaborator

@LiveRock I'm stucked with the same error.

@azkadev @JeisonSanches please provide step by step documentation at least for running the example flutter project. So ,you can save lots of our time. I'm a flutter developer, so I don't know how to compile and make c files. For now,

  1. I pulled this project
  2. Change directory package/whisper_flutter/src
  3. Run your command:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
  1. My build folder;
    Screenshot 2023-03-03 at 16 17 18

I didn't make anything else and run example project which inside the whisper_flutter/example.

Is there anything else need to do?

I'm not able to test on a mac device right now... But you shouldn't need to deal with the CMAKE files, it should work out of the box.

Can you test my fork and tell me what you're getting?
https://github.com/JeisonSanches/whisper_dart

@ibrahimdevs
Copy link
Contributor

ibrahimdevs commented Mar 3, 2023

I'm not able to test on a mac device right now... But you shouldn't need to deal with the CMAKE files, it should work out of the box.

Can you test my fork and tell me what you're getting? https://github.com/JeisonSanches/whisper_dart

Thanks for quick reply @JeisonSanches
I'm working on my Mac and trying to run this on iPhone
I tried your fork;

  1. Pulled your fork
  2. Open example project and tried to run, I get an error from root pubspec.yaml "version: +240.0.3", I changed it to "version: 240.0.3"
  3. Tried to run again;
Running Xcode build...
Xcode build done.                                            6.7s
Failed to build iOS app
Could not build the precompiled application for the device.
Semantic Issue (Xcode): 'charToString' has C-linkage specified, but returns user-defined type 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>') which is incompatible with C
/Users/ibrahim/ws/whisper_dart_jeison/src/main.cpp:36:16

Semantic Issue (Xcode): 'to_timestamp' has C-linkage specified, but returns user-defined type 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>') which is incompatible with C
/Users/ibrahim/ws/whisper_dart_jeison/src/main.cpp:51:16

Semantic Issue (Xcode): 'transcribe' has C-linkage specified, but returns user-defined type 'json' (aka 'basic_json<>') which is incompatible with C
/Users/ibrahim/ws/whisper_dart_jeison/src/main.cpp:80:9


Error launching application on ibrahim 13 Pro.

But I tried it on my Android device and it worked.
I think there is a problem about iOS rather than Mac, could you try to run on iOS simulator?

Thanks again!

@LiveRock
Copy link
Author

LiveRock commented Mar 4, 2023

I took out everything about the library in xcode, and I was able to build the Flutter app. But when I click Transcribe, I get this error:

flutter: Invalid argument(s): Failed to lookup symbol 'request': dlsym(RTLD_DEFAULT, request): symbol not found

@JeisonSanches
Copy link
Collaborator

Failed to lookup symbol 'request': dlsym(RTLD_DEFAULT, request): symbol not found

Can you try this and let me know what you got?

@LiveRock
Copy link
Author

LiveRock commented Mar 4, 2023

Yes, already tried. Still getting same error
I also added the path in 'library search path'

@dimitristaufer
Copy link

Glad to read that I'm not the only one facing this issue. I've been trying multiple approaches for hours now, but no luck.
Has anyone been able to solve this or find a workaround?

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

5 participants