Skip to content

How do I use a plugin? #192

Closed
Closed
@MateoSegura

Description

@MateoSegura

Hello,

I managed to successfully build my app and run it on a Raspberry Pi 4.

I wanted to use https://pub.dev/packages/flutter_libserialport to talk to a serial port through my pi.

When I build the app.so, and run the app using flutter-pi --release, the following is outputted, before the app launches into a grey screen:

flutter: Invalid argument(s): Failed to load dynamic library 'libserialport.so': libserialport.so: cannot open shared object file: No such file or directory

I am aware this is because I don't have the .so file in the src folder of flutter-pi.

However, I have NO IDEA how to build/get this file.

Any suggestions, tips, examples or explanations are much appreciated.

Thanks in advance.

Here's the entire output btw:

flutter: Invalid argument(s): Failed to load dynamic library 'libserialport.so': libserialport.so: cannot open shared object file: No such file or directory flutter: #0 _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11) flutter: #1 new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:20) flutter: #2 dylib (package:libserialport/src/dylib.dart:32) flutter: #3 _SerialPortImpl.availablePorts.<anonymous closure> (package:libserialport/src/port.dart:230) flutter: #4 Util.call (package:libserialport/src/util.dart:37) flutter: #5 _SerialPortImpl.availablePorts (package:libserialport/src/port.dart:230) flutter: #6 SerialPort.availablePorts (package:libserialport/src/port.dart:82) flutter: #7 _ExampleAppState.initPorts.<anonymous closure> (package:flutter_libserialport_example/main.dart:39) flutter: #8 State.setState (package:flutter/src/widgets/framework.dart:1088) flutter: #9 _ExampleAppState.initPorts (package:flutter_libserialport_example/main.dart:39) flutter: #10 _ExampleAppState.initState (package:flutter_libserialport_example/main.dart:33) flutter: #11 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4711) flutter: #12 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4548) flutter: #13 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3611) flutter: #14 Element.updateChild (package:flutter/src/widgets/framework.dart:3363) flutter: #15 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:1189) flutter: #16 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:1159) flutter: #17 RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (package:flutter/src/widgets/binding.dart:1104) flutter: #18 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2535) flutter: #19 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:1103) flutter: #20 WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:937) flutter: #21 WidgetsBinding.scheduleAttachRootWidget.<anonymous closure> (package:flutter/src/widgets/binding.dart:917) flutter: #29 TickerFuture.whenCompleteOrCancel.thunk (package:flutter/src/scheduler/ticker.dart:407) flutter: (elided 10 frames from class _RawReceivePortImpl, class _Timer, and dart:async)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions