itamadev / golang-flutter-app-ffi

A Flutter app with Golang as a backend using FFI to bind and communicate between them
MIT License
20 stars 4 forks source link

Error: no such file or directory #1

Open prologic opened 1 year ago

prologic commented 1 year ago

Hey, just testing your little demo out as I'm looking for a good way to build mobile apps in Flutter (for the UI part) with a Go backend.

I tried to build this on my iMac, deployed to my iPhone and got this error:

══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
The following ArgumentError was thrown while handling a gesture:
Invalid argument(s): Failed to load dynamic library './vendor-out/text.a':
dlopen(./vendor-out/text.a, 0x0001): tried: '/usr/lib/swift/./vendor-out/text.a' (no such file),
'/private/var/containers/Bundle/Application/407A3657-732C-43E9-BEF6-D4C2FB5EF36C/Runner.app/Frameworks/./vendor-out/text.a'
(no such file), './vendor-out/text.a' (no such file)

When the exception was thrown, this was the stack:
#0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:12:43)
#1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:23:12)
#2      dylib (package:app/create_message.dart:9:34)
#3      dylib (package:app/create_message.dart)
#4      _createMessage (package:app/create_message.dart:11:38)
#5      _createMessage (package:app/create_message.dart)
#6      createMessage (package:app/create_message.dart:16:3)
#7      _CreateTextFormState.build.<anonymous closure> (package:app/main.dart:54:11)
#8      _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1072:21)
#9      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:253:24)
#10     TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:627:11)
#11     BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:306:5)
#12     BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:276:7)
#13     GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:163:27)
#14     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:464:20)
#15     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:440:22)
#16     RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:337:11)
#17     GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:395:7)
#18     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:357:5)
#19     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:314:7)
#20     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:295:7)
#21     _invoke1 (dart:ui/hooks.dart:167:13)
#22     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:341:7)
#23     _dispatchPointerDataPacket (dart:ui/hooks.dart:94:31)

Handler: "onTap"
Recognizer:
  TapGestureRecognizer#94dcc

I run:

$ make run FLUTTER_DEVICE=<device>

Where <device> is the device-id my my connected iPhone.

What did I do wrong? 🤔

itamadev commented 1 year ago

Hey @prologic,

First of all, thank you for the detailed issue! 😄

This project was tested mainly on web-based flutter projects, to run this as an app will probably require some extra steps, if you come across a solution I'll happily look through a PR if you have one.

Other than that I'll do the following regarding this issue:

And as a general note, this project is aiming to find a solution for running Flutter (as frontend) and golang (as backend) as the same service, if that's something you're looking for that's awesome!

prologic commented 1 year ago

Perfect! My use case is primarily Mobile App 👌

itamadev commented 1 year ago

Hey! I just created a new issue dedicated to testing out this issue, you can follow it here #4