'Flutter: network_info_plus broken on m1 max
Already posted a bug at the publicly held package on github, but here's what's going on.
- Create a brand new flutter application on an M1 Max Mac.
- Add the network_info_plus dependency in your pubspec.yaml.
- Open up the iOS simulator for iPhone 13 Pro.
- Run the application in Android studio.
- Observe the error:
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')) - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle (LoadError)
Pubspec.yaml relevant packages:
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.4
shared_preferences: ^2.0.13
sembast: ^3.2.0
path_provider: ^2.0.9
network_info_plus: ^2.1.3
Package reference link: https://pub.dev/packages/network_info_plus
Solution 1:[1]
This turned out to be an environment issue. I was messing around with ruby on my mac and I think that might have killed my builds to iOS. What ended up fixing it was running gem install cocoapods and my builds magically started working.
I also deleted my pubspec.lock as well and redownloaded my assets. I ran flutter clean. Between the above and wiping my pubspec.lock and redownloading my packages, one of those seemed to fix it.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | cr1pto |
