dart-lang / http

A composable API for making HTTP requests in Dart.
https://pub.dev/packages/http
BSD 3-Clause "New" or "Revised" License
1.02k stars 354 forks source link

Latest objective_c changes incompatible with cupertino_http #1298

Closed kekland closed 1 week ago

kekland commented 2 months ago

Hi!

I'm using objective_c (and ffigen) at 87e8f92. It seems like at that version doing anything from objective_c (even just creating an NSString) when cupertino_http is also installed instantly crashes the app with a segmentation fault.

I'm not exactly sure what the issue is. Version 1.1.0 (which is in pub) works fine. From the changelog:

1.2.0-wip
- Drop API methods that are deprecated in the oldest versions of iOS and macOS that flutter supports.
- Added ObjCBlock, which is the new user-facing representation of ObjC blocks.
- Migrate to ARC (Automatic Reference Counting).
- Enable ObjC objects and blocks to be sent between isolates.

My guess is that it's due to ARC. Here's an example project where the issue can be reproduced: https://github.com/kekland/cupertino_http_objc_issue

cc @liamappelbe (not sure whether it's relevant to you, but tagging just in case)

brianquinlan commented 2 months ago

@liamappelbe Does the referenced version of package:objective_c require ARC?

liamappelbe commented 2 months ago

Yep, package:objective_c and ffigen now use ARC. I haven't released that version yet.

brianquinlan commented 2 months ago

@liamappelbe So are your clients required to switch to using ARC?

liamappelbe commented 2 months ago

Yeah. It's my understanding that this will become a requirement for all flutter plugin writers soon. It has something to do with flutter using the swift package manager.

brianquinlan commented 2 months ago

OK, I guess its time for me to try to get delegates to work in Dart again ;-)