Using xcodebuild and a Today Extension I get a PBXCp error - ios

I'm using UI-Screen-Shooter to compile my app for screenshots. After I added a Today Extension the compilation won't finish due to not finding the AppExtension.appex directory. The directory is there but under a different name than xcodebuild is expecting. It is called app.appex and Xcode is looking for PhotoMind Upcoming.appex.
It fails with this PBXCp error:
/tmp/screen_shooter/PhotoMind Upcoming.appex: No such file or directory
How would tell xcodebuild that it is called app.appex instead of the name it is looking for?

I didn't find how to change the path of the Extension in Xcode build, but I was able to get UI-Screen-Shooter to build and run my app by checking the Copy only when installing box in the Build Phases settings.

Select "Extension" Target ----> Build Settings;
Search "name" or "Product Name",
Setting the "Product Name" (of "Extension" Target) to "app".

Related

Error: Build Input file not found, when tried to run the app on iOS simulator

After upgrading the Xcode to 12.2 from 11.x , I'm getting a wierd error when trying to run the app on iOS Simulator.
The error is:
error: Build input file cannot be found: '/Users/mrt/Library/Developer/Xcode/DerivedData/xxx-fqqnstjlfcnipqbcjbnhysubdksn/Build/Products/Debug-iphonesimulator/xxx.app/xxx' (in target 'xxx' from project 'xxx')
Here the missing /xxx is the unix executable file inside the .app folder.
When I try to build it on phone, there is no such error.
When I checked the location in finder, the unix executable file inside the .app is missing, for Debug-iphonesimulator, but it is present in Debug-iphoneos
I have no idea, why that executable file is missing.
I have added the arm64 in the excluded arch section in the new Xcode. Both in project and target Buil Settings.
I tried changing project settings to Legacy Build, and it resulted in same error.
I haven't moved any plist files or any files in my project. I deleted some unused targets and related files. The error didnot mention anything about deleted files. Hence I do not think , those could be the reason. I tried this SO link, and it didnt solve my issue. My plist file path is $(SRCROOT)/xxx/SupportingFiles/xxx.plist
I did delete derived data and clean, many times. Not solved.
I tried adding x86_64 under VALID_ARCHS and adding arm64 under exluded arch settings, as suggested in here. Not solved.
Is there anything that I'm missing ?
THIS error maybe your update Xcode version like: Xcode 10 to Xcode 12, the your old PROJECTS will got this error, can't running your app again.
Try this:
1:
VALID_ARCHS (in the "Architectures" tab) key on the BuildSettings of "PROJECT" GROUP
or just search "VALID_ARCHS", maybe in the other Tabs( or in the "User-Defined")
set value "arm64" or others
IMG SIMPLE:
2:
select TARGETS: your app's target
search for the same KEY ("VALID_ARCHS") and just selection the current row and click "delete" on your keyboard, there will be with default values(it is the same value of PROJECT's Build Settings )
3: clear and rebuild

React Native xcode project "Header Search Path"

Following the steps from React Native official tutorial, the xcode project created by "react-native init MyFirstRNProject" won't compile. It complains "React/xxxxx.h" can't be found.
After further investigation of this xcode project, I figured the "React" target contains a build phase "Copy Headers" which copies all exposed headers into a weird location:
"MyFirstRNProject/node_modules/react-native/React/build/Debug-iphonesimulator/include/React"
OK, cool, at least we got the header location. We can change the copied location to somewhere else that better than this. So whichever the project that do "#import < React/xxxxx.h >" should have above path in "Header Search Path" in build settings. Unfortunately, all projects have "Header Search Path" empty. And that's why I'm getting tons of header not found error.
OK, let's add it. Now it finds headers, but compilation still failed, see reference below:
https://github.com/facebook/react-native/issues/21482
The discussion above saying that removing the "Header Search Path" of the projects will solve the problem. But we know that without header search path, it again can't find React headers.
Just curious now, I don't think my setup is wrong, does anyone has the same issue?
I had the same problem on fresh install of Xcode 10.1
There are few steps to follow to compile the new project after react-native init appName
In Xcode, Select File -> Project/Workspace Settings. You will see a Build System option to select the Legacy Build System as shown below
Change Advanced settings, and set Build Location to Custom and change paths to Relative to Workspace and Build/ to build/Build/ as showed.
3. User Debug for command-line builds(for react-native run-ios to work properly)
Clear your project
After this manipulations(don't need set header search paths) you'll be able to build and run empty project via Xcode or CLI

TwitterKit does not compile with Xcode 6.3

I added TwitterKit from Fabric to an app under Xcode 6.3.
The app would compile before I added TwitterKit's Run Script build phase step but once I added TwitterKit it failed with this error during Debug builds:
2015-02-23 11:22:32.382 run[53735:1513077] Fabric.framework/run 1.3.13
2015-02-23 11:22:32.388 run[53735:1513077]
Fabric: dSYM Error
Unable to process fabrictest.app.dSYM at path /Users/mfoouser/Library/Developer/Xcode/DerivedData/fabrictest/Build/Products/Debug-iphonesimulator/fabrictest.app.dSYM
Make sure your project build settings are generating a dSYM file. DEBUG_INFORMATION_FORMAT should be set to dwarf-with-dsym for all configurations. This could also be a timing issue, make sure the Fabric run script build phase is the last build phase and no other scripts have moved the dSYM from the location Xcode generated it.
Command /bin/sh failed with exit code 1
Anyone find a way around this?
This was a simple fix. Just do as the error state, turn on dSYM generation for your debug build.
Change your Build Settings from this:
To this:
Then choose Build again. It should now compile and run.
You can follow below steps ,it worked for me.
open build setting of your project and search for "Generate debug symbol" and set it to Yes.
As in the below screenshot
Search for debug information format in build setting and search for "Debug information format" then set "Debug information format" to "DWARF with dSYM file"
This didn't work for me since it was already set to 'with dSYM' and it didn't build as well. After more digging and trying things out, it seems like the issue (for me at least) is under Build Settings > Generate Debug Symbols, which was set to No by default. I changed it to Yes and it worked like a charm.
No one of proposed answers worked out for me.
Deleted both Fabric.framework and Crashlytics.framework which were added via Fabric app and added them again through Cocoapods.
**It doesnt mean that Cocoapods is only workaround, but probably that they should be re-added to project again.
What worked for me was the previous answers combined:
1- Change "Build Settings -> Debug Information Format -> Debug" value to "DWARF with dSYM File"
2- Change "Build Settings -> Generate Debug Symbols" value to "Yes"
3- Remove Fabric and Crashlytics frameworks and install again

Link error /Build/Products/Debug-iphonesimulator file not found

I have problem with Xcode, keeps giving me a linker error, and it doesn't build the project. The following is the error am getting
ld: file not found:
/Users/someuser/Library/Developer/Xcode/DerivedData/MAR-akbwbarcniqxytctbebckkelkbxs/Build/Products/Debug-iphonesimulator/MAR.app/MAR
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
As some of the fellow developers have mentioned here, the root cause of the error was "Change in Product Name". I fixed it by :
Go to [project]Tests -> general
Select Host Application
Credits : https://stackoverflow.com/a/28906400/2164029
I picked up a project that had this same error. I found that the project name had changed, but the code I had did not reflect that change in the project build settings. To correct, I updated the "Product Name" value (found under targets | Packaging) to the correct value and rebuilt the project. Ran fine.
I got this fixed by selecting the Tests target and searching for Bundle Loader in Build Settings and changing the product name in that path. I got this error because I have changed the Product name. The Bundle loader has the old product name in the path, so it searches for that path.
I had the exact same problem and if you are using cocoapods make sure you open your project with .xcworkspace not .xcodeproj, for me it was that simple.
Make a deep clean of your project by ⌘ Clean (Menu >> Product >> Clean)
I solved by running pod deintegrate https://github.com/CocoaPods/cocoapods-deintegrate:
pod deintegrate
pod install
I found the solution, I have removed what ever was in dependency.
Build Phases -> target dependancies
remove whatever in there.
if there's test target also click on the test in the build phases in the target dependancies remove what ever in there.
I ended up resolving this in Xcode 7.3 by deleting the Bundle Loader values under Build Settings. Seemed risky, but I noticed the other targets didn't have any such values defined; only the test targets (which were failing to build due to this error).
I got the same issue. What I did was to look for a different 'Product Name' listed under Build Settings. I found the old Product Name still listed under Packaging (Both the Product Name and Product Module Name had the old name). I changed it to the new one and the project compiled without error.

Can't create Archive with Static Library

I'm trying to create a archive for a app linking to a static library but with no luck.
I can built the app in both release and debug mode just fine. I can even built it for Archive (product->built for->archiving) but it fails miserably when I try to create the archive (products->Archive)
XCode can't seem to find the headers for the Static lib:
In file included from /Data/Code/iPhoneDev/ArchiveTest/ArchiveTestApp/ArchiveTestApp/ArchiveTestAppAppDelegate.m:9:
/Data/Code/iPhoneDev/ArchiveTest/ArchiveTestApp/ArchiveTestApp/ArchiveTestAppAppDelegate.h:10:24: error: DataFetcher.h: No such file or directory
In file included from /Data/Code/iPhoneDev/ArchiveTest/ArchiveTestApp/ArchiveTestApp/ArchiveTestAppAppDelegate.m:9:
/Data/Code/iPhoneDev/ArchiveTest/ArchiveTestApp/ArchiveTestApp/ArchiveTestAppAppDelegate.h:13: error: cannot find protocol declaration for 'DataFetcherDelegate'
Any ideas or suggestions on what I'm missing here?
I ended up roughly following the suggestions in this Questions:
Compile, Build or Archive problems with Xcode 4 (and dependencies)
Create a group call "Indexing headers" in your project
and drag the headers to this group, DO NOT add to any targets when
prompted. This includes any headers inside your dependency
For all dependancies set "Skip Install" build setting to "Yes"
Moving any "Public" headers in Build Phases to "Project" for dependency
Set the Build Setting "Installation Directory" on your Target to
$(LOCAL_APPS_DIR)
The archive was created with no errors with step 1-3, but for it to become a valid app step 4) was needed.
Amazing how half baked XCode4 seems

Resources