Codesign error, flutter clean required every time - ios

Ok so I've have this issue which is
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.
When building my flutter app. After much investigation, and following what is written here Codesign error with Flutter on iOS
Running flutter clean removes the error, however, when closing the simulator and re-running debug again the error is displayed... is there a more permanent fix for this?
I've also followed the commands outlined in this thread too Code Sign Error in macOS High Sierra Xcode - resource fork, Finder information, or similar detritus not allowed

In this case use xattr -cr. command in the Project Directory Terminal.

Related

Xcode 11.6 Command PhaseScriptExecution failed with a nonzero exit code

I'm trying to Archive my build in Xcode 11.6 running on macOS 10.15.5 and every time I get the same error "Command PhaseScriptExecution failed with a nonzero exit code".
In Signing & Capabilities option I've chosen Distribution provisioning profile on both tabs Debug and Release and I've disabled automatic signing.
I have 2 certificates: one for development and one for distribution.
Here is the error:
I've already tried Keychain lock and unlock. On Xcode 10 and macOS 10.14 this worked without any problems.
Can you help me please,
Robert
According to the error message, it seems there is a build script that tries to run another script called copy-www-build-step.sh, and gets a "Permission Denied" error. The most likely cause is simply that the script file does not have execute permissions (no files have this permission by default, and permissions are often lost when e.g. unzipping an archive).
This can be easily solved by running the following command in Terminal to enable execute permissions:
chmod +x /path/to/copy-www-build-step.sh

Not able to deploy flutter application to iOS Appstore

While Building the app for iOS Distribution in flutter I faced the below issue with the build, I tried many things available on google related to this issue but no resolution yet.
How am I supposed to deploy flutter application to iOS Appstore?
Warning: unable to build chain to self-signed root for signer "iPhone Distribution: Mark Davids (*********)"
/Users/mark/Downloads/chat_app-master 2/build/ios/Release-iphoneos/Runner.app/Frameworks/App.framework/App: errSecInternalComponent
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
Encountered error while building for device.
This is a vague error, however my guess is its 1 of two things.
There is Flutter detritus that is blocking your build, which you can fix by running the flutter clean command
Your certificate is invalid. When dealing with this in the past I have found the easiest way to fix it is to open XCode, set the signing to none, purge your certificates and keys from your system, and then re-add them to the keychain.

React-native fails to build for ios because command codesign failed with a nonzero exit code

