Skip to content

dlsym symbol not found on iOS builds when using certain packages #5677

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

Open
2 tasks done
dustinkerstein opened this issue Apr 10, 2025 · 8 comments
Open
2 tasks done
Assignees

Comments

@dustinkerstein
Copy link

dustinkerstein commented Apr 10, 2025

Can we access your project?

  • I give permission for members of the FlutterFlow team to access and test my project for the sole purpose of investigating this issue.

Current Behavior

FlutterFlow iOS builds don't compile correctly for the fast_rsa package (https://pub.dev/packages/fast_rsa / https://github.com/jerson/flutter-rsa). There appears to be some linking issue but I am not technically able to investigate at that level. When building the fast_rsa's example app directly in Flutter, things work as expected. But when creating a very simple FlutterFlow app that replicates the author's example, I receive the following error:

[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: Invalid argument(s): Failed to lookup symbol 'RSABridgeCall': dlsym(RTLD_DEFAULT, RSABridgeCall): symbol not found
#0      DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:33:70)
#1      new Binding._internal (package:fast_rsa/bridge/binding.dart)
#2      Binding._instance (package:fast_rsa/bridge/binding.dart:18:44)
#3      Binding._instance (package:fast_rsa/bridge/binding.dart)
#4      new Binding (package:fast_rsa/bridge/binding.dart:25:12)
#5      RSABridge.bindingEnabled (package:fast_rsa/fast_rsa_bridge.dart:10:38)
#6      RSABridge.bindingEnabled (package:fast_rsa/fast_rsa_bridge.dart)
#7      RSABridge.call (package:fast_rsa/fast_rsa_bridge.dart:13:9)
#8      RSA.generate (package:fast_rsa/fast_rsa.dart:400:22)
#9      generateRSAKey (package:test/custom_code/actions/generate_r_s_a_key.dart:21:28)
#10     _HomePageWidgetState.initState.<anonymous closure> (package:test/pages/home_page/home_page_widget.dart:35:21)
#11     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1397:15)
#12     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1331:11)
#13     SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:1040:9)
#14     PlatformDispatcher.scheduleWarmUpFrame.<anonymous closure> (dart:ui/platform_dispatcher.dart:845:16)
#15     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
#16     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
#17     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
#18     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

Here is the example function I am running on page load:

import 'package:fast_rsa/fast_rsa.dart';
import 'dart:io' show Platform;

Future<void> generateRSAKey() async {
  if ((FFAppState().encryptionPublicKey == null ||
          FFAppState().encryptionPublicKey == "") ||
      (FFAppState().encryptionPrivateKey == null ||
          FFAppState().encryptionPrivateKey == "")) {
    print("Generating public and private keys");
    var result = await RSA.generate(2048);
    FFAppState().encryptionPublicKey = result.publicKey;
    FFAppState().encryptionPrivateKey = result.privateKey;
  } else {
    print("Public and private keys already exist");
  }
}

I posted about this issue directly on the fast_rsa GitHub repo and the author suspects it has something to do with how FlutterFlow is setting up the podfile / Xcode. See here for more info - jerson/flutter-rsa#19 (comment) and the attached FF build log - BuildLog.txt

Also, I tried both the async and sync methods of fast_rsa and both result in the same symbol error. The latter does "not rely on Isolate and interact directly with the Bridge" - jerson/flutter-rsa#19 (comment)

Expected Behavior

No errors

Steps to Reproduce

  1. Create two app state persisted strings: encryptionPublicKey and encryptionPrivateKey
  2. Create a custom action with fast_rsa added in the PubSpec dependency and add the following code:
import 'package:fast_rsa/fast_rsa.dart';
import 'dart:io' show Platform;

Future<void> generateRSAKey() async {
  if ((FFAppState().encryptionPublicKey == null ||
          FFAppState().encryptionPublicKey == "") ||
      (FFAppState().encryptionPrivateKey == null ||
          FFAppState().encryptionPrivateKey == "")) {
    print("Generating public and private keys");
    var result = await RSA.generate(2048);
    FFAppState().encryptionPublicKey = result.publicKey;
    FFAppState().encryptionPrivateKey = result.privateKey;
  } else {
    print("Public and private keys already exist");
  }
}
  1. On the homepage page load, run the generateRSAKey custom action
  2. Build on iOS and note error during launch

Reproducible from Blank

  • The steps to reproduce above start from a blank project.

Bug Report Code (Required)

ITESz/Hqx89gof1A0M+ALe5QhQIgQ0QnU7gnlO1ucx4bCOvzPex/ZuP7PkNKTcuEfwk7HVSjhnID0a3tv4XiUsYBCzOBbot80JVAEDnKWlqWMb6MEs3hT3wlJ9lXChHA5KbYmSN5PutpSWQf2FOlNq3qNleeY8aSfxBlZ7vfcPo=

Visual documentation

See above

Environment

- FlutterFlow version: 5.4.2 
- Platform: MacOS 15.3.2 (24D81)
- Operating system and version affected: iPadOS 16.7.10

Additional Information

No response

@dustinkerstein dustinkerstein added the status: needs triage A potential issue that has not been confirmed as a bug. label Apr 10, 2025
@Juansarmi Juansarmi self-assigned this Apr 11, 2025
Copy link
Collaborator

Hello!

I’m sorry to hear you’re experiencing this error. This type of error occurs because the library isn’t exporting a symbol correctly (in this case, RSABridgeCall) that your app needs.

I wanted to check if this error persists with the latest FlutterFlow update.
If it’s still happening, I suggest verifying that you’re using the latest stable version of the package, as I noticed that the version for the dependency wasn’t set in the snapshot I reviewed from your project.

Captura de pantalla 2025-04-11 1445161.png

Also, make sure that the dependency is compatible with the minimum iOS version you’ve set. Additionally, I found that the issue might be related to the dependency itself.

Captura de pantalla 2025-04-11 ¿.png

I hope this helps! Let me know if you’re still encountering the problem.

Regards.

@Juansarmi Juansarmi removed the status: needs triage A potential issue that has not been confirmed as a bug. label Apr 11, 2025
@dustinkerstein
Copy link
Author

Hi @Juansarmi, I have just retested with specifying fast_rsa: 3.8.1 (and am running the latest FlutterFlow version 5.4.2) and I see the same result. I'll reach out to the repo author about the integration tests, but that could be a red hearing. Do you have any other ideas on how I can debug this? Thanks!

Copy link
Collaborator

Hi again!
Take a look at this—it might be helpful as well. Let me know if it worked for you. Best regards.

Captura de pantalla 2025-04-12 125842.png

https://docs.flutterflow.io/concepts/custom-code

@dustinkerstein
Copy link
Author

Is there anything in particular from that page you're referencing? My other project uses many custom pub spec dependencies and this is the only one I'm having issues with. I believe the issue is more related to how the package uses linked lower level libraries and how FlutterFlow creates the Xcode project.

Copy link
Collaborator

Hi again!
It seems that the issue you're experiencing is related to a custom widget. Just to kindly clarify — this GitHub Issue Tracker is intended for reporting bugs and issues related to FlutterFlow itself, rather than custom integrations.

If you’re looking for help building or debugging a custom widget, we recommend reaching out to our support team. You can do that either by email at support@flutterflow.io, or through the in-app chat available within FlutterFlow.

Best regards.

@dustinkerstein
Copy link
Author

I believe the issue is potentially with how FlutterFlow is setting up the Xcode project as when I create the project directly within Flutter using the repo's example code, everything works as expected. Only when using this package within FlutterFlow does it break. Is there any other debug I can help with?

Copy link
Collaborator

Hi again!
Have you been able to resolve this issue with support? Normally, we don’t provide assistance for custom integrations through this channel, but our team is aware of this case and we’ll make an effort to look into it as soon as we can.
Best regards

@dustinkerstein
Copy link
Author

@Juansarmi, it looks like the package developer was able to partially fix this (see jerson/flutter-rsa#19 (comment)) through a change to using xcconfig rather than pod_target_xcconfig in the podspec file: jerson/flutter-rsa@63087f8 even though using pod_target_xcconfig should be supported. But this change seems to cause a -Objc linking conflict with Firestore (see my comment linked in the fast_rsa repo).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants