fzyzcjy / flutter_rust_bridge

Flutter/Dart <-> Rust binding generator, feature-rich, but seamless and simple.
https://fzyzcjy.github.io/flutter_rust_bridge/
MIT License
3.61k stars 254 forks source link

compiling for iOS doesn't work #1888

Closed patmuk closed 1 month ago

patmuk commented 1 month ago

Describe the bug

Hi, I can't compile a freshly created app, neither in cli, nor in Xcode. It might be because of my setup - but the errors look frb related.

Steps to reproduce

  1. flutter_rust_bridge_codegen create neo

  2. cd neo

  3. flutter pub get

  4. flutter_rust_bridge_codegen generate

  5. flutter run ... leads to the first error: Failed to build iOS app Lexical or Preprocessor Issue (Xcode): 'UIKit/UIKit.h' file not found

  6. open iOS/Runner.xcworkspace

  7. run in xcode ... leads to the second error: '/Users/patmuk/Library/Developer/CoreSimulator/Devices/6066442D-018C-43C8-9352-126293114557/data/Containers/Bundle/Application/62BF8BF5-BC44-4C27-A506-7AA2CC104BD9/Runner.app/Frameworks/rust_lib_neo.framework/rust_lib_neo' (no such file), '/usr/lib/rust_lib_neo.framework/rust_lib_neo' (no such file, not in dyld cache), 'rust_lib_neo.framework/rust_lib_neo' (no such `file),

Logs

1. error (this might be related to my setup on my machine):

› flutter run   
Launching lib/main.dart on iPhone 15 Pro in debug mode...
Running Xcode build...                                                  
 └─Compiling, linking and signing...                        600ms
Xcode build done.                                            4.7s
Failed to build iOS app
Lexical or Preprocessor Issue (Xcode): 'UIKit/UIKit.h' file not found
/Users/patmuk/code/own/sherry/examples/clean_setup/neo/build/ios/Debug-iphonesimulator/Flutter.framework/Headers/FlutterAppDelegate.h:7:8

Parse Issue (Xcode): Could not build module 'Flutter'
/Users/patmuk/code/own/sherry/examples/clean_setup/neo/ios/Runner/GeneratedPluginRegistrant.h:9:8

Could not build the application for the simulator.
Error launching application on iPhone 15 Pro.

from flutter run -v

executing: /usr/bin/arch -arm64e xcrun xcresulttool get --path
/var/folders/bw/869b6hcd761btl8dc_3zkh4c0000gn/T/flutter_tools.spEfZp/flutter_ios_build_temp_dir9BJGVR/temporary_xcresult_bundle --format json
[  +25 ms] {
             "_type" : {
               "_name" : "ActionsInvocationRecord"
             },
             "actions" : {
               "_type" : {
                 "_name" : "Array"
               },
               "_values" : [
                 {
                   "_type" : {
                     "_name" : "ActionRecord"
                   },
                   "actionResult" : {
                     "_type" : {
                       "_name" : "ActionResult"
                     },
                     "coverage" : {
                       "_type" : {
                         "_name" : "CodeCoverageInfo"
                       }
                     },
                     "issues" : {
                       "_type" : {
                         "_name" : "ResultIssueSummaries"
                       }
                     },
                     "metrics" : {
                       "_type" : {
                         "_name" : "ResultMetrics"
                       }
                     },
                     "resultName" : {
                       "_type" : {
                         "_name" : "String"
                       },
                       "_value" : "action"
                     },
                     "status" : {
                       "_type" : {
                         "_name" : "String"
                       },
                       "_value" : "notRequested"
                     }
                   },
                   "buildResult" : {
                     "_type" : {
                       "_name" : "ActionResult"
                     },
                     "coverage" : {
                       "_type" : {
                         "_name" : "CodeCoverageInfo"
                       }
                     },
                     "issues" : {
                       "_type" : {
                         "_name" : "ResultIssueSummaries"
                       },
                       "errorSummaries" : {
                         "_type" : {
                           "_name" : "Array"
                         },
                         "_values" : [
                           {
                             "_type" : {
                               "_name" : "IssueSummary"
                             },
                             "documentLocationInCreatingWorkspace" : {
                               "_type" : {
                                 "_name" : "DocumentLocation"
                               },
                               "concreteTypeName" : {
                                 "_type" : {
                                   "_name" : "String"
                                 },
                                 "_value" : "DVTTextDocumentLocation"
                               },
                               "url" : {
                                 "_type" : {
                                   "_name" : "String"
                                 },
                                 "_value" :
                                 "file:\/\/\/Users\/patmuk\/code\/own\/sherry\/examples\/clean_setup\/neo\/build\/ios\/Debug-iphonesimulator\/Flutter.framework\/Headers\/FlutterAppDel
                                 egate.h#EndingColumnNumber=8&EndingLineNumber=7&StartingColumnNumber=8&StartingLineNumber=7"
                               }
                             },
                             "issueType" : {
                               "_type" : {
                                 "_name" : "String"
                               },
                               "_value" : "Lexical or Preprocessor Issue"
                             },
                             "message" : {
                               "_type" : {
                                 "_name" : "String"
                               },
                               "_value" : "'UIKit\/UIKit.h' file not found"
                             }
                           },
                           {
                             "_type" : {
                               "_name" : "IssueSummary"
                             },
                             "documentLocationInCreatingWorkspace" : {
                               "_type" : {
                                 "_name" : "DocumentLocation"
                               },
                               "concreteTypeName" : {
                                 "_type" : {
                                   "_name" : "String"
                                 },
                                 "_value" : "DVTTextDocumentLocation"
                               },
                               "url" : {
                                 "_type" : {
                                   "_name" : "String"
                                 },
                                 "_value" :
                                 "file:\/\/\/Users\/patmuk\/code\/own\/sherry\/examples\/clean_setup\/neo\/ios\/Runner\/GeneratedPluginRegistrant.h#EndingColumnNumber=8&EndingLineNumb
                                 er=9&StartingColumnNumber=8&StartingLineNumber=9"
                               }
                             },
                             "issueType" : {
                               "_type" : {
                                 "_name" : "String"
                               },
                               "_value" : "Parse Issue"
                             },
                             "message" : {
                               "_type" : {
                                 "_name" : "String"
                               },
                               "_value" : "Could not build module 'Flutter'"
                             }
                           }
                         ]
                       },
                       "warningSummaries" : {
                         "_type" : {
                           "_name" : "Array"
                         },
                         "_values" : [
                           {
                             "_type" : {
                               "_name" : "IssueSummary"
                             },
                             "issueType" : {
                               "_type" : {
                                 "_name" : "String"
                               },
                               "_value" : "Warning"
                             },
                             "message" : {
                               "_type" : {
                                 "_name" : "String"
                               },
                               "_value" : "overriding '-mmacos-version-min=11.0' option with '-target arm64-apple-ios12.0-simulator'"
                             }
                           }
                         ]
                       }
                     },
                     "logRef" : {
                       "_type" : {
                         "_name" : "Reference"
                       },
                       "id" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "0~mtIeKFGqWJjUe-Zxprf0LH-oqYaVnA4BWD24DeY6lLE1ZAcu4rnwWV_3Itn3y5wnZg4GcPzSRBHN4-lJYinsMw=="
                       },
                       "targetType" : {
                         "_type" : {
                           "_name" : "TypeDefinition"
                         },
                         "name" : {
                           "_type" : {
                             "_name" : "String"
                           },
                           "_value" : "ActivityLogSection"
                         }
                       }
                     },
                     "metrics" : {
                       "_type" : {
                         "_name" : "ResultMetrics"
                       },
                       "errorCount" : {
                         "_type" : {
                           "_name" : "Int"
                         },
                         "_value" : "2"
                       },
                       "warningCount" : {
                         "_type" : {
                           "_name" : "Int"
                         },
                         "_value" : "1"
                       }
                     },
                     "resultName" : {
                       "_type" : {
                         "_name" : "String"
                       },
                       "_value" : "build"
                     },
                     "status" : {
                       "_type" : {
                         "_name" : "String"
                       },
                       "_value" : "failed"
                     }
                   },
                   "endedTime" : {
                     "_type" : {
                       "_name" : "Date"
                     },
                     "_value" : "2024-04-17T09:06:59.316+0200"
                   },
                   "runDestination" : {
                     "_type" : {
                       "_name" : "ActionRunDestinationRecord"
                     },
                     "displayName" : {
                       "_type" : {
                         "_name" : "String"
                       },
                       "_value" : "iPhone 15 Pro"
                     },
                     "localComputerRecord" : {
                       "_type" : {
                         "_name" : "ActionDeviceRecord"
                       },
                       "busSpeedInMHz" : {
                         "_type" : {
                           "_name" : "Int"
                         },
                         "_value" : "0"
                       },
                       "cpuCount" : {
                         "_type" : {
                           "_name" : "Int"
                         },
                         "_value" : "1"
                       },
                       "cpuKind" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "Apple M3 Max"
                       },
                       "cpuSpeedInMHz" : {
                         "_type" : {
                           "_name" : "Int"
                         },
                         "_value" : "0"
                       },
                       "identifier" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "00006034-0012095C3688001C"
                       },
                       "isConcreteDevice" : {
                         "_type" : {
                           "_name" : "Bool"
                         },
                         "_value" : "true"
                       },
                       "logicalCPUCoresPerPackage" : {
                         "_type" : {
                           "_name" : "Int"
                         },
                         "_value" : "14"
                       },
                       "modelCode" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "Mac15,10"
                       },
                       "modelName" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "MacBook Pro"
                       },
                       "modelUTI" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "com.apple.macbookpro-14-late-2023-2"
                       },
                       "name" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "My Mac"
                       },
                       "nativeArchitecture" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "arm64e"
                       },
                       "operatingSystemVersion" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "14.3.1"
                       },
                       "operatingSystemVersionWithBuildNumber" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "14.3.1 (23D60)"
                       },
                       "physicalCPUCoresPerPackage" : {
                         "_type" : {
                           "_name" : "Int"
                         },
                         "_value" : "14"
                       },
                       "platformRecord" : {
                         "_type" : {
                           "_name" : "ActionPlatformRecord"
                         },
                         "identifier" : {
                           "_type" : {
                             "_name" : "String"
                           },
                           "_value" : "com.apple.platform.macosx"
                         },
                         "userDescription" : {
                           "_type" : {
                             "_name" : "String"
                           },
                           "_value" : "macOS"
                         }
                       },
                       "ramSizeInMegabytes" : {
                         "_type" : {
                           "_name" : "Int"
                         },
                         "_value" : "36864"
                       }
                     },
                     "targetArchitecture" : {
                       "_type" : {
                         "_name" : "String"
                       },
                       "_value" : "arm64"
                     },
                     "targetDeviceRecord" : {
                       "_type" : {
                         "_name" : "ActionDeviceRecord"
                       },
                       "busSpeedInMHz" : {
                         "_type" : {
                           "_name" : "Int"
                         },
                         "_value" : "0"
                       },
                       "cpuCount" : {
                         "_type" : {
                           "_name" : "Int"
                         },
                         "_value" : "0"
                       },
                       "cpuSpeedInMHz" : {
                         "_type" : {
                           "_name" : "Int"
                         },
                         "_value" : "0"
                       },
                       "identifier" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "6066442D-018C-43C8-9352-126293114557"
                       },
                       "isConcreteDevice" : {
                         "_type" : {
                           "_name" : "Bool"
                         },
                         "_value" : "true"
                       },
                       "logicalCPUCoresPerPackage" : {
                         "_type" : {
                           "_name" : "Int"
                         },
                         "_value" : "0"
                       },
                       "modelCode" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "iPhone16,1"
                       },
                       "modelName" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "iPhone 15 Pro"
                       },
                       "modelUTI" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "com.apple.iphone-15-pro-1"
                       },
                       "name" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "iPhone 15 Pro"
                       },
                       "nativeArchitecture" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "arm64"
                       },
                       "operatingSystemVersion" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "17.4"
                       },
                       "operatingSystemVersionWithBuildNumber" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "17.4 (21E213)"
                       },
                       "physicalCPUCoresPerPackage" : {
                         "_type" : {
                           "_name" : "Int"
                         },
                         "_value" : "0"
                       },
                       "platformRecord" : {
                         "_type" : {
                           "_name" : "ActionPlatformRecord"
                         },
                         "identifier" : {
                           "_type" : {
                             "_name" : "String"
                           },
                           "_value" : "com.apple.platform.iphonesimulator"
                         },
                         "userDescription" : {
                           "_type" : {
                             "_name" : "String"
                           },
                           "_value" : "iOS Simulator"
                         }
                       },
                       "ramSizeInMegabytes" : {
                         "_type" : {
                           "_name" : "Int"
                         },
                         "_value" : "0"
                       }
                     },
                     "targetSDKRecord" : {
                       "_type" : {
                         "_name" : "ActionSDKRecord"
                       },
                       "identifier" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "iphonesimulator17.4"
                       },
                       "name" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "Simulator - iOS 17.4"
                       },
                       "operatingSystemVersion" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "17.4"
                       }
                     }
                   },
                   "schemeCommandName" : {
                     "_type" : {
                       "_name" : "String"
                     },
                     "_value" : "Run"
                   },
                   "schemeTaskName" : {
                     "_type" : {
                       "_name" : "String"
                     },
                     "_value" : "Build"
                   },
                   "startedTime" : {
                     "_type" : {
                       "_name" : "Date"
                     },
                     "_value" : "2024-04-17T09:06:54.977+0200"
                   },
                   "title" : {
                     "_type" : {
                       "_name" : "String"
                     },
                     "_value" : "Build \"Runner\""
                   }
                 }
               ]
             },
             "issues" : {
               "_type" : {
                 "_name" : "ResultIssueSummaries"
               },
               "errorSummaries" : {
                 "_type" : {
                   "_name" : "Array"
                 },
                 "_values" : [
                   {
                     "_type" : {
                       "_name" : "IssueSummary"
                     },
                     "documentLocationInCreatingWorkspace" : {
                       "_type" : {
                         "_name" : "DocumentLocation"
                       },
                       "concreteTypeName" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "DVTTextDocumentLocation"
                       },
                       "url" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" :
                         "file:\/\/\/Users\/patmuk\/code\/own\/sherry\/examples\/clean_setup\/neo\/build\/ios\/Debug-iphonesimulator\/Flutter.framework\/Headers\/FlutterAppDelegate.h#
                         EndingColumnNumber=8&EndingLineNumber=7&StartingColumnNumber=8&StartingLineNumber=7"
                       }
                     },
                     "issueType" : {
                       "_type" : {
                         "_name" : "String"
                       },
                       "_value" : "Lexical or Preprocessor Issue"
                     },
                     "message" : {
                       "_type" : {
                         "_name" : "String"
                       },
                       "_value" : "'UIKit\/UIKit.h' file not found"
                     }
                   },
                   {
                     "_type" : {
                       "_name" : "IssueSummary"
                     },
                     "documentLocationInCreatingWorkspace" : {
                       "_type" : {
                         "_name" : "DocumentLocation"
                       },
                       "concreteTypeName" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" : "DVTTextDocumentLocation"
                       },
                       "url" : {
                         "_type" : {
                           "_name" : "String"
                         },
                         "_value" :
                         "file:\/\/\/Users\/patmuk\/code\/own\/sherry\/examples\/clean_setup\/neo\/ios\/Runner\/GeneratedPluginRegistrant.h#EndingColumnNumber=8&EndingLineNumber=9&Sta
                         rtingColumnNumber=8&StartingLineNumber=9"
                       }
                     },
                     "issueType" : {
                       "_type" : {
                         "_name" : "String"
                       },
                       "_value" : "Parse Issue"
                     },
                     "message" : {
                       "_type" : {
                         "_name" : "String"
                       },
                       "_value" : "Could not build module 'Flutter'"
                     }
                   }
                 ]
               },
               "warningSummaries" : {
                 "_type" : {
                   "_name" : "Array"
                 },
                 "_values" : [
                   {
                     "_type" : {
                       "_name" : "IssueSummary"
                     },
                     "issueType" : {
                       "_type" : {
                         "_name" : "String"
                       },
                       "_value" : "Warning"
                     },
                     "message" : {
                       "_type" : {
                         "_name" : "String"
                       },
                       "_value" : "overriding '-mmacos-version-min=11.0' option with '-target arm64-apple-ios12.0-simulator'"
                     }
                   }
                 ]
               }
             },
             "metadataRef" : {
               "_type" : {
                 "_name" : "Reference"
               },
               "id" : {
                 "_type" : {
                   "_name" : "String"
                 },
                 "_value" : "0~O5eR0R9T3pD4kZpVjo99czachNzrPNpRHY1I5NwVmVh5ly6UQBIi3Sn4RJmfD7io9tJoWarxXnC_chONRPfsgA=="
               },
               "targetType" : {
                 "_type" : {
                   "_name" : "TypeDefinition"
                 },
                 "name" : {
                   "_type" : {
                     "_name" : "String"
                   },
                   "_value" : "ActionsInvocationMetadata"
                 }
               }
             },
             "metrics" : {
               "_type" : {
                 "_name" : "ResultMetrics"
               },
               "errorCount" : {
                 "_type" : {
                   "_name" : "Int"
                 },
                 "_value" : "2"
               },
               "warningCount" : {
                 "_type" : {
                   "_name" : "Int"
                 },
                 "_value" : "1"
               }
             }
           }
[   +3 ms] Failed to build iOS app
[        ] Lexical or Preprocessor Issue (Xcode): 'UIKit/UIKit.h' file not found
           /Users/patmuk/code/own/sherry/examples/clean_setup/neo/build/ios/Debug-iphonesimulator/Flutter.framework/Headers/FlutterAppDelegate.h:7:8

[        ] Parse Issue (Xcode): Could not build module 'Flutter'
           /Users/patmuk/code/own/sherry/examples/clean_setup/neo/ios/Runner/GeneratedPluginRegistrant.h:9:8

[        ] Could not build the application for the simulator.
[        ] Error launching application on iPhone 15 Pro.
[   +1 ms] "flutter run" took 10,521ms.
[   +1 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:815:9)
           <asynchronous suspension>
           #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1389:27)
           <asynchronous suspension>
           #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
           <asynchronous suspension>
           #4      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
           <asynchronous suspension>
           #5      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:355:9)
           <asynchronous suspension>
           #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:295:5)
           <asynchronous suspension>
           #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:119:9)
           <asynchronous suspension>
           #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
           <asynchronous suspension>
           #10     main (package:flutter_tools/executable.dart:90:3)
           <asynchronous suspension>

The second error in Xcode - this looks like FRB related: This happens after the build, while starting the app in the simulator:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'rust_lib_neo.framework/rust_lib_neo': dlopen(rust_lib_neo.framework/rust_lib_neo, 0x0001): tried: '/Users/patmuk/Library/Developer/Xcode/DerivedData/Runner-ecekxoupksbccjbtmtxskagsrudn/Build/Products/Debug-iphonesimulator/rust_lib_neo.framework/rust_lib_neo' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21E213/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.4.simruntime/Contents/Resources/RuntimeRootrust_lib_neo.framework/rust_lib_neo' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21E213/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/rust_lib_neo.framework/rust_lib_neo' (no such file), '/usr/lib/swift/rust_lib_neo.framework/rust_lib_neo' (no such file, not in dyld cache), '/Users/patmuk/Library/Developer/CoreSimulator/Devices/6066442D-018C-43C8-9352-126293114557/data/Containers/Bundle/Application/62BF8BF5-BC44-4C27-A506-7AA2CC104BD9/Runner.app/Frameworks/rust_lib_neo.framework/rust_lib_neo' (no such file), '/usr/lib/rust_lib_neo.framework/rust_lib_neo' (no such file, not in dyld cache), 'rust_lib_neo.framework/rust_lib_neo' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21E213/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/rust_lib_neo.framework/rust_lib_neo' (no such file)
#0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:43)
#1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12)
#2      new ExternalLibrary.open (package:flutter_rust_bridge/src/platform_types/_io.dart:39:47)
#3      loadExternalLibraryRaw.<anonymous closure>.<anonymous closure> (package:flutter_rust_bridge/src/loader/_io.dart:72:29)
#4      _tryOpen (package:flutter_rust_bridge/src/loader/_io.dart:93:20)
#5      loadExternalLibraryRaw.<anonymous closure> (package:flutter_rust_bridge/src/loader/_io.dart:68:22)
#6      loadExternalLibraryRaw.tryAssumingNonPackaged (package:flutter_rust_bridge/src/loader/_io.dart:49:22)
#7      loadExternalLibraryRaw (package:flutter_rust_bridge/src/loader/_io.dart:66:12)
#8      loadExternalLibrary (package:flutter_rust_bridge/src/loader/_io.dart:14:10)
#9      BaseEntrypoint._loadDefaultExternalLibrary (package:flutter_rust_bridge/src/main_components/entrypoint.dart:129:13)
#10     BaseEntrypoint.initImpl (package:flutter_rust_bridge/src/main_components/entrypoint.dart:48:31)
#11     RustLib.init (package:neo/src/rust/frb_generated.dart:25:20)
#12     main (package:neo/main.dart:6:17)
#13     _runMain.<anonymous closure> (dart:ui/hooks.dart:301:23)
#14     _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:297:19)
#15     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

As far as I remember the file in question was called 'rust_builder', not 'rust_lib_neo'? The rename sounds good, but doesn't seem to work for me.


### Expected behavior

_No response_

### Generated binding code

_No response_

### OS

MacOS 14.3.1.

### Version of `flutter_rust_bridge_codegen`

2.0.0-dev.32

### Flutter info

```shell
flutter doctor -v                                                 
[✓] Flutter (Channel stable, 3.19.5, on macOS 14.3.1 23D60 darwin-arm64, locale en-US)
    • Flutter version 3.19.5 on channel stable at /opt/homebrew/Caskroom/flutter/3.19.2/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 300451adae (3 weeks ago), 2024-03-27 21:54:07 -0500
    • Engine revision e76c956498
    • Dart version 3.3.3
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /nix/store/vb5b7nzyxxviz368hbjaz4985crlv88d-android-sdk-env/share/android-sdk
    • Platform android-34, build-tools 30.0.3
    • ANDROID_HOME = /nix/store/vb5b7nzyxxviz368hbjaz4985crlv88d-android-sdk-env/share/android-sdk
    • ANDROID_SDK_ROOT = /nix/store/vb5b7nzyxxviz368hbjaz4985crlv88d-android-sdk-env/share/android-sdk
    • Java binary at: /nix/store/4p6pjavr2q7m94vbbxs6hjz22rwq8chs-zulu-ca-jdk-17.0.10/bin/java
    • Java version OpenJDK Runtime Environment Zulu17.48+15-CA (build 17.0.10+7-LTS)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.2

[✗] 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 (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] VS Code (version 1.79.2)
    • VS Code at /Users/patmuk/Library/Mobile Documents/com~apple~CloudDocs/Desktop/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • iPhone 15 Pro (mobile) • 6066442D-018C-43C8-9352-126293114557 • ios          • com.apple.CoreSimulator.SimRuntime.iOS-17-4 (simulator)
    • macOS (desktop)        • macos                                • darwin-arm64 • macOS 14.3.1 23D60 darwin-arm64

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

! Doctor found issues in 2 categories.

Version of clang++

16.0.6

Additional context

I assume that this is very much related to the setup on my machine ... I tried doing this with nix, but gave up and installed the toolchain normally (except clang (InstalledDir: /nix/store/ww7lviar1xyd5az6y763yp5wigvwn3m8-clang-16.0.6/bin) which should not matter).

I would appreciate any help pointing me in the right direction to solve the issue! flutter create and cargo create work both fine - thus it is something in FRB (but most probably in rust_builder).

patmuk commented 1 month ago

Oh, actually flutter create nf and flutter run lead to the same error in cli ('UIKit/UIKit.h' file not found), but the project runs fine in Xcode. So FRB related might only be my second issue. (Nevertheless, any help with the first would be great as well!)

fzyzcjy commented 1 month ago

Hmm, if flutter create yields error, then I guess it may be more Flutter-related, and maybe ask in flutter github / stackoverflow / etc. Btw, If XCode runs well, I guess environment variables (especially those related to header search paths) may worth a check.

patmuk commented 1 month ago

Yes, thanks - I think as well that it is more environment related.

But the second issue ‚rust-lib-neo‘ not found, sounds FRB related (?). However, I saw that I installed cocoapods via nix as well - will undo that and report if that helped.

fzyzcjy commented 1 month ago

But the second issue ‚rust-lib-neo‘ not found, sounds FRB related (?).

I also get quite confused... since it works pretty well on CI as well as real computers. Anyway, if your first problem is solved and 2nd one is still there, feel free to ping me!

patmuk commented 1 month ago

@fzyzcjy I can't believe, but installing cocoapods via sudo gem install cocoapods and removing it from nix fixed the problem! All is fine, in cli and Xcode now.

I assume that nix installed an old version of cocoapods, as it used the old ruby shipped with MacOS. I installed the latest ruby and latest cocoapods - and now both issues are solved :)

As always, thanks for your quick help @fzyzcjy and sorry for bothering!

fzyzcjy commented 1 month ago

Happy to see it is solved and you are welcome!

github-actions[bot] commented 2 weeks ago

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.