Flutter: network_info_plus broken on m1 max - ruby

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

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.

Related

Unity Xcode Build fail- Unityframework Error: Undefined symbol

My unity project with firebase integrated got errors while archiving the Xcode project. I have searched for some issues that may be the same as mine, but with no luck. I have tried to install cocoa pods and success to build the Xcode project with no errors. When I archived the Xcode project, it shows so many Undefined symbols like the picture below
Xcode Version: 14.1.
Firebase SDK Version: 10.0.1.
Unity Version: 2021.3.7f1.
It turns out that the MLKit hasn't supported Firebase 10 yet, so something went wrong. Not sure why my unity didn't show errors. I manually install pod by terminal and got errors. Then I found the same issue as mine here.
https://github.com/firebase/firebase-ios-sdk/issues/10359
The quick answer is to add a version specifier to the Podfile
pod 'FirebaseAuth', '>= 9.6.0'
enter image description here
I have changed the pod file, but no results.

Warning: CocoaPods is installed but broken

How can I resolve the message Warning: CocoaPods is installed but broken. Skipping Pod install. You appear to have cocoa pods installed but its not working.?
The issue:
It works fine if I create a new project and run it on IOS but from the previous projects it doesn't work on IOS.
If I open the runner file from Xcode it launches but doesn't launch from android studio.
Therefore, when do pod install in the file it gives me this 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/date-3.2.2/lib/date_core.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/date-3.2.2/lib/date_core.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) - /Library/Ruby/Gems/2.6.0/gems/date-3.2.2/lib/date_core.bundle (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require'
So can you explain how can I resolve this error?
From: https://github.com/flutter/flutter/issues/54962#issuecomment-635443559
Resolved: Turns out it wasn't an issue with cocoapods per se. I did
three things:
sudo gem update
I fired up Xcode which I had forgotten I had updated
and it required additional components to be installed.
I restarted visual studio code
After that everything worked just fine.

No solution on the internet worked for Module 'google_maps_flutter' not found

I am trying to archive my flutter app to publish it to App Store Connect. Then I got this problem and I tried every single solution on the internet but nothing seem to work so I need help.
Here is the problem:
This will install all dependencies for iOS.
cd ios
pod install
You must see an output similar to this:
Analyzing dependencies
Downloading dependencies
Installing FMDB (2.7.5)
Installing Flutter (1.0.0)
Installing GoogleMaps (4.2.0)
If Xcode is opened when running pod install, you'll be prompted to either Keep Xcode Version or to Read From Disk.
Choose: Read From Disk.
Have you fulfilled all the requirements related with the app-delegate.. in the IOS section?
Because the problem seems to be connecting google maps flutter package with the IOS.
I solved the issue by double clicking and running Runner.xcworkspace instead of Runner.xcodeproj

How to resolve missing required file for Flutter iOS Build

I have written my first non-trivial flutter app and have successfully built and run it on both the Android and iOS simulators and an Android device (MOTO G7). In attempting to build it for an Xs Max connected to my iMac I get the following error during the Xcode build:
/Users/dev/FirstApp/ios/Runner/GeneratedPluginRegistrant.m:6:9: 'path_provider/PathProviderPlugin.h' file not found
I have searched the disk and found the following:
/Users/dev/FirstApp/build/ios/Debug-iphonesimulator/path_provider/path_provider.framework/Headers/PathProviderPlugin.h
/Users/dev/FirstApp/build/path_provider/intermediates/javac/debug/compileDebugJavaWithJavac/classes/io/flutter/plugins/pathprovider/PathProviderPlugin.class
I have googled and checked SO for various hints/solutions. None of the, few, suggested fixes has worked for me. My Flutter Doctor -v command display all checkmarks and no issues.
Am I missing something? Is this a Flutter/Xcode bug? I am using Xcode 10.3 and Flutter 1.7.x. Any suggestions or outright fixes would be appreciated.
In your xcode Open the *.xcworkspace file instead of *.xcodeproj file then
Product>Clean
Product>Archive
and waiting

Ionic1 with CocoaPods does not let me build my app in Xcode9

I work on an older App of mine which is Ionic-v1. I install the OneSignal plugin which is working now only with CocoaPods. At first all went fine, Android works flawless but I am not able anymore to build my IOS app because of CocoaPods. I can do what I want I keep getting the following error:
ld: 72 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I lost the entire day trying to figure this out, I tried uncountable times any combination of “pod install, pod clean, pod disintegrate” etc. etc. but without any success.
I also found a post inside the ionic forum from #blakgeek and install his plugin “cordova-plugin-cocoapod-support” but keep getting the same errors. But with or without this plugin I keep getting the same error.
I would be happy if anybody can help me here because at this point I am pretty lost.
Thank you in advance
Xcode 9
Ionic 3.18 (But app is Ionic v1)cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.18.0
ionic (Ionic CLI) : 3.18.0
global packages:
cordova (Cordova CLI) : 7.1.0
Gulp CLI : CLI version 3.9.1 Local version 3.9.1
local packages:
Cordova Platforms : android 6.3.0 ios 4.5.3
Ionic Framework : ionic1 1.2.4
System:
Android SDK Tools : 26.1.1
ios-deploy : 1.9.2
ios-sim : 5.0.6
Node : v8.9.1
npm : 2.15.12
OS : macOS Sierra
Xcode : Xcode 9.0.1 Build version 9A1004
Environment Variables:
ANDROID_HOME : /Volumes/Mac External HD/Android/sdk
Misc:
backend : pro
I just ended up deleting once again my entire ios platform for the xxx time and somehow solved it with the following steps.
a. deleted my complete ios platform
b. deleted the onesignal cordova plugin
c. reinstalled the onesignal plugin
d. recreated my ios platform BUT forced version ios4.4.0 with the following command "ionic cordova platform add ios#4.4.0"
e. changed into my /platform/ios directory and made one "pod install"
f. opened xcode and build and run without any further issue.
Short explanation. I ended up with tone of duplicate symbol erros because I tried just to many things and manually added to many things. (cant recall what I did all) how ever I never paid attention in the number of duplicate symbols. I started out with just 2 which seems to be a known issue (thankx to this issue report https://github.com/ionic-team/ionic/issues/12849#issuecomment-328472880) but with my tests and trials I ended up with much more and got completely of track.
After clean install with ios#4.4.0 all worked fine for me.
thank all for your attention...

Resources