xcode PBXCp Error - xcode

My Xcode project is really starting to irk me.
I wrote a program that involved multiple png images. At a random point, it said that frown.png had no such file or directory so I renamed every instance of it to frown2.png and i still got the same error still saying frown.png even though there was no instance of it.
I then took all of my code and images and created a new project. For a while it worked, but when i tried adding a second view (doubt that caused it), i started getting the same error again still with frown.png.
What should i do?
(P.S. i am very inexperienced in xcode so please keep answers clear and concise. Thanks)

Related

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: setValue:forUndefinedKey, _requiresUserActionForMediaPlayback

I'm trying to use the xcode emulator, but keep getting this error on startup:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<WKWebViewConfiguration 0x7f9dce800d40> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key _requiresUserActionForMediaPlayback.'
I've tried uninstalling/reinstalling cordova-plugin-ionic-webview and have exhausted all the solutions I can find here on SO, but they have made no difference.
This is an ionic cordova project, so I can't change any code in xcode, as it will be overwritten the next time I build the project. Any other solutions will be gratefully received.
I'm not sure whether it's related, but when I do an android ionic emulate on the command line, it works, but an ios emulate doesn't and I get this error:
/Users/path-to-project/platforms/ios/build/emulator/project.app/Info.plist file not found.
The problem is that no build folder under the ios one has been created, which is probably why it can't find anything there. I think I've tracked the problem to the following messages farther up the output:
CONFIGURATION_BUILD_DIR = /Users/path-to-project/platforms/ios/build/emulator
SHARED_PRECOMPS_DIR = /Users/path-to-project/platforms/ios/build/sharedpch
However, I don't know where these configs are set. Does anyone know where ionic gets these configs from?
One question comes to mind though: If CONFIGURATION_BUILD_DIR is set to this location, why isn't the build dir created here?
This one is a doozy and a pretty obscure one that took ages to figure out.
This solution is for ionic. There are loads of 'solutions' out there for Xcode, but they can't be used for ionic projects, as any code changes in the ios folder will be overwritten on the next compile.
The clue is in the message: _requiresUserActionForMediaPlayback. However, another part of the message mentions WKWebView, which is a red herring, as it isn't actually anything to do with the problem.
The actual problem resides in the cordova-plugin-background-mode plugin, in the /cordova-plugin-background-mode/src/ios/APPBackgroundMode.m file to be exact. At the end of the swizzleWKWebViewEngine method, which is at the bottom of the class, change:
forKey:#"_requiresUserActionForMediaPlayback"];
to:
forKey:#"requiresUserActionForMediaPlayback"];
i.e. delete the underscore. Yes, it really is that simple and it wasted days of my life finding it.
It's a bug that is mentioned on Github at: https://github.com/katzer/cordova-plugin-background-mode/issues/381. As at 9th October 2018, the plugin hadn't been updated for 2 years and the bug had still not been corrected in npm, so you have to make the change yourself until it has been.

Opening Storyboard fails with "An internal error occurred. Editing functionality may be limited"

Im running Xcode 9.2. My storyboards are completely useless now. Ive
experienced what this article shows and have tried everything the
article suggested.
My issue occurred when I tried to add a single swift file to an existing
objective C project with about 320 files in it already. I removed the
.swift file entirely from the project, then did everything in the article
link above and still nothing fixed it including removing/reloading XCode
several times trying different things.
I filed a bug with apple but haven't received any replies in a week (of course). Apple seems to be slammed with tons of bugs lately they keep
creating.
Now I cannot work on this project's storyboards at all and Im dead in the
water. Really not happy with Apple lately!
Is there anything more that anyone has had success in fixing this issue?
Im completely dead in the water on this application now.
Fixed this by setting the command line tools version to the correct one. Mine was blank in Preferences / Locations
For my case, whenever I open a storyboard from a workspace, this happens. So I got rid of cocoapods and workspace, then just use carthage for thirdparty libraries. Storyboards opens faster and without this error.
Note that the storyboard I am testing is empty.
This turned out to be stupidity on my part. I had a script that was killing certain processes on my Mac over and over and it turns out that was my issue. When I removed it everything worked as normal again.

macOS project failing on runtime

So I have an xcode project that fails every time I run it on my computer. Works on other computers though. I get the following error:
dyld: Library not loaded: /System/Library/PrivateFrameworks/Swift/libswiftCoreFoundation.dylib
Now, when I look in /System/Library/PrivateFrameworks/Swift/ I can't find the libswiftCoreFoundation.dylib file. But other swift projects work just fine. I have no idea how to fix this. I've tried cleaning, restarting my computer, creating a copy of the project, updating Xcode, updating command line tools, everything I could think of.
The project was working just fine a few hours ago. Something went wrong by itself. No clue how to fix things.
After spending 6 straight hours debugging and trying to fix things, I found the solution. For some reason, my "Library Search Paths" was filled with the wrong directory. I never set it to that directory. But it was set.
Here is what I mean:
The highlighted field was filled with the following: macosx/System/Library/PrivateFrameworks/Swift
I just took that out. I hope this helps save some future traveler the pain and torture I went through

