Flutter iOS build failure in Xcode - ios

I am using a mac to build the Flutter app using the real device iPhone X (14.7), In android studio application build in iOS but the same application field is in Xcode. I get this build error and can't figure out why it won't go away. I am missing a script of some sort. Does anybody else know why?
> /bin/sh: /packages/flutter_tools/bin/xcode_backend.sh: No such file or
> directory Command PhaseScriptExecution failed with a nonzero exit code
More Details
Mac configuration deatils
Xcode error run into real device
Project's 'Build Phases' screenshot

after a lot of builds around, I set these two settings and the build run on to my physical device.
Open xcode project
Left side runner
Top info tab
Configurations
Change configurations for debug
The image is below for further reference
image

Related

Unable to build app for iOS, "unable to write module session file Session.modulevalidation No such file or directory"

yesterday I was working fine with Flutter, now i'm facing this issue and I already search everywhere for a solution but no success.
When I run:
flutter run
The build process starts and when its about to finish the error below is shown:
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Xcode build done. 12.3s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: unable to write module session file at '/Users/hencke/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation': fopen(/Users/hencke/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation, wb): No such file or directory (2)
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.
Exited (sigterm)
Looks like the process is trying to open this file Session.modulevalidation for writing, but this file really does not exist in that folder. And I don't know what to do.
Things that I already tried:
Reinstalling xcode
flutter clean
Clone my project again in another folder and try to build, but same error
Created a new flutter dummy project and tried to build, still same error
Rebooting machine several times
Give permissions to Staff to the DerivedData and ModuleCache.noindex folders
Deleted the DerivedData within hope that xcode build will recreate all the files needed, but, it created everything again but not that particular file.
So that's it, If any blessed human know how to 'recreate', or reset, clear some cache, I would be very thankful.
Before running your project, check everything is checked when running:
flutter doctor
and also make sure at least a device is connected or open iOS simulator first. You can check if flutter is successfully connected to the device by:
flutter devices
when you make sure that flutter detect your device or the simulator, then run your application by:
flutter run
After hours I finally found the solution as it follows:
Without any hope I opened my flutter project with Xcode, and then tried to build the Runner target from there, same error.
Then, I was browsing the Xcode preferences and something caught my attention, on Locations section I found something about DerivedData location, it was set as Default. So, I changed from Default to Custom location and I set to a new folder on my home directory:
Then immediately Xcode created the entire DerivedData/ModuleCache.noindex folder and with them, the Session.modulevalidation file as well.
Then I closed Xcode and tried flutter run again, and it was successfully build!
I'll let this answer to those who may come here for help.

Deploying to iOS device from Unreal fails

I'm attempting to build and deploy an Unreal project to an iPhone, but it's failing to deploy on two errors. Xcode v11.3.1, Unreal v4.22.
LogShaderCompilers: Error: /tmp/3689_966125236.metal(0): Xcode's metal shader compiler was not found, verify Xcode has been installed on this Mac and that it has been selected in Xcode > Preferences > Locations > Command-line Tools.
LogOutputDevice: Warning: Script Stack (0 frames):
LogMac: Error: appError called: Assertion failed: [File:/Users/build/Build/++UE4/Sync/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp] [Line: 4523]
Failed to compile global shader TSlateElementPSFonttruetrueA . Enable 'r.ShaderDevelopmentMode' in ConsoleVariables.ini for retries.
and
[DD] ... Error: Failed to connect to bundle 'com.dock10.FACE'
So far I've:
Verified the metal compiler location using xcrun -sdk macosx -find metal
Verified Xcode has been installed and that it has been selected in Xcode > Preferences > Locations > Command-line Tools.
Successfully packaged and deployed a simple swift project to the iPhone through xcode
Tried pretty much every suggestion I can find on Google
Delete Binaries, Build, Intermediate, Saved folders in project folder, then Generate Xcode project
Entered r.ShaderDevelopmentMode into UE4 commandline
I don't have an apple dev license, do I need one to build and deploy my unreal project to one local iPhone?
Thanks!
So installing XCode 10.1, as mentioned in the iOS Development Requirements for 4.22 seems to have fixed the shader error, great!

