flutter run on ios emulator - xcode

Error output from Xcode build:
↳
2022-06-08 15:01:02.170 xcodebuild[77786:964621] 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
2022-06-08 15:01:02.171 xcodebuild[77786:964621] 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
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/gd/tsbhn_r55f1bzmqmjwj99zzw0000gn/T/flutter_tools.mQ0a7x/flutter_ios_build_temp_dir7medmZ/temporary_xcresult_bundle
Failed to package /Users/thura/Project_studio/bliss.
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
/Users/thura/Project_studio/bliss/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but
the range of supported deployment target versions is 9.0 to 15.5.99. (in target 'leveldb-library' from project 'Pods')
Result bundle written to path:
/var/folders/gd/tsbhn_r55f1bzmqmjwj99zzw0000gn/T/flutter_tools.mQ0a7x/flutter_ios_build_temp_dir7medmZ/temporary_xcresult_bundle

"Command PhaseScriptExecution failed with a nonzero exit code" may come from many different sources.
Common ways to fix it:
Delete Derived Datas
Restart your Mac
flutter clean + flutter pub get
in ios folder: pod deintegrate + pod install

Related

Not able to run flutter application in simulator (iOS 15)

I have update flutter version from 1.x to 2.8.x and now I am trying to run application in Xcode 13.1 and Simulator iOS 15. I am facing this error. 'mobileffmpeg/LogDelegate.h' file not found and Command CompileSwiftSources failed with a nonzero exit code I tried some available solutions but it won't work for me.
I am using latest cocoa pod version 1.11.3
Error-Log (After performing flutter clean and flutter pub get and pod install in iOS)
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/username/Library/Developer/Xcode/DerivedData/Runner-ewlkrnytkuoiywhfslyuauileapw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/mobile-ffmpeg-https.build/Script-4C68ADEB2D24F6C2D2249598537085F9.sh:
line 2: /Users/username/Documents/spieler_coach part 2/ios/Pods/Target Support Files/mobile-ffmpeg-https/mobile-ffmpeg-https-xcframeworks.sh: Permission denied
Command PhaseScriptExecution failed with a nonzero exit code
error: the following command failed with exit code 0 but produced no further output
CompileC /Users/username/Library/Developer/Xcode/DerivedData/Runner-ewlkrnytkuoiywhfslyuauileapw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/webview_flutter_wkwebview.build/Objects-normal/arm64/FlutterWebView.o /Users/username/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FlutterWebView.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'webview_flutter_wkwebview' from project 'Pods')
note: Building targets in dependency order
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
warning: Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
Could not build the application for the simulator.
When you upgrade your flutter version some libs can not work anymore. Have you know meaning of ^ yet? For example: you're using lib abc in version 5.10 like this
abc: ^5.1.0 and abc has other version 5.2.0, ...5.9.0 and 6.0.0. If you use ^ that means version range is from 5.1.0 to 5.9.0. Maybe it has issue in ver 5.9.0. Moreover, sometimes the cause is not your library but its dependency. The abc lib uses xyz inside then it uses higher version that conflict with your flutter version.
So solution here is:
Try fix hard version of all libraries, remove using ^: abc: 5.1.0
If problem comes from dependency of your lib such as xyz. Check your xyz ver from pubspec.lock then add more package xyz into pubspec.yaml with compatible version.
Update:
You seems get issue with package https://pub.dev/packages/flutter_ffmpeg, please check Readme at section label:
2.1.2 iOS (Flutter >= 2.x) then replace two lines below:
def flutter_install_ios_plugin_pods(ios_application_path = nil)
↓
def flutter_install_plugin_pods(application_path = nil, relative_symlink_dir, platform)
plugin_pods = flutter_parse_plugins_file(plugins_file)
↓
plugin_pods = flutter_parse_plugins_file(plugins_file, platform)
Moreover, because the package was discontinued. You should change to https://pub.dev/packages/ffmpeg_kit_flutter

Xcode watchOS project not building from commandline

