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

breez does not work at all when used on a same app that uses bdk_flutter on iOS (only) #7

Open
sagarsubedi opened this issue Jan 29, 2024 · 8 comments
Assignees

Comments

@sagarsubedi
Copy link

sagarsubedi commented Jan 29, 2024

We have a flutter app that is a BTC wallet built with bdk_flutter. We then decided to integrate lightning and thus used breez. It was working fine on Android but on iOS, it does not work at all. After spending weeks, I created a completely new flutter app with just breez, and to my surprise, it showed my lightning balance and that little app worked fine. Even the workshop repo created by @JssDWt worked perfectly on ios. But in our app (on ios), it did not. Then in the new app I wrote, I added bdk_flutter just to see if that made a difference: flutter pub add bdk_flutter. And then that new app also did not work. I added bdk_flutter as dependency on that workshop repo, and it also stopped working.

To replicate:

  1. Have a flutter app that uses breez
  2. Add bdk via flutter pub add bdk_flutter
  3. Run the app again (uninstall your current app just to be safe)
  4. Breez will suddenly stop working

You dont have to use any features of bdk. Just having it as a dependency will create this issue. One thing I saw in common is the Network class. Another thing is that they both use flutter_rust_bridge and uuid. Not sure if those have anything to do with this.

Summary: using breez together with bdk_flutter will cause breez to stop completely. No logs, no erros, no exceptions, no nothing. Simply skips the whole sdk functions as if they aren't there. Just add bdk_flutter as dependency to replicate. I tested in ios 17 (that is the only version i have available both physically and simulator). Not sure if this issue persists in other versions of ios. And this is an ios-only issue. Android works just fine all the time. Link to bdk_flutter on pubdev https://pub.dev/packages/bdk_flutter

@JssDWt
Copy link
Contributor

JssDWt commented Jan 29, 2024

Can confirm. With https://github.com/jssdwt/breez_sdk_flutter_workshop the breez sdk doesn't do anything if you install bdk_flutter. No logs, nothing. Only on iOS.

@roeierez
Copy link
Member

@ademar111190 can you please take a look?

@roeierez
Copy link
Member

@sagarsubedi still looking into it. We opened meantime an issue in flutter rust bridge repo: fzyzcjy/flutter_rust_bridge#1712

@sagarsubedi
Copy link
Author

@roeierez I saw your comment on that issue:

OK removing that line about static linking and now I am able to use DynamicLibrary.open to load the symbols and it works side by side with the bdk_flutter.

So does that mean breez users can expect a fix soon? Or is it more involved that that? Thanks.

@roeierez
Copy link
Member

roeierez commented Feb 1, 2024

So does that mean breez users can expect a fix soon? Or is it more involved that that? Thanks.

We are totally focusing on this issue. It turns out not an easy one since we may need the way we expose the dependency to flutter, the way we link and the way we load the library. for iOS We still looking for the right approach but I am definitely positive that we will solve this ver soon.
I will keep you updated.

@roeierez
Copy link
Member

roeierez commented Feb 1, 2024

@sagarsubedi we have pushed an early version with dynamic loading that should work side by side with bdk_flutter. Please use this in your pubspec.yaml:

breez_sdk:
    git:
      ref: dloader
      url: https://github.com/breez/breez-sdk-flutter.git

It is an early one that only meant to unblock you, we still need to formalize that and push it as a formal release.
Please check and let me know how it goes.

@sagarsubedi
Copy link
Author

I've already texted you outside of Github, but just so it is recorded here: The dloader branch does work. I am now able to use breez on my ios device.

@roeierez
Copy link
Member

roeierez commented Feb 2, 2024

@sagarsubedi thanks for your feedback!
We will leave this issue opened untill it is solved in the release process

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

4 participants