How do I archive/validate a Swift App that uses a framework in Xcode

I have an App that uses Admod and Firebase from Google. Since I am using Swift they want me to use frameworks when loading them from CocoaPods. When I try to archive/validate the App I get the error:
No suitable application records were found. Verify your bundle identifier 'org.cocoapods.GoogleToolboxForMac'
What is the correct way to provision an app that uses someone else's frameworks so it can be uploaded to iTunes Connect? I tried to find something in Apple's documentation but I haven't found anything.
UPDate:
I previously had answered my own question, since I had thought I had found a solution. My reply was:
Problem Solved. Turns out I was using an App-ID that I am having Apple look into as being corrupt. I had already created a new App-ID to prove the one I want to use is not working and retried with that and it Validates. This required a lot of help from the Google Ads Mobile SDK team. Thanks.
So the correct answer is: Now Incorrect
You should not get this error unless you are using a Bundle-ID that is not already registered on iTunes Connect, but, you should never be able to create an archive that does not have a Bundle-ID that is not already registered on iTunes Connect. So this is caused by an abnormal situation.
This is no longer true
I used my new working project and got 4 whole builds out of it and into iTunes Connect. In the process I was trying to clean up the mess caused by trying to solve this problem, like loosing my git history. I tried to modify my old App to get it to work and without modifying my new working project, But my new project started failing with the above error. I even used my time machine and went back to the directory as it was when I made the last build, but no help. So, any answers?
Further Update:
I pulled all the code related to Google Firebase and Admob out of the code and removed the cocoaPods and Archived/Validated and now I get the error:
You must supply a CFBundleIdentifer for this request.
Which is the error message I was getting with my other App-ID that tracked that App-ID in iTunesConnect. This time it does not track the App-ID so it must be something in my project. Will report what I find.
UpDate:
I think Apple has been modifying their code for validation at the same time I was trying different things. At one point it told me I was using CFBundleSignature instead of CFBundlePackageType set to APP and I fixed this and got the code to validate. Understand I am copying complete projects and renaming everything to debug this problem, so this must have come from the original program. I ended up with a project that was renamed from my original but archived/validated but when I went to compile for Test I got errors that I debugged until I got lots of Mach-O link errors. I decided to complete the loop and go back to my original code and try using the new Bundle-ID which points to the new App-ID, the one that works, and add all the knowledge I have learned. But when I get it done I have an project that can test but does not validate. The only difference is this project has the old identifier which has the same name as the suffix of the App-ID that has a bug.
Am I missing something?
Final UpDate?
On a whim I renamed the Scheme file to be the same as my Suffix to the Bundle-ID and I got my original Project to Validate! I have worked on this for over a month and you might not believe the astonishment I feel in this.
Back to Unit Test!
I have come to the conclusion that the Identity of the App, the name at the far top of the right side Utilities window, has something to do with the way iTunes Connect validates the App. This is the name in the left hand column of the Organizer window. It is like it overrides the suffix of the Bundle-ID and since I can't use that Identifier because the associated App-ID is corrupt. Or the name of the Scheme.

Xcode doesn't create swiftmodule

I've spent the past few months converting a project of mine with about 1500 source code files into Swift. It was incredibly tedious, but I finally did it. It runs well, builds well, but:
When I attempt to archive the project, Xcode fails with the following error:
ditto: can't get real path for source '/Users/USER/Library/Developer/Xcode/DerivedData/
APP-dtsbrzschafjiubelceuxtfwstqf/Build/Intermediates/ArchiveIntermediates/APPCore/
IntermediateBuildFilesPath/APPCore.build/Release/APPCore.build/Objects-normal/
x86_64/APPCore.swiftmodule''
Command /usr/bin/ditto failed with exit code 1
APP being the app and APPCore being the embedded framework.
What I've tried:
cleaning the project (which really has no effect when archiving, since archive always compiles from scratch)
using Xcode 7.2 beta (released a few days ago)
making as many declarations as possible non-public
disabling any Swift optimizations for the release build configuration
building the APPCore framework as release - which actually works (!) - and does (!) create the .swiftmodule file
The last part being the strangest here. This evidently points to the archive doing something slightly different, but I have no idea what.
My question is if anyone has any idea why is this happening and how to debug this. I've spent the last two days trying to figure this out, but no results...
I've googled this error as well, but unfortunately, the answers were fairly limited and suggesting to comment all lines of code and then start slowly uncommenting them until the project builds. Which is OK for a smaller project, but not for a 25KLOC project, mainly when you have absolutely no idea where to start...
I had the same issue and your question actually helped me to solve it (Xcode 8).
In debug mode just got the "ditto: can't get real path for source" without any further information. Switching to release mode showed me that the problem was that the framework wasn't allowed to have a bridging header file. I went to the build settings and removed the bridging header file (don't know why there was one) and it now compiles both in release and debug mode.

Resources