Command PhaseScriptExecution failed with a nonzero exit code I - ios

I am getting the below error
/Users/user321/Desktop/MapForAppNewest/Pods/Target Support
Files/Pods-MapForAppNewest/Pods-MapForAppNewest-frameworks.sh: line
114: local: `=': not a valid identifier
/Users/user321/Desktop/MapForAppNewest/Pods/Target Support Files/Pods-MapForAppNewest/Pods-MapForAppNewest-frameworks.sh: line
114: local:
`/Users/user321/Desktop/MapForAppNewest/Pods/Mapbox-iOS-SDK/dynamic/826E141E-8875-3C3B-A106-2B772F8A0684.bcsymbolmap':
not a valid identifier
Command PhaseScriptExecution failed with a nonzero exit code
I have found many similar questions but they all failed to address this specific problem and offer a solution which works here. So I ask What is the problem here and how do I go about fixing it? (im using Swift and Firebase)

Open the file - /Users/user321/Desktop/MapForAppNewest/Pods/Target Support Files/Pods-MapForAppNewest/Pods-MapForAppNewest-frameworks.sh
On line 114, delete the spacing before and after '='
Clean and build project
This worked for me

In my case, it was caused by renaming of the folder name (the folder containing the project)
I cloned my project 'hovermind' into 'Foo' folder
Installed pods
Then renamed (for some reason) 'Foo' into 'Foo XXX'
The error I was getting Command PhaseScriptExecution failed with a nonzero exit code ... /Hassan/Desktop/Foo: no such file ...
Solution
I just renamed back the folder name to 'Foo' ('Foo XXX' -> 'Foo') and it worked

Related

React Native (Expo) - error: generate-pch command failed with exit code 1

Building a React Native Expo app (prebuild on iOS, not using Expo Go) and running into this esoteric error that I can't seem to find elsewhere on the internet.
I'll post it here for the next unlucky React Native dev, and perhaps I'll find a solution and post that too.
expo run:ios output:
⚠️ (../../Library/Developer/Xcode/DerivedData/MyProject-epxolwjjgmimbdefugnlecrdysuv/Build/Intermediates.noindex/PrecompiledHeaders/MyProject-Bridging-Header-2vyenlvwppgam.dia:1:1)
Command PrecompileSwiftBridgingHeader failed with a nonzero exit code
^ Could not read serialized diagnostics file: error(in target 'MyProject' from project 'MyProject')
❌ error: generate-pch command failed with exit code 1 (use -v to see invocation)
› 1 error(s), and 1 warning(s)
Failed to build iOS project. "xcodebuild" exited with error code 65.
Xcode build output:
<unknown>:0: error: error opening input file '/Users/jh/Code/MyProject/ios/MyProject/MyProject-Bridging-Header.h' (No such file or directory)
<unknown>:0: error: cannot open file '/Users/jh/Library/Developer/Xcode/DerivedData/MyProject-epxolwjjgmimbdefugnlecrdysuv/Build/Intermediates.noindex/PrecompiledHeaders/MyProject-Bridging-Header-e8n926ydzbc0.dia' for diagnostics emission (No such file or directory)
/Users/jh/Library/Developer/Xcode/DerivedData/MyProject-epxolwjjgmimbdefugnlecrdysuv/Build/Intermediates.noindex/PrecompiledHeaders/MyProject-Bridging-Header-e8n926ydzbc0.dia:1:1: warning: Could not read serialized diagnostics file: error("Failed to open diagnostics file") (in target 'MyProject' from project 'MyProject')
Command PrecompileSwiftBridgingHeader failed with a nonzero exit code
Expo SDK version 44. I'm on a 2022 Mac Studio M1.
Okay, found the solution!
I had used npx react-native-rename to rename my project, but it didn't rename the Swift bridging header.
It's located in ios/MyProject/<oldname>-Bridging-Header.h.
renamed: ios/MyProject/OldName-Bridging-Header.h -> ios/MyProject/MyProject-Bridging-Header.h
While I was doing this, I also discovered that several of my bundle identifiers hadn't been moved over either. Do a codebase search for com.yourorganization.youroldbundlename to find & replace those too.
The locations I had to update:
./ios/MyProject.xcodeproj/project.pbxproj
./ios/MyProject/Info.plist
./app.json

Jenkins return "unknown error -1=ffffffffffffffff" when building Xcode Project with Cocoapods

