Closed liquidiert closed 6 months ago
I also am experiencing this issue! From the example app:
Building Linux application...
flutter: `app_links` threw an error: 'package:flutter/src/services/platform_channel.dart': Failed assertion: line 554 pos 7: '_binaryMessenger != null || BindingBase.debugBindingType() != null': Cannot set the method call handler before the binary messenger has been initialized. This happens when you call setMethodCallHandler() before the WidgetsFlutterBinding has been initialized. You can fix this by either calling WidgetsFlutterBinding.ensureInitialized() before this or by passing a custom BinaryMessenger instance to MethodChannel().. The app may not function as expected until you remove this plugin from pubspec.yaml
I debugged this issue and the problem is that dartPluginClass
is being used to register the linux platform, but it uses methods from the gtk
package, which calls a platform method. At the stage the app_links linux plugin is registered, the platform binding hasn't been initialized yet and gtk
fails to connect to the linux platform (This is the reason why MissingPluginException
is being thrown - flutter fails to register the dart class and fall backs to the method_channel implementation).
@bdlukaa Thanks for the feedback, I think I get it. I released beta 3 as a fix attempt. Tell me if this is better (I don't have linux).
Thank you for your efforts. The issue seems to be fixed now!
Released in v3.5.0
Hey @bdlukaa Can You Please Guide Me Through How You Got Deeplinks Configured in Linux as i am having a Hard Time Tried Everything. Even the Example Package But Nothing Works For Me Can You Please Share Your Insights of What I might be Doing Wrong Here.
@mehroz-mufin This issue was tracking the app initialization issue when app_links
was added as a dependency. I also can not use deep links in the Linux platform, but didn't have the time to look what is wrong.
@mehroz-mufin whta did you try so far? Did you set up a desktop file with the %u parameter?
Describe the bug
Tested deep linking with the current main branch and am getting following error:
I am using WidgetsFlutterBinding.ensureInitialized() in my main function so this is rather a bug in the package itself. Also the the example project throws another error:
Is it related to
[ ] App Links (Android)
[ ] Deep Links (Android)
[ ] Universal Links (iOS)
[ ] or Custom URL schemes? (iOS) [x] Deep Links (Linux)
Does the example project work?
[ ] Yes
[x] No
[ ] Irrelevant here
Did you fully read the instructions for the targeted platform before submitting this issue?
Uploaded your files to webserver, HTTPS, direct connection, scheme pattern setup, ...
[x] Yes
[ ] No
[ ] Irrelevant here