I have an 'Independent watchOS' project created in Xcode. To this project, I have linked few static libraries (as xcframework). The architecture is set to 'x86_64'. I am able to successfully build this project and deploy it on the watch simulator. The code inside the static libraries also get called and things work fine. However, when I try to build the same project from command-line, it doesnt work and fails with multiple errors.
Command used :
xcodebuild -target "TWWatchOSTemplateProj WatchKit App" -configuration Debug -destination 'platform=watchOS Simulator,arch=x86_64' build
Error :
/(Path to Libs)/TWLibs/TWBrahmaClient.xcframework:1:1: error: While
building for watchOS, no library for this platform was found in
'/(Path to Libs)/TWLibs/TWBrahmaClient.xcframework'. (in target
'TWWatchOSTemplateProj WatchKit Extension' from project
'TWWatchOSTemplateProj') warning: None of the architectures in ARCHS
(x86_64) are valid. Consider setting ARCHS to $(ARCHS_STANDARD) or
updating it to include at least one value from VALID_ARCHS (arm64_32,
armv7k). (in target 'TWWatchOSTemplateProj WatchKit Extension' from
project 'TWWatchOSTemplateProj') error: No profiles for
'com.xyz.TWWatchOSTemplateProj.watchkitapp' were found: Xcode couldn't
find any iOS App Development provisioning profiles matching
'com.xyz.TWWatchOSTemplateProj.watchkitapp'. Automatic signing is
disabled and unable to generate a profile. To enable automatic
signing, pass -allowProvisioningUpdates to xcodebuild. (in target
'TWWatchOSTemplateProj WatchKit App' from project
'TWWatchOSTemplateProj') warning: ONLY_ACTIVE_ARCH=YES requested with
multiple ARCHS and no active architecture could be computed; building
for all applicable architectures (in target 'TWWatchOSTemplateProj
WatchKit App' from project 'TWWatchOSTemplateProj')
** BUILD FAILED **
When built from command-line, why is the error related to architecture comes while the same works from xcode ? Also, is there anything to be added to the command for signing as the details are already present in the xcodeproj.

React native xcodebuild archive failed with exit status 65 on Fastlane - RealmJS Pods

I am trying to automate my react native app publish to app store by using fastlane. Archiving the app manually using xcode is successful. However when i use Fastlane, the build app step fails with exit status 65.
error: Unable to load contents of file list: '/Target Support Files/RealmJS/RealmJS-xcframeworks-input-files.xcfilelist' (in target 'RealmJS' from project 'Pods')
error: Unable to load contents of file list: '/Target Support Files/RealmJS/RealmJS-xcframeworks-output-files.xcfilelist' (in target 'RealmJS' from project 'Pods')
I have tried deleting my Pods folder, Podfile.lock and doing a fresh pod install. However, the issue with realmJS still occurs.
XCode version: Version 13.0 (13A233)
React-native: 0.65.1
Realm-js: 10.8.0
Fastlane: 2.197.0
Anyone encountered similar issue?
Finally got it to work. Turns out I had specified the wrong configuration for the build_app step in the Fastfile. I had renamed my configuration from "Release" to "Release Staging" after creating different schemes.
So from:
build_app(
configuration: "Release",
export_method: "app-store",
...
)
To:
build_app(
configuration: "Release Staging",
export_method: "app-store",
...
)

Macosx Deployment target firestore/firebase_core

Hello I get this error when I Run Flutter Code that contains firestore/firebase_core
i tried more than one deployment target but still, i get an error
Launching lib/main.dart on macOS in debug mode...
Building macOS application...
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
- package:firebase_core
- package:firebase_core_platform_interface
- package:quiver
- package:plugin_platform_interface
- package:cloud_firestore
- package:cloud_firestore_platform_interface
For solutions, see https://dart.dev/go/unsound-null-safety
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.7, but the range of supported deployment target versions is 10.9 to 11.0.99. (in target 'BoringSSL-GRPC' from project 'Pods')
warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.6, but the range of supported deployment target versions is 10.9 to 11.0.99. (in target 'nanopb' from project 'Pods')
warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.7, but the range of supported deployment target versions is 10.9 to 11.0.99. (in target 'leveldb-library' from project 'Pods')
** BUILD FAILED **
Exception: Build process failed
This error happens because you’re trying to run your application with libraries that don’t support null safety. You can fix that by running your application with this command:
flutter run --no-sound-null-safety
In case that you’re using an IDE, you need to change the running configurations, for example in VSCode will be:
Code => Preferences => Settings => Search setting, type in "flutter test" => Dart: Flutter Test Additional Args, Add item => Add "--no-sound-null-safety
I suggest that you check this link in order to understand how to understand this error better.

pod command is not recognized when running flutter project

I have tried every suggestion and solution in stack overflow and GitHub and yet I am not able to run pod install and I get pod : command not found , also my pod file is empty.
Warning: CocoaPods not installed. Skipping pod install.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds
to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
sudo gem install cocoapods
Running Xcode build...
Xcode build done. 6.4s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1:
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1:
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1:
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1:
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1:
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1:
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
warning: Capabilities for Runner may not function correctly because its entitlements
use a placeholder team ID. To resolve this, select a development team in the build settings
editor. (in target 'Runner')
note: Using new build systemnote: Planning buildnote: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone Xʀ.
The error was caused by CocoaPods not being installed, therefore pod install can't be run. Simply install CocoaPods to solve this issue. Run either sudo gem install cocoapods or install it without sudo following this guide.

Resources