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

Binary linking is failing #30

Open
arifinreinaldo opened this issue May 16, 2024 · 22 comments · May be fixed by #35
Open

Binary linking is failing #30

arifinreinaldo opened this issue May 16, 2024 · 22 comments · May be fixed by #35
Assignees
Labels
bug Something isn't working critical help wanted Extra attention is needed
Milestone

Comments

@arifinreinaldo
Copy link

arifinreinaldo commented May 16, 2024

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.0, on macOS 14.5 23F79 darwin-arm64, locale en-SG)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2023.3)
[✓] VS Code (version 1.88.1)
[✓] Connected device (3 available)
[✓] Network resources

step to replicate :
run this code on the Flutter :

        var mercuryjs = Mercury(
            devToolsService: ChromeDevToolsService(),
            bundle: MercuryBundle.fromContent(jsFile),
            onControllerCreated: (controller) {
              controller.onLoad = (controller) {
                controller.context.dispatcher?.subscribe('example', (args) {});
                controller.context.evaluateJavaScripts('hello();');
              };
            });

flutter: Invalid argument(s): Failed to load dynamic library 'mercury_bridge.framework/mercury_bridge': dlopen(mercury_bridge.framework/mercury_bridge, 0x0001): tried: 'mercury_bridge.framework/mercury_bridge' (no such file), '/private/preboot/Cryptexes/OSmercury_bridge.framework/mercury_bridge' (no such file), '/usr/lib/swift/mercury_bridge.framework/mercury_bridge' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/mercury_bridge.framework/mercury_bridge' (no such file), '/private/var/containers/Bundle/Application/E7D741FB-98F0-4EBE-B316-40FCEE308A6C/Runner.app/Frameworks/mercury_bridge.framework/mercury_bridge' (no such file), '/private/var/containers/Bundle/Application/E7D741FB-98F0-4EBE-B316-40FCEE308A6C/Runner.app/Frameworks/mercury_bridge.framework/mercury_bridge' (no such file), '/usr/lib/mercury_bridge.framework/mercury_bridge' (no such file, not in dyld cache), 'mercury_bridge.framework/mercury_bridge' (no such file)

tried to do flutter clean faced with new error

Could not build the precompiled application for the device.
Semantic Issue (Xcode): Unknown receiver 'MercuryjsPlugin'; did you mean 'MercuryPlugin'?
/Users/reinaldoarifin/FlutterProjects/flutter_rad/ios/Runner/GeneratedPluginRegistrant.m:233:3
@MulverineX

This comment was marked as outdated.

@MulverineX MulverineX added bug Something isn't working platform(iOS) env(macOS) labels May 16, 2024
@MulverineX MulverineX changed the title Failed to load dynamic library 'mercury_bridge.framework/mercury_bridge' Missing iOS binary May 16, 2024
@MulverineX

This comment was marked as outdated.

@arifinreinaldo
Copy link
Author

arifinreinaldo commented May 16, 2024

I tried with android build