I recently updated my mac and all of a sudden I can't compile the application I've been working on in react-native. The error it gives is Command CodeSign failed with a nonzero exit code.
When it begins running this command, it says the Signing Identity is "-", even though that I have my signing correctly set in XCode.
It also says, ios/build/Build/Products?Debug-iphonesimulator/project.app: resource fork, Finder information, or similar detritus not allowed.
This also results in a `No bundle URL present." in the iOS simulator.
If it helps, I am using yarn ios to compile.
I have tried solutions previously written for other code signing issues, none of which are related to react-native. None of these solutions have worked.
Have you tried cleaning and rebuilding your project? I had a similar problem recently, and what worked for me is deleting everything from YOUR_PROJECT/ios/build/ and running react-native run-ios command again.

react-native run-ios doesn't run: Application is unknown to FrontBoard?

I had react-native run-ios working for the past few days but today it randomly decided to stop working:
The following commands produced analyzer issues:
Analyze /Users/swyx/Desktop/webdev/fullstacksr/reactNativeExtensions/ActionExtensionExample3/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c
Analyze /Users/swyx/Desktop/webdev/fullstacksr/reactNativeExtensions/ActionExtensionExample3/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c
(2 commands with analyzer issues)
Installing build/Build/Products/Debug-iphonesimulator/ActionExtensionExample3.app
An error was encountered processing the command (domain=IXErrorDomain, code=2):
Failed to set plugin placeholders for org.reactjs.native.example.ShareExtensionExampleswyx
Launching org.reactjs.native.example.ShareExtensionExampleswyx
org.reactjs.native.example.ShareExtensionExampleswyx: -1
An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=1):
The request to open "org.reactjs.native.example.ShareExtensionExampleswyx" failed.
The request was denied by service delegate (SBMainWorkspace) for reason: NotFound ("Application "org.reactjs.native.example.ShareExtensionExampleswyx" is unknown to FrontBoard").
Possible causes and solutions investigated:
Checking the scheme - it is definitely Ask on launch
Scheme settings - i dont have any empty settings to leave unchecked
Maximum App ID limit reached - this app id org.reactjs.native.example.ShareExtensionExampleswyx is something I am reusing but i dont think it causes this issue
deleting ios/build and recompiling
restarting my simulator and my entire computer
Edit: yes i am using xcode 9
none of these have worked so far. Any other ideas on things to try please?
try with another simulator if it works you need to reset your simulator from simulator menu
Simulator -> Reset Content And Setting if you have Xcode 9 it will be from Hardware -> Erase All Content and Settings
clean from Xcode menu Product -> Clean and run your project
As mentioned by Gavin Owens on Github, I followed those steps and it worked.
Just delete ios/build from iOS directory and after that run command react-native-run-ios
use following command
rm -rf ios/build then running react-native run-ios

Cordova command-line build fails in /tmp on Mac

I get a linker error building a brand-new PhoneGap app from the command line. It creates a bunch of files, and if I open the created .xcodeproj in Xcode, it builds just fine. So what's wrong with my command-line environment?
$ phonegap create /tmp/buildtest-ios
$ cd /tmp/buildtest-ios
$ phonegap -V build ios
[phonegap] detecting iOS SDK environment...
[phonegap] Checking iOS requirements...
[phonegap] using the local environment
[phonegap] compiling iOS...
[phonegap] Generating config.xml from defaults for platform "ios"
[phonegap] Compiling app on platform "ios" via command "/private/tmp/buildtest-ios/platforms/ios/cordova/build"
[error] An error occurred while building the ios project.** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
** BUILD FAILED **
The following build commands failed:
Ld /private/tmp/buildtest-ios/platforms/ios/build/emulator/HelloWorld.app/HelloWorld normal i386
(1 failure)
If I run the offending Ld command myself from the command line, I get "file not found". Does that mean the compiler failed and the linker error is just a red herring?
This is PhoneGap 3.3.0-0.18.0 on Mac OS X 10.9. I can create and build an Android app with this installation, no trouble. I get the exact same behavior if I use cordova directly. I've tried it on two Macs with the same symptom.
I finally discovered the answer using the cordova command-line tools. Cordova has a -d flag which is way more verbose than PhoneGap's -V flag. The linker was failing with a bunch of errors like
duplicate symbol _OBJC_METACLASS_$_CDVTimer in:
/private/tmp/buildtest-ios/platforms/ios/build/emulator/libCordova.a(CDVTimer.o)
/tmp/buildtest-ios/platforms/ios/build/emulator/libCordova.a(CDVTimer.o)
Note that /tmp on Mac is a symlink to /private/tmp, so these are pointing to the same file. No wonder they're duplicate symbols! So why is it trying to include the same file twice?
I tried creating a new test project in an empty folder /private/my-new-tmp2/buildtest-ios. Building it failed with the same error. So apparently something is weird with Cordova's iOS projects and the Ld linker in the /private directory on Mac OS X 10.9, and I'm the only person who's ever tried this. (As I said, building for Android works fine.)
In case someone else ever runs into the same problem, the solution is to build the project in /Users/me/some/directory rather than anywhere in /tmp or /private. Problem solved.
This may be because your framework references are corrupted or point to nowhere. In the left of XCode under 'Frameworks' and 'Resources' try re-adding anything you added yourself. Chances are with Cordova its a plugin SDK you are using that has been updated or deleted.
I had a similar issue while placing my project under /var/www/PROJECT on mac. I was getting the duplicate errors along with "../cordova/build: Command failed with exit code 65".
I was getting the duplicate errors because /var/www/ is also /private/var/www/
Solution was to move my project as described above to /Users/username/some-other-dir/...
I then ran phonegap run ios and all worked!

Resources