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

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

Related

Getting Error building flutter project in Xcode

enter image description here
ios/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_place_picker-1.0.1/lib/src/components/prediction_tile.dart:29:51: Error:
The getter 'title' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart'
('ios/flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'title'.
final textColor = Theme.of(context).textTheme.title.color;
^^^^^
Failed to package /Users/ABC/Documents/myApp-master.
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
Could not build the application for the
Tried solution
Maintaining same ios deployment version in podfile and target
Clean build, reinstalling pod
Using flutter version 2.5.3
Xcode version 13.2.1
So clean the folder...
Try invalidating cache/restart Android studio, make sure Xcode is closed
Build it again and try 1-2
1- Try targeting a diff simulator, does it work fine on Android?
2- By diff simulator, I also mean a diff IOS variant too.
Is this how you are cleaning the file?
$ cd ios/ $ pod clean $ pod install

XCode 13.2.1 Executable Not Found

I am trying to build my react-native ios application on an iPhone 12 (ios 14.3) simulator. After the build succeeds, I am getting an error dialog at the end reading:
"Executable Not Found
/userFolder/Library/Developer/Xcode/DerivedData/eMobility-fzupihuygopdozakomhycmxkpemd/Build/Products/Debug-iphonesimulator/eMobility.app is not a valid path to an executable file. Please rebuild the project to ensure that all required executables are created. Check your project settings to ensure that a valid executable will be built
"
Error details:
"
Executable Not Found
Domain: DVTMachOErrorDomain
Code: 5
Recovery Suggestion: /userFolder/Library/Developer/Xcode/DerivedData/eMobility-fzupihuygopdozakomhycmxkpemd/Build/Products/Debug-iphonesimulator/eMobility.app is not a valid path to an executable file. Please rebuild the project to ensure that all required executables are created. Check your project settings to ensure that a valid executable will be built.
User Info: {
DVTErrorCreationDateKey = "2022-01-12 14:26:52 +0000";
}
I am using the latest XCode version : 13.2.1.
I want to say that the build was working before without changing anything (same simulator). So I am guessing it comes from the latest XCode update
run npm install before run the project from XCode

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.

XCTest: running tests fails with Cycle inside X; building could produce unreliable results in project with CocoaPods and Carthage

After upgrading my project to Xcode 12, the test suite stopped working. The tests target doesn't compile, fails with:
Cycle inside <redacted>Tests; building could produce unreliable results. This usually can be resolved by moving the shell script phase '[CP] Embed Pods Frameworks' so that it runs before the build phase that depends on its outputs.
Cycle details:
→ Target '<redacted>Tests' has copy command from '/Applications/Xcode12.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/XCTAutomationSupport.framework' to '<redacted>/Library/Developer/Xcode/DerivedData/<redacted>-bxjgdjscysiavpfrzmquaqdkncsl/Build/Products/Debug-iphonesimulator/<redacted>.app/Frameworks/XCTAutomationSupport.framework'
○ Target '<redacted>Tests': CodeSign <redacted>/Library/Developer/Xcode/DerivedData/<redacted>-bxjgdjscysiavpfrzmquaqdkncsl/Build/Products/Debug-iphonesimulator/<redacted>.app/PlugIns/<redacted>Tests.xctest/Frameworks/CryptoSwift.framework
○ That command depends on command in Target '<redacted>Tests': script phase “[CP] Embed Pods Frameworks”
The script is the last build phase in the target so I'm a bit lost. Any clue? Thank you.
I found a solution for my issue. The error is mentioning CodeSign and it is related with Frameworks/CryptoSwift.framework (this framework is linked using Carthage), so I guessed that it has nothing to do with CocoaPods but with the way that Carthage frameworks are included in the test bundle.
Just remove the "Code Sign On Copy" from the Carthage build phase.

Resources