CoreTelephony is not available when building for watchOS - when adding watch app target to ios app project - swift

This is a new error...I just recently added a watch target to my ios app and when to build...I was able to silence a myriad of other errors that came up, but this one will not go away:
CoreTelephony is not available when building for watchOS
What does it even mean? It is not referencing an error in my code, but a file in derived data...I tried to clean my build folder several times, but the error just won't go away. Any ideas how to fix?

It turns out this error was due to the incompatibility with Firebase. Once I removed firebase from my files and refactored, everything worked again...kind of a bummer but hopefully firebase will support it one day :/

Related

Unable to create a Build due to CoreData: API Misuse when there's no Core Data in the App, and the app builds for all Simulators

I am trying to create a build (Any iOS Device (arm64)), and I get an error:
/.../CoreData:1:1: API Misuse: Attempt to serialise store access on non-owning coordinator (PSC = 0x60000381b8e0, store PSC = 0x0)
The app compiles, and runs without any errors on all Simulators, and also on real devices (tested on 3 different iPhones). I have no logs in the console, only the error, not even a warning.
My app is not using Core Data.
I'm only saving a couple of user settings within UserDefaults.
The setup:
Xcode 13.1 (but the same thing happens on Xcode 12), Cocoapods, Swift 5, macOS Big Sur, SwiftUI 2.0 + Combine, I'm supporting targets from iOS 14+
What I've already tried:
I have reviewed the assets folders - no duplicate names, it's not empty.
I removed Lottie, and the file that it put within assets - didn't help.
I have updated all my pods.
I have tried cleaning Derived Data, clean builds, reinstalling pods, and restarting the Mac.
There is no Data(contentsOf:url) in my code.
Any idea why this could be happening?
This post doesn't help, I've tried all the suggested options. None of them apply here.
This is actually using Core Data, so it doesn't apply, and neither do all the posts they mention, nor their suggestions in the comments.
Fixed the issue. What I did is:
removed two outdated pods (that were using Core Data) - this moved things on, but I stil had the same error.
Removed a file Lottie has added to Assets - this moved things forward, but didn't fix the situation.
removing and readding all the Assets - one by one - manually - this fixed the issue.
I was suffering from this problem as well. When I saw Natalie's comment I immediately realised the problem.
I personally had "kra" files in my assets folder. Check the file types of your images.

How can I fix "Size Limit Exceeded" for my Apple Watch app?

Every time I try to submit an update for my app, I get this error:
I have literally removed all assets from the app except for the .Swift files, storyboard, and the plists. So I know for a fact that the app is not more than 50MB. Yet, I continue to get this error, no matter what else I remove from the app.
I have restarted Xcode, restarted my Mac, changed the build number, removed assets, and nothing is changing.
Anybody have any ideas?
I emailed Apple and they helped me to find the problem. My watchOS app was configured to have duplicate copies of the Swift runtime libraries, one in the watchOS app, and another copy in the watchOS app extension.
I had to go to the extension's project settings, and set Always Embed Swift Standard Libraries to No.

Unable to run app in Simulator Xcode 6

Yesterday i was testing my app in the iOS simulator and everything was working fine. I then decided to run the app on my iPhone and i got the error unable to install application, Unknown error occurred this has happened before so I cleaned my build folder (as this has fixed this issue before) however, the same error occurred. I then ran the app in the iOS simulator again and now i get the error Unable to run app in Simulator, An error was encountered while running (Domain = LaunchServicesError, Code = 0). I find this very weird as i didn't change anything besides trying to run the app on my iPhone. I have tried every solution given on this post and still no luck.
I'm sorry if my question doesn't contain much detail but as I said I didn't change anything and it was building and running fine a minute before plugging in my iPhone and trying to run it on there.
Any help would be much appreciated.
edit
I tried running other projects (with and without extensions) and they are working on both simulator and iPhone, therefore the problem must be within my project. (my project does have a today extension)
In that kind of cases I usually :
Product > Clean
Close xCode
Delete the Derived Data (in ~/Library/Developer/Xcode/DerivedData subfolders)
Delete the app on the iPhone
Reboot the iPhone
Restart and rebuild
I had this problem. In my case, it was caused by the Build value being blank. After putting a value there, and resetting the simulator once more, the issue went away.
I had the same problem and checking the system log carefully helped me to identify a coliding library that was causing this error. You can also check this answer if you are using extensions.
Generally it means there is a problem with the build, it may be due to old cache (solved by a clean build) or a project definition error (missing library, bad definition in info.plist, etc).
In my case it happened only on iOS 8, turns out that my widget had the wrong bundle ID.

iOS: Linking a third party framework and crashing when deploying

So, my problem is that I'm creating a framework to be used with iOS. It works great when in the simulator and when I'm debugging it on my iPad but as soon as I send it to anyone via Testflight (including my iPad) it crashes. The application will load the splash screen, then crash.
I tried symbolicating the report but I'm not getting anything out of it.
One time happened to me... xcode compiles the app for debug on the simulator, but for release on the iOS device. Then, the debug version doesn't do many enhancements.
Go to "Product" -> "Manage Schemes". There, if I were you, I would set everything to "Build Configuration": Release.
This way, you may be able to have the simulator crash... and it may be easier for you to figure out what's going on.
In my case, I was using a block but not copying it... then, on the release version, the compiler cleared the memory while on the debug version it didn't.
Hope it helps
So, the solution to my problem was that I was linking the framework but not copying it to the device, so when I debugged it with my iPad connected to it, it would find the references to the framework, but once it was deployed, the app crashed when it tried to find the framework.
The answer was:
Go to your project's build phases.
Add build phase > Add copy files.
Choose Frameworks in the Destination field.
Copy the framework.
Your app should now have the framework copied and installed wherever it needs.

XCode error "The application bundle does not contain a valid identifier."

Recently, after upgrading to Lion and Xcode 4.2.1 I am getting this error when trying to run my app on my iPhone 4S:
"The application bundle does not contain a valid identifier."
My identifier is indeed valid, and I have been able to run my app with this identifier earlier.
The problem might appear when I change computers.
I have two computers that I am using to code my app, and I am using Dropbox to keep track of my files.
Restarting XCode, my mac and my iPhone does not work.
Cleaning the target and rebuilding does not work.
The only thing I have been able to do to fix it is to create a completely new project and moving my files. This made things work until I swapped computer. Now I am in the same trouble again.
Any idea? Anyone?
Three suggestions:
Check that your developer key is in both computers
Did you try to update the project? There is a strangly-named key in the middle bottom under the project's properties. Try this.
I had similar issues. I found that some things weren't updated when I updated osx and xcode. To get out of the situation, I would suggest creating a new project and copy paste code, files and build settings. This might seem stupid, but you know apple is not good at creating IDE's. You might just get your self lost in the undocumented settings.