intiface / intiface-central

Intiface Central (Buttplug Frontend) Application for Desktop and Mobile
Other
125 stars 17 forks source link

App stuck on loading screen #114

Open kalirosenkreuz opened 11 months ago

kalirosenkreuz commented 11 months ago

On void linux, using latest version. Running any prebuilt binary on the intiface site gives:

(intiface_central:29352): Gdk-CRITICAL **: 22:39:42.447: gdk_window_get_state: assertion 'GDK_IS_WINDOW (window)' failed

Building and running from flutter run from the cloned repository gives slightly more info:

Building Linux application...

(intiface_central:7696): Gdk-CRITICAL **: 22:51:17.280: gdk_window_get_state: assertion 'GDK_IS_WINDOW (window)' failed
flutter: šŸ‘» 22:51:18.008056 INFO     Global Loggy - Intiface Central 2.5.1+18 Starting...
flutter: šŸ‘» 22:51:18.013399 INFO     Global Loggy - Running main builder
flutter: šŸ‘» 22:51:18.013525 INFO     Global Loggy - Initializing paths...
flutter: šŸ‘» 22:51:18.151950 INFO     Global Loggy - Starting file logger...
flutter: āš ļø 22:51:18.159969 WARNING  Global Loggy - DSN not set, crash reporting cannot be used in this version of Intiface Central
flutter: šŸ‘» 22:51:18.211287 INFO     Global Loggy - Testing window position Offset(23.0, 23.0) against DP-2 (Size(1920.0, 1080.0) Offset(0.0, 0.0))
flutter: šŸ‘» 22:51:18.212222 INFO     Global Loggy - Window in bounds for DP-2
flutter: āš ļø 22:51:18.218995 WARNING  Global Loggy - Intiface currently running in DEBUG MODE.
Syncing files to device Linux...                                   285ms

Flutter run key commands.
r Hot reload. šŸ”„šŸ”„šŸ”„
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

A Dart VM Service on Linux is available at: http://127.0.0.1:37133/pqhlYp5I8o4=/
The Flutter DevTools debugger and profiler on Linux is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:37133/pqhlYp5I8o4=/
flutter: šŸ‘» 22:51:18.277341 INFO     Global Loggy - Device configuration file version: 2.22
flutter: šŸ‘» 22:51:18.379047 INFO     Global Loggy - Initializing API static via lib/libintiface_engine_flutter_bridge.so
flutter: šŸ› 22:51:18.384503 DEBUG    Global Loggy - Running HTTP Update for https://intiface-central-news.intiface.com/news.md with expected version "7a9837df5940e825b123b438674b56eb-ssl-df"
flutter: šŸ› 22:51:18.679263 DEBUG    Global Loggy - No new version for https://intiface-central-news.intiface.com/news.md found
flutter: šŸ› 22:51:18.679782 DEBUG    Global Loggy - Running HTTP Update for https://intiface-engine-device-config.intiface.com/ with expected version "36b487b1a7f4eccddff45086a96c2c37-ssl-df"
flutter: šŸ› 22:51:18.970907 DEBUG    Global Loggy - No new version for https://intiface-engine-device-config.intiface.com/ found
flutter: šŸ‘» 22:51:18.971884 INFO     Global Loggy - Checking for application update

The application hangs indefinitely after that last line.

The window will open, but stuck on this screen forever: image

orangejuice24 commented 5 months ago

I ran into the same issue on Linux. It looks like the problem only happens when you run the app with flutter run.

The root of the problem for me was in fft.dart with creating the DynamicLibrary to pass to IntifaceEngineFlutterBridgeImpl. The current code will look in the current working directory of the process. In the release bundles, the application is likely executed in the bundle directory. In this case there is a lib directory alongside it that will contain the intiface_engine_flutter_bridge library. When running with flutter run the cwd is actually the root directory of the project (or wherever you run it from presumably). In this case, the library is not located in the lib directory as expected.

I fixed this by resolving the directory that the executable is located in and prepending the dylib path with that. I wasn't sure about windows or android, so on those platforms I just prepended the current working directory to retain the existing behavior.

One other issue I ran into was in intiface_central_app.dart:buildApp. There isn't any exception handling and it doesn't seem like FutureBuilder does anything useful if the future throws an exception of returns a Future.error. Not sure what the best fix for this would be. As a debugging patch I wrapped the whole body in a try-catch and logged the exception.

Here's the change to ffi.dart: https://github.com/orangejuice24/intiface-central/commit/79a1f5d02113c1dba23c8ead2e7e0e42c1edb2f8