ios simulator build works but real device build fails in flutter

Currently facing some issue with the flutter ios building. then the app is run with flutter run for ios simulator it works but same fails if a real device is connected.
below is the error code.
Non-fat binary /Users/x/demo/build/ios/Debug-iphoneos/Runner.app/Frameworks/App.framework/App is not arm64. Running lipo -info:
Non-fat file: /Users/x/demo/build/ios/Debug-iphoneos/Runner.app/Frameworks/App.framework/App is architecture: x86_64
Command /bin/sh failed with exit code 1
architecture is been added but still this issue.
Also, I did try installing pod or updating it but still no benefits of the same.
Edit: Flutter Doctor image attached.
The error must be because of signing capabilities. Try to run the project from xcode.
Follow the steps:
Step 1: Open the ios folder of your project to find Runner.xcworkspace. It should look like this:
Step 2: When the xcode opens, click on Runner on the top left corner of the window.
Step 3: Go to Signing and Capabilities and under the "Team" dropdown, select a field. If none exists, create an account.
Step 4: In the "Bundle Identifier", your app's bundle name should be showing. Add .app in the end. For example, if its "com.example.yourapp" make it "com.example.yourapp.app" and press enter.
Press the play button on the top left to run the app on the selected device.
If it doesn't work,
Change the flutter target runner in xcode - build active architecture only: yes

Flutter failed to build sample iOS app on VS Code

I'm trying to build the Flutter sample project on VS code, but got this messages... The sample is building and running fine on Android device, and I also tried running the sample with Android Studio on iOS simulator which is also fine. It just doesn't work on VS Code. Has anyone meet the same issue?
Flutter: v0.2.2
Launching lib/main.dart on iPhone 8 in debug mode...
Xcode build done
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
/Users/Sean/Documents/myapp/build/ios/Debug-iphonesimulator/Runner.app:resource fork, Finder information, or similar detritus not allowed
Command /usr/bin/codesign failed with exit code 1
Could not build the application for the simulator.
Error launching application on iPhone 8.
Exited (sigterm)
This is a new security measure in the Xcode build system.
You can go into details here : https://stackoverflow.com/a/39667628/6622328
For a quick fix, just clean the app before rebuilding it (flutter clean).
I suspect you don't have XCode installed, or have enabled your Runner project for your developer ID.

Build failed with error Error code 72 for command: xcrun

I am porting an phone app project into VS2017 and get the below error when I try to build for a Remote Device. This code has built correctly on VS2015 and runs fine in an Android simulator. Just get this error on and IOS remote device, which I need to run to create an .ipa file. I see a bunch of posts on an error 65, but none on error 72 that I can find. Can you help me on how to fix this? Thanks.
"
Severity Code
Description Project
File Line
Suppression State
Error Remote build error from the build server http://10.13.4.29:3000/cordova - Build failed with error Error code 72 for command: xcrun with args: -sdk,iphoneos,PackageApplication,-v,/Users/administrator/.taco_home/remote-builds/taco-remote/builds/8936/cordovaApp/platforms/ios/build/device/OnticMobile.app,-o,/Users/administrator/.taco_home/remote-builds/taco-remote/builds/8936/cordovaApp/platforms/ios/build/device
I fixed this by going back to XCode version 8.2.1
This happens if you use ionic build ios --device … it’s the device flag that needs the packageApplication, but which is not available in 8.3
I got around the problem without downgrading XCode, as follows:
Load your project into XCode 8.3 by clicking your .xcodeproj file (in
platforms/ios/build) and choose Product > Archive.
Select the archive in the next screen and click ‘Export’ button. Choose ‘Save for Ad Hoc
Deployment’ and you’ll get an .IPA file, just as if you had used ionic build ios --device.

Resources