..\Cache\hosted\pub.dev\mercuryjs-0.1.3\android\src\main\java\com\openwebf\mercuryjs\MercuryjsPlugin.java:16: error: class MercuryPlugin is public, should be declared in a file named MercuryPlugin.java
public class MercuryPlugin implements FlutterPlugin, MethodCallHandler {
       ^
..\Local\Pub\Cache\hosted\pub.dev\mercuryjs-0.1.3\android\src\main\java\com\openwebf\mercuryjs\MercuryjsPlugin.java:24: error: cannot find symbol
  private Mercury mMercury;
          ^
  symbol:   class Mercury
  location: class MercuryPlugin
..\Local\Pub\Cache\hosted\pub.dev\mercuryjs-0.1.3\android\src\main\java\com\openwebf\mercuryjs\MercuryjsPlugin.java:51: error: cannot find symbol
  Mercury getMercury() {
  ^
  symbol:   class Mercury
  location: class MercuryPlugin
..\Local\Pub\Cache\hosted\pub.dev\mercuryjs-0.1.3\android\src\main\java\com\openwebf\mercuryjs\MercuryjsPlugin.java:53: error: cannot find symbol
      mMercury = Mercury.get(flutterEngine);
                 ^
  symbol:   variable Mercury
  location: class MercuryPlugin
..\Local\Pub\Cache\hosted\pub.dev\mercuryjs-0.1.3\android\src\main\java\com\openwebf\mercuryjs\MercuryjsPlugin.java:74: error: cannot find symbol
        Mercury mercury = getMercury();
        ^
  symbol:   class Mercury
  location: class MercuryPlugin
..\Local\Pub\Cache\hosted\pub.dev\mercuryjs-0.1.3\android\src\main\java\com\openwebf\mercuryjs\MercuryjsPlugin.java:89: error: cannot find symbol
    Mercury mercury = Mercury.get(flutterEngine);
    ^
  symbol:   class Mercury
  location: class MercuryPlugin
..\Local\Pub\Cache\hosted\pub.dev\mercuryjs-0.1.3\android\src\main\java\com\openwebf\mercuryjs\MercuryjsPlugin.java:89: error: cannot find symbol
    Mercury mercury = Mercury.get(flutterEngine);
                      ^
  symbol:   variable Mercury
  location: class MercuryPlugin
..\Local\Pub\Cache\hosted\pub.dev\mercuryjs-0.1.3\android\src\main\java\com\openwebf\mercuryjs\MercuryjsPlugin.java:91: error: cannot find symbol
    mercuryjs.destroy();
    ^
  symbol:   variable mercuryjs
  location: class MercuryPlugin
Note: ..\Local\Pub\Cache\hosted\pub.dev\mercuryjs-0.1.3\android\src\main\java\com\openwebf\mercuryjs\MercuryjsPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
8 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':mercuryjs:compileReleaseJavaWithJavac'.

turns out also unable to build the apk

@MulverineX
Copy link
Collaborator

Those appear to be Windows paths? What operating system are you using?

@arifinreinaldo

This comment was marked as outdated.

@MulverineX MulverineX self-assigned this May 16, 2024
@arifinreinaldo
Copy link
Author

Those appear to be Windows paths? What operating system are you using?

for android testing currently I'm using WIndows, previously for iOS I'm using Mac

@MulverineX
Copy link
Collaborator

MulverineX commented May 16, 2024

I will try to reproduce your issue on building for Android on Windows

@ekkis when he has time can hopefully help with MacOS (I do not have a MacOS environment)

@MulverineX

This comment was marked as off-topic.

@arifinreinaldo

This comment was marked as off-topic.

@MulverineX

This comment was marked as off-topic.

@MulverineX

This comment was marked as off-topic.

@arifinreinaldo

This comment was marked as off-topic.

@MulverineX

This comment was marked as off-topic.

@MulverineX
Copy link
Collaborator

@arifinreinaldo It turns out this is a problem when compiling for any platform! It's embarrassing that we missed this! So, it appears that actually using the library as a package installed from pub.dev doesn't work, but it does work within the example project when in the mercury workspace. As it currently stands this means the package can't be used in any project! We will be fixing this soon, apologies for the delay.

@MulverineX MulverineX changed the title Missing iOS binary Failing to function outside of the dev environment; when installed as a package May 24, 2024
@MulverineX MulverineX pinned this issue May 24, 2024
@arifinreinaldo
Copy link
Author

@arifinreinaldo It turns out this is a problem when compiling for any platform! It's embarrassing that we missed this! So, it appears that actually using the library as a package installed from pub.dev doesn't work, but it does work within the example project when in the mercury workspace. As it currently stands this means the package can't be used in any project! We will be fixing this soon, apologies for the delay.

ok, hopefully can be fixed soon. Thanks

@MulverineX MulverineX changed the title Failing to function outside of the dev environment; when installed as a package Binary linking is failing May 29, 2024
@oluul
Copy link

oluul commented May 30, 2024

How's this issue coming along?

@MulverineX
Copy link
Collaborator

Been doing some tinkering, I believe we have some broken Flutter Plugin files, starting tomorrow I'm going to comb through their differences to upstream and attempt to get this resolved within a few days.

I also discovered a nasty memory allocation bug in the bridge library that affects Windows, about halfway through that, still getting crashes, will continue to look through upstream fixes.

@MulverineX MulverineX linked a pull request Jun 2, 2024 that will close this issue
@MulverineX MulverineX added this to the v0.2.0 milestone Jun 2, 2024
@MulverineX
Copy link
Collaborator

A good chunk of the way through this now, those interested can track progress here: #35

@arifinreinaldo
Copy link
Author

A good chunk of the way through this now, those interested can track progress here: #35

Hi, thanks for keeping posted about the progress so far. CMIIW, so the fix will be handled in the version 0.2.0?

@MulverineX
Copy link
Collaborator

Yep

@MulverineX MulverineX added the help wanted Extra attention is needed label Sep 19, 2024
@arifinreinaldo
Copy link
Author

Hi @MulverineX , Any update for this one?

@MulverineX
Copy link
Collaborator

MulverineX commented Oct 9, 2024

I've decided to move to Kotlin Jetpack Compose Multiplatform, and ekkis went back to React Native, so at this point you can consider this library abandoned unfortunately, until/unless someone else picks up development. andycall (the lead developer of webf) has different priorities so its unlikely he'll work on this unless someone commissions him to. This is why this issue is set to help wanted. Apologies to everyone I directed to this project, I hope y'all find a different solution for your app or can find the time to finish this library. If anyone is actually interested in taking over let me know and I can help some.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants