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

iOS cupertino_http error: Unhandled Exception: Invalid argument(s): Couldn't resolve native function '_wrapListenerBlock_1a6kixf' #1417

Open
Shubham1993 opened this issue Dec 9, 2024 · 7 comments
Assignees
Labels
package:cupertino_http Issues related to package:cupertino_http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@Shubham1993
Copy link

I am trying to run the sample app given with cupertino_http package in iOS. But I am getting below error.

`NSBundle file:///System/Library/PrivateFrameworks/MetalTools.framework/ principal class is nil because all fallbacks have failed
flutter: The Dart VM service is listening on http://127.0.0.1:53003/tmg2xds8gus=/
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): Couldn't resolve native function '_wrapListenerBlock_1a6kixf' in 'package:cupertino_http/src/native_cupertino_bindings.dart' : No asset with id 'package:cupertino_http/src/native_cupertino_bindings.dart' found. No available native assets. Attempted to fallback to process lookup. dlsym(RTLD_DEFAULT, _wrapListenerBlock_1a6kixf): symbol not found.

#0 Native._ffi_resolver.#ffiClosure0 (dart:ffi-patch/ffi_patch.dart)
#1 Native._ffi_resolver_function (dart:ffi-patch/ffi_patch.dart:1523:20)
#2 wrapListenerBlock_1a6kixf (package:cupertino_http/src/native_cupertino_bindings.dart)
#3 ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.listener (package:cupertino_http/src/native_cupertino_bindings.dart:65985:21)
#4 NSURLSessionDataDelegate.URLSession_task_didCompleteWithError
. (package:cupertino_http/src/native_cupertino_bindings.dart:66922:14)
#5 ObjCProtocolListenableMethod.implementAsListener (package:objective_c/src/protocol_builder.dart:80:69)
#6 URLSession.delegate (package:cupertino_http/src/cupertino_api.dart:854:10)
#7 new URLSession.sessionWithConfiguration (package:cupertino_http/src/cupertino_api.dart:1070:13)
#8 new CupertinoClient.fromSessionConfiguration (package:cupertino_http/src/cupertino_client.dart:240:32)
#9 main (package:cupertino_http_example/main.dart:23:34)
#10 _runMain. (dart:ui/hooks.dart:301:23)
#11 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:297:19)
#12 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)`

@Shubham1993 Shubham1993 added package:cupertino_http Issues related to package:cupertino_http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Dec 9, 2024
@brianquinlan
Copy link
Collaborator

@Shubham1993 could you provide the output from flutter doctor -v?

And this is with cupertino_http 2.0.1?

@brianquinlan brianquinlan added the needs-info Additional information needed from the issue author label Dec 9, 2024
@Shubham1993
Copy link
Author

Shubham1993 commented Dec 9, 2024

@brianquinlan Yes, this issue is coming on cupertino_http 2.0.1. Below is output for flutter doctor -v.

[✓] Flutter (Channel stable, 3.24.5, on macOS 15.0.1 24A348 darwin-arm64, locale en-IN)
    • Flutter version 3.24.5 on channel stable at /Users/user/Flutter/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision dec2ee5c1f (4 weeks ago), 2024-11-13 11:13:06 -0800
    • Engine revision a18df97ca5
    • Dart version 3.5.4
    • DevTools version 2.37.3

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/to/macos-android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16B40
    • CocoaPods version 1.16.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/to/macos-android-setup for detailed instructions).

[✓] VS Code (version 1.95.3)
    • VS Code at /Users/user/Downloads/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (4 available)
    • iPhone 16 Pro (mobile)          • UUID • ios            • com.apple.CoreSimulator.SimRuntime.iOS-18-1
      (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 15.0.1 24A348 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin         • macOS 15.0.1 24A348 darwin-arm64
    • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 131.0.6778.109
    ! Error: Browsing on the local area network for iphone. Ensure the device is unlocked and attached with a cable or associated with
      the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for  iPhone. Ensure the device is unlocked and attached with a cable or associated with the
      same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

@brianquinlan
Copy link
Collaborator

@Shubham1993 And you are running this on a real iOS device (not the simulator) in debug mode (you could include the command used to run flutter)?

@brianquinlan
Copy link
Collaborator

@liamappelbe

@liamappelbe
Copy link

This error means some of cupertino_http's native code isn't being linked into the app. The way I'd debug this is to use nm to search through the .o files, dylibs, and app binaries produced throughout the build, looking for that symbol: nm <some binary> | grep 'wrapListenerBlock_1a6kixf'. You should be able to see where it is dropped from the build (or if it's never included at all).

@Shubham1993
Copy link
Author

@brianquinlan I have tried running the app on simulator and real device both. On real device first i tried without debug mode and then in debug mode, but in each case getting same error.

for real device in debug mode i used command - flutter run -d {UUID}

@Shubham1993
Copy link
Author

@liamappelbe I ran nm | grep 'wrapListenerBlock_1a6kixf' command for multiple output files and dylibs, but it returned empty response.

nm /Users/user/Desktop/cupertino_http-2.0.1/example/build/ios/iphoneos/Runner.app/__preview.dylib  | grep 'wrapListenerBlock_1a6kixf'
nm /Users/user/Desktop/cupertino_http-2.0.1/example/build/ios/iphoneos/Runner.app/Runner  | grep 'wrapListenerBlock_1a6kixf'
nm /Users/user/Desktop/cupertino_http-2.0.1/example/build/ios/iphoneos/Runner.app/Frameworks/App.framework/App  | grep 'wrapListenerBlock_1a6kixf'

@github-actions github-actions bot removed the needs-info Additional information needed from the issue author label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:cupertino_http Issues related to package:cupertino_http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants