Building flutter app on iOS simulator failed - xcode

I've been developing a flutter app for android for quite some time now, decided to try building it for iOS on a Macbook Pro with M1 Pro chip. Everytime I run it, it works on running pod install and running Xcode build, but always fails at building iOS app. I tried creating a completely new project and run it on my iOS simulator and it worked. Been trying out solutions I could find but none of them worked. Here's the error I get:
xcodebuild[24755:304662] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
xcodebuild[24755:304662] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
and at the end it shows this:
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
Any help will be greatly appreciated. Thanks!

Just replace this lines at the end of your Podfile
post_install do |installer_representation|
installer_representation.project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ARCHS'] = 'armv7 armv7s'
end
end
end
Flutter > ios > Podfile

Turns out all I needed to do was upgrade all my packages to the latest version, so I did. After resolving some errors caused by upgrading, I was finally able to install my iOS application.

Related

Flutter IOS build problem can't do flutter build ipa

hope u can help me, I've been stuck for days now with this problem. With the Android build I had no problems, but when I try to do flutter build ipa I get the following error:
Running Xcode build...
Xcode archive done. 74,4s
Failed to build iOS app
Error (Xcode): ../../.pub-cache/hosted/pub.dev/titled_navigation_bar-4.1.0/lib/src/navigation_bar.dart:83:11: Error: No named parameter with the name 'overflow'.
Encountered error while archiving for device.
I've tried several things like:
-flutter clean
-flutter pub cache repair
I've also tried to remove the package and install de pubs again, I've tried downgrading flutter... pretty much everything I've found here but no luck.
Thanks in advance.

Swift Package Manager and Cocoapods together: Compiler errors in Swift Package after Cocoapod Pod addition

I am developing an iOS app using the ParseSwift SDK. When I set up my project I added ParseSwift via the Swift Package Manager, which worked like a charm. Server connection and saving and querying for data on the server all works and my app compiles in its current state.
To add online meeting capabilities I have been trying to add the JitsiMeet iOS SDK.
After trying to add it via Swift Package Manager, I read on the Jitsi forum that the preferred way of adding it to an existing project is via Cocoapods, and there are currently no plans of supporting the Swift Package Manager. After finding several questions about interoperability of SPM and Cocoapods here I was hoping it would be smooth sailing.
After some back and forth to make Cocoapods work with my M1, I then tried several different Podfile variants to successfully add the JitsiMeetSDK Pod to my project. These variants include:
adding or leaving out the platform part so it is assigned by Cocoapods
adding or leaving out use_frameworks!
installing with or without the post_install block (which is taken from the Jitsi documentation)
This is my Podfile:
platform :ios, '15.0'
target 'MyApp' do
use_frameworks!
pod 'JitsiMeetSDK'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
The short version is: this does not work. My app doesn't compile anymore.
Here is the strange part: while Cocoapods successfully adds the JitsiMeetSDK Pod, when I open the .xcworkspace file and try to compile it I now get tons of compiler warnings for the ParseSwift package that I added via the Swift Package Manager. These errors all concern Concurrency or features only available in iOS 15 - which should not be a problem, since I set the platform to ios, '15.0' in my Podfile.
The ParseSwift files are also annotated and do have checks for Concurrency, which is why I understand this error even less. (screenshots of compiler errors and annotations below)
Is there an order that I have to follow when it comes to adding packages (first Cocoapods, then SPM)? Or any App settings I need to change now that two package managers are in the mix? Any help is appreciated!
I am using
Xcode 13.1
Swift version 5.5.1 (arm64)
Cocoapods 1.11.2 (installed via Home-brew for M1 support)
ParseSwift SDK 2.5.0 (via SPM)
JitsiMeet SDK 4.0.0 (via Cocoapods)
Here is a screenshot of the error messages (one example of almost 300 such cases):
So, I used your Podfile with a new project and ended up with the exact same result.
Then I tried first run Cocoapods for JitsiMeetSDK, then adding the ParseSwift with SPM. Same result.
The only way I was able to make it work was by having Cocoapods install both ParseSwift and JitsiMeetSDK.
platform :ios, '15.0'
target 'TestPackageManagers (iOS)' do
use_frameworks!
pod 'JitsiMeetSDK'
pod 'ParseSwift'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
pod install ran like a charm and I was able to compile and run everything.
You mentioned you are using ParseSwift SDK 2.5.0 in Xcode 13.1. This isn't possible.
Xcode made changes related to backwards compatibility in Xcode 13.2+.
You can resolve everything easily by upgrading to Xcode 13.2+. If you look at the release notes for ParseSwift it says specifically:
Requires Xcode 13.2 or above to use async/await. Not compatible with Xcode 13.0/1, will need to upgrade to 13.2+. Still works with Xcode 11/12
Basically, ParseSwift 2.4.0+ requires Xcode 13.2+. If you want to use Xcode 13.1 or lower, you need to use ParseSwift 2.3.1 or lower. More info can be found in the PR that made the change.
You will face this same issue with any dependency that adds the async/await backwards compatibility for iOS13, so it's recommended to upgrade to Xcode 13.2+ sooner than later.
In addition, the problem isn't related to a mix of SPM and Cocoapods, these dependency managers have nothing to do with each other and you shouldn't have any issues using ParseSwift through SPM along with others in Cocoapods.
The described Concurrency errors were due to updating the ParseSwift package dependencies without updating Xcode to 13.2+ as #CoreyB pointed out.
Xcode 13.2 introduced other, unrelated bugs to my project but solved the Concurrency issue. The bugs were an Xcode 13.2 issue, and updating to Xcode 13.2.1 fixed these bugs.
After the update, I was able to add JitsiMeetSDK via Cocoapods to my existing project.
Thanks to #CoreyB and #Alex Kusmenkovsky for their helpful input!

Android Studio, Xcode, Cocopods

Im new to app development so forgive me if this is a trivial question.
I am trying to build a Flutter application in Android Studios using Xcode simulator as my IOS emulator. When I run main.dart on my application i get the following error in Android Studios console. error message in console
I have tried a variety of fixes but am unsure of any answers.
Delete Podfile and run pod init then pod install
If anyone could shed some light on what is actually wrong with my issue that would be terrific.
Add/ change this at the bottom of your Podfile (located at ios/Podfile)
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
end
end
end
Actually the problem is with deployment target. You can change this as following:
Change it to 8.0. If 8.0 is not available then try with other iPhone simulator with a higher iOS version.
And please read your error fully, it mentions about the deployment target.

Getting error while running flutter project in simulator in debug mode

Error comes after running flutter run
The Xcode project does not define target "Runner" which is needed by
Flutter
tooling.
Open Xcode to fix the problem:
open ios/Runner.xcworkspace
Encountered error while building for device.
Just make sure that your app target called "Runner". It seems that flutter tooling relies on this target name.
Example

Phonegap/Cordova Build error - Apple Mach-O Linker Error: no such file or directory: libCordova.a

I am getting an error after creating a new Cordova 2.1.0 project and updating the www folder with some code from a previous PhoneGap application.
clang: error: no such file or directory: '/Users/peterbanjo/Library/Developer/Xcode/DerivedData/OpuzMobile-bhwawiqfaptmxvfosawfabudgbkj/Build/Products/Debug-iphoneos/libCordova.a'
The error only occurs when I try and run the application on a device - in the simulator it works fine.
I am running Xcode 4.5 and iOS6 on the target iPad. I have tried a clean build and libCordova.a appears in the Build Phases > Link Library With Libraries tab but it is in red.
What I found confusing with PhoneGap/Cordova 2.1.0 by upgrading from 1.4 is that there are TWO projects in my application. There is MyApplication.xcodeproj and CordovaLib.xcodeproj. The changes to resolve this issue need to be applied to the CordovaLib project.
Change "Build Active Architecture Only" to "YES"
Update the text file project.pbxproj to these values
Toggle between the build schema for the simulator and the device (Use the select menu next to the stop button. Somehow this seems to cause the changes to be detected).
Did this work for you? Did I miss something?
PS: For a better understanding of the problem take a look at this Google Forum thread
I'm using Cordova/Phonegap 2.9 and this solved my issue. Didn't touch any of the arch stuff. Everything is set to armv7 armv7s on mine.
Follow these steps to fix this problem:
Go to project settings and Build Tab.
Search for "Other Linker Flags"
Double click on the linker flags for Release and Change ${TARGET_BUILD_DIR}/libCordova.a to ${BUILT_PRODUCTS_DIR}/libCordova.a
Do the same for Debug Clean and build archive again
I had the same error and fixed it by reverting to an older version of cordova ios.
Steps to fix the issue:
Uninstall cordova-ios first, with npm uninstall cordova-ios
Install old version of cordova-ios with npm install cordova-ios#4.4.0
Remove existing ios platform with ionic cordova platform rm ios or ionic platform rm ios
After that we should add platform with ionic cordova platform add ios#4.4.0 or ionic platform add ios#4.4.0
Run ionic cordova build ios.
Instructions came from here.
Only need to remove armv6 from both YourProject and CordovaLib:
The consequences of doing this? Apparently, it's still working on iPhone 3GS, but not the previous versions..
To make it work I downloaded from http://connect.apple.com stand alone Xcode 4.4.1. With this version I can build my phonegap Application with armv6 :)
Yes, in this case you need to have two Xcode on your computer.
Look at this https://groups.google.com/forum/?fromgroups=#!topic/phonegap/ywoc9wNydZ8
works for me
--
OS X 10.8.2
XCode 4.5
iOS 6.0
PhoneGap 2.1.0
DO NOT assume that having Standard (armv7,armv7s) - $(ARCHS_STANDARD_32_BIT)
is the same as the fix above.
Manually change this value to only armv7 and that fixed it for me.
I was very frustrated.
If you did everything here and it is still not working and you have separate configuration aside from Release and Debug - for this example is Production. Make sure that 'Production' Build Configuration exists in Cordova project. Build the Cordova Project and Build + Archive your main project again.

Resources