I'm getting below error when trying to build Xcode workspace on Jenkins
usr/bin/codesign --force --sign B5E96BDFADAF51D771B158A29BF1D16565215A2D --preserve-metadata=identifier,entitlements '/Users/servicebuild/Desktop/Jenkins/workspace/Hello-Branch/build/Hello Test.app/Frameworks/Alamofire.framework'
16:06:07 /Users/servicebuild/Desktop/Jenkins/workspace/Hello-Branch/build/Hello Test.app/Frameworks/Alamofire.framework: unknown error -1=ffffffffffffffff
16:06:07 Command /bin/sh failed with exit code 1
16:06:07
16:06:07 ** BUILD FAILED **
16:06:07
16:06:07
16:06:07 The following build commands failed:
16:06:07 PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/servicebuild/Library/Developer/Xcode/DerivedData/Hello-dcvxwbnovymfusbrvfyyekingznu/Build/Intermediates.noindex/Garanti\ Filo.build/Release-iphoneos/Hello\ Hello\ Test.build/Script-2617FEF7DE193736656550249B.sh
I have more than one targets and in workspace scheme targets that I created are ticked as shared (not the pod targets). In pod project every framework has "Don't Code Sign" (As Default). I can successfully get IPA export from Xcode. However, when I try to build in Jenkins I get this error.
I tried solution in below post but can't figure out. I think the problem is Jenkins is forcing to sign pods when It doesn't need to.
Codesign returned unknown error -1=ffffffffffffffff
I figured out how to run below code (posted in the post added in my question) and it worked. Important point is that giving right path for keychain and password. Otherwise, It doesn't work.
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k password ${KEYCHAIN}

No such file or directory when generate framework

When I make a new framework with aggregate to generate universal framework , but a error present , as follow :
cp: build/Release-iphoneos/TEST.framework/: No such file or directory
fatal error: lipo: can't open input file: build/Release-iphoneos/TEST.framework/TEST (No such file or directory)
Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure
And here is a screenshot of the error:
This is a new target , I only want to test generate framework , but fail!
As the error message said, no TEST.framework can be found in the path <PROJECT_DIR>/build/Release-iphoneos/TEST.framework.
You need to check the script you use, or the blog post which you reference is out-date.
First you should build the target specified in xcodebuild command directly to see if it can build succeed.
Check what the actual build path is. If the path(build/) is not exist, you can try to specified the build path for xcodebuild, OBJROOT=${WRK_DIR} SYMROOT=${WRK_DIR}

'warning: directory not found for option' error on build

All of a sudden my app has started giving me an error when I try to build it. This is the error I'm getting:
ld: warning: directory not found for option '-L/Users/user/Documents/Developer/Alton-Towers-Times/build/Debug-iphoneos'
ld: file too small (length=0) file '/Users/user/Library/Developer/Xcode/DerivedData/Mouse_Times_Florida-eqhrhnbxmmkxtahdghmnvehbzbgt/Build/Intermediates/Mouse Times Florida.build/Debug-iphonesimulator/Mouse Times Florida WatchKit Extension.build/Objects-normal/x86_64/SecondInterfaceController.o' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Only thing I've really done since I last managed to get it to run was changing the bundle IDs and I also changed the app name. I've tried a few things including deleting the derived data, but nothing seems to have helped.
Anyone have any ideas?
I solved this warning removing the following setting: "$(SDKROOT)/Developer/Library/Frameworks"
This options is located in Settings -> Build Settings -> Search Paths -> Framework Search Paths
Setting location
My project continues compiling and working fine, after removing this option.
Veladan answer helped me to sort out that issue on an iOS8 project freshly migrated to iOS9.
This worked fine on the main target of my project, but the warning lasted on the unit tests target, so in the end I edited directly the project.pbxproj file and modified the entries :
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
to :
FRAMEWORK_SEARCH_PATHS = "";

Not found an file de MOIP on Objective C

I just develop MOIP with ready-made components, but received the error after running.
Showed an error message:
"ld: file not found: /Users/teste/Library/Developer/Xcode/DerivedData/Moip_Store-fakuiehavrpkaeggjvvtbovybkyh/Build/Products/Debug-iphoneos/Moip Store.app/Moip Store
clang: error: linker command failed with exit code 1 (use -v to see invocation)"
site: https://github.com/moip/ios-sdk-sample
Someone solve this problem?
how?
Select your Project and choose your "Moip Store Test" - Target, go to "General" and set your Application as Host Application.

Resources