Xcode Failed to set unique install ID on plugin - xcode

While building and running my app I simulator I came across this error
Domain: IXUserPresentableErrorDomain
Code: 1
Failure Reason: Please try again later.
Recovery Suggestion: Failed to set unique install ID on plugin com.myapp.enterprise.MyExtensionEnterprise
User Info: {
DVTErrorCreationDateKey = "2022-03-05 06:33:17 +0000";
IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher;
}
I am running on Xcode 13.2.1 and on Monterey, Have anyone else seen this before or know how to get around it?

I had a similar issue and found out that the IntentHandler.swift of an Intent Extension wasn't added to the Target Membership. Adding it to the Intent Target Membership fixed the problem.

For me, what worked was to fully remove the applications from both Apple Watch and iPhone simulators, clean the build, and it should start working.

Between recreating the widget extension, deleting derived data, erasing the content on the sim, restarting xcode (so basically standard stuff multiple times), something just clicked for xcode (???) and it started working for me.
My best bet is that what happened was:
Turned on "main app target > Build Phases > Embed App Extensions > Copy only when installing"
Ran the app (this time it was successful, however, the widget was not present)
Turned "main app target > Build Phases > Embed App Extensions > Copy only when installing" back off
However, this is just a wild stab, but it might work for someone else as well.
Good luck!
*forgot to say, mine is an ios widget extension

Related

xcode-cloud-assertion failures when testing Xcode Source Editor Extension

So I have a bare-bones Xcode project with an Xcode Source Editor Extension target attached. I'd like to test the thing, so I hit run. A new instance of Xcode pops up, where my extension should appear in the Editor menu, but there's nothing there. The logs show the following lines (among other things):
2023-01-20 13:44:24.240562-0800 Xcode[2203:46831] [xcode-cloud-assertion] ❌❌❌ Assertion failure #0 in Failed SW AuthKit for: <private>
2023-01-20 13:44:24.249980-0800 Xcode[2203:46831] [xcode-cloud-assertion] ❌❌❌ Assertion failure #0 in Failed to authenticate account: <private> error: <private>
For context, I'm running the following:
macOS 12.6.2
MacBook Pro (Retina, 13-inch, Early 2015)
Xcode 14.0 (14A309)
I'm not enrolled in the Apple Developer Program, and I've never used Xcode Cloud.
It's also worth noting that when I go to Reports > Cloud, I get Analyzing workspace... for a few minutes before Could not load Xcode Cloud data pops up (same issue as described here). I get similar behavior across all projects, including brand new ones. I'm not sure if that has anything to do with these log messages above, but I kind of hope it does.
I've tried the following:
Removing and adding my Apple ID in Xcode, restarting my MacBook in between
Deleting my development certificates
The main thing is that I'd like to be able to test my source editor extension. Any ideas?
Found it. The problem is XcodeKit, which isn't set to sign out of the box. I was able to fix it by setting it to Embed & Sign under General > Frameworks and Libraries > XcodeKit.framework (see screenshot).

Why this message appeared when I run the code

I just started to publish my application into apple store.I've encountered few errors that make it unsuccessful to validate the app (Assertion Failure).
Image show the error that i got after run the code inside XCode
I already try few solution, but still can't solve the error. Any ideas?
Usually this type of errors are solved after run 'Product' / 'Clean Build Folder' in Xcode.
This error so far it doesn't affect the performance of the application. And I just untick the metal API validation in Xcode > Product > Scheme > Edit Scheme > Run > Diagnostics > Metal Api Validation and it works like a charm. Not to forget to Clean Build Folder of your project and run it again. Hope this solution help others in future.

SwiftUI / Xcode Error - Updating took more than 5 seconds

When I try to preview one of my views in the canvas I keep getting the following error:
PreviewUpdateTimedOutError: Updating took more than 5 seconds
All my other views load perfectly fine.
Why is this happening and how do I resolve?
I am using SwiftUI in Xcode 11.4 (public release)
I stopped using the simulator and chose "Any iOS Device" and that solved the problem.
In my case the issue was this line in Build settings:
Something I did accidentally changed signing settings in my project. Specifically, "signing identity" was set to "Sign to Run Locally.".
For some reasons, SwiftUI Previews don't work then.
Simply deleting this line from build settings (aka setting default value) solved the problem.
Some time, the error displaying is not the real error.
For me it was because i missing : .environmentObject(...)
As of Xcode 12.5.1, the message PreviewUpdateTimedOutError: Updating took more than 5 seconds most likely means that your app crashed and thus updating the preview failed. The real reason for the crash is unfortunately obscured by this useless message (why Apple would do that is beyond me). To get at the real reason, you'll need to:
click Diagnostics at the top of the preview next to the useless error message
in the next dialog, click Generate Report > Reveal in Finder
This will take a bit. Then Finder will open with a folder highlighted. Open that folder. Inside you'll see a lot of log files and folders.
If your app indeed crashed, you'll see a folder called CrashLogs which contains crash logs for your app, including the error message and stack trace. This should help you resolve the actual error causing the preview to break.
Note that for me, sometimes the CrashLogs were not included in the report even though my app really did crash. Retrying the preview and generating another report fixed this for me. The whole error reporting process seems to be rather unstable for the previews, unfortunately.
Try Clean (Shift + ⌘ + K) and Build (⌘ + B) to build again the SwiftUI project, it works in Xcode 11.6. Try building a basic hello world app.
In my case the issue was that the PreviewProvider was marked private. Simply make it internal or remove the private access modifier.
private /* <- remove */ struct YourView_Previews: PreviewProvider {
static var previews: some View {
// Your previews
}
}
I am using Version 13.2.1 (13C100). I have Clean (Shift + ⌘ + K) and Build (⌘ + B) the project. But, the problem remains.
Then, just restarted Xcode. And the problem gone.
In my case viewModel required to display SwiftUI_preview was doing a call to a CoreData (fast call) in the init of the viewModel.
Moved actual call of that "reload() method" so it's not called on preview, fixed.
(I believe the correct way is to use mocked protocol instead of instance of the viewModel)
If you have an .onAppear clause, try commenting that out for preview.
None of these suggestions helped me but I did discover that you can't rely entirely on a successful build to pick up all issues. In my case I had '.modifier(modifier:)' entered incorrectly as 'modifier(modifier:)'. My code built successfully but my preview did not work until I added the period before modifier.
For me the issue was related to a force unwrapping of an element not being found at preview time.
Note: Always check the diagnostics report. The issue will be at the top section after termination reason.
In my case the canvas/screen size was smaller than the content, so simply wrapping my content in the scrollView do remove the error and displaying the content in the canvas.
I had a fatalError("...") in my code, which I only figured out after reading the diagnostic logs. Would be nice if SwiftUI actually hinted this!
You can get the diagnostics by clicking "Diagnostics" next to "Try Again" at the top of the preview window.
To summarise lots of answers here, it seems that the preview taking a while to update is the equivalent of a crash, when running on a real device or on the simulator.
First comment out all the environment Objects are used for the particular View. Once you get preview then uncomment it to run the build. This trick works for me
//#EnvironmentObject var observerObj:PropertyObserver
I had this issue as well, and nothing fixed the problem. I am now on 11.6 and after updating the issue went away. I think it might be a problem with Xcode 11.4.
I'd suggest updating Xcode if possible.
In SwiftUI, you couldn't add more than 10 subviews into your contentview, otherwise it couldn't compile.
I had the same problem, then I started to comment out the subViews inside my main view, one by one & try to preview again then I found out the problem was caused because I forgot to put a dot before one of the subViews attributes.
So that's how I fixed it.
The reason is because its unable to find the landmarkData.json file. To resolve this,
select landmark.json file in Resources.
Show Inspectors ( top right icon )
Select show file inspector
Under Target membership, select / check Landmarks
This should resolve the preview issue.
For some reason, in SwiftUI, when I embeded Text in Scroll View and VStack, this error occurred. After few unsuccessful attempts to fix this by clearing and building project, I deleted code and wrote it down again, same as it was. Now it is working.
I had my run device set to a real device I use for testing. When I changed that to one in the simulator it started working again.
Similar to #YannSteph, this happened to me because I put the .environmentObject() at the app entry point where it creates the first view:
#main
struct RecipeApp: App {
var body: some Scene {
WindowGroup {
RecipeTabView()
.environmentObject(RecipeModel())
}
}
}
But this prevented the preview from working. I thought I was being smart putting it there, so all the views could have access to it, but it just crashed the preview.
Moving it back into the main View.Swift file that is my app's starting view fixed the preview issue.
^^^
EDIT: Ran into this again when I didn't put the .environmentObject() in the struct for the preview. Probably a rookie mistake but there appears to be many ways to trigger this error.
I had the same issue after creating a brand new Multiplatform App project using Xcode 12.5. Based on the solutions above I followed a hunch and now believe that the issue is due to invalid path parameters.
After renaming the Schemes and Targets from (iOS) to .iOS (and the same for macOS), to remove spaces and brackets, it is now working.
I had this issue after changing bundle id and signing from personal to team.
After changing device to Any device as advised here, I received another error description, saying
Could not install the preview host "AppName.app" on iPhone 12 Pro Max
agentBundle = com.bundle.Its.AppName {
url: file:///Users/macbookair/Library/Developer/Xcode/DerivedData/AppName-> desupjbpqvjlegfbskxydixpouvc/Build/Intermediates.noindex/Previews/AppName/Prod> ucts/Debug-iphonesimulator/AppName.app
> version: 49557
signingInformation: Code Signing {
identifier: com.bundle.AppName
hasGetTaskAllow: false
isSandboxed: false
}
}
Clean build, deleting Derived, Deleting all apps installed on simulators, cleaning Xcode Cache, restarting Xcode and Mac didn't help.
What had helped was creating new project with initially correct bundle id and copying all my files there.
I have got into the same issue on Xcode 12.4, but the code works fine on Xcode 13.0.
I was following the IOS App Dev Tutorial, where one creates an app named ScrumDinger. I ran into this issue at Displaying Data in List
In my case the problem was that I wrote in CardView.swift
HStack {
Label("\(scrum.attendees.count)", systemImage: "person.3")
accessibilityLabel("\(scrum.attendees.count) attendees")
instead of
HStack {
Label("\(scrum.attendees.count)", systemImage: "person.3")
.accessibilityLabel("\(scrum.attendees.count) attendees")
The missing dot before accessibilityLabel was the problem.
Tutorial:
https://developer.apple.com/tutorials/app-dev-training/displaying-data-in-a-list
In my case the issue was that I was trying to preview a view with a fixed width (.previewLayout(.fixed(width: 344, height: 220))) wider than the selected simulator (iPhone SE 1st generation) 😬
I get this error often. My last time of occurrence, I had "gesture" instead of ".gesture". Usually its best to just need to find the error in your code yourself because Xcode does not point out the issue directly.
I only had Xcode 14 Beta installed on my machine and the previews did not work. All of the other answers did not work for me.
Installing Xcode 13.4.1 and running the preview with it did solve my problems and now I can also see the preview in Xcode 14 Beta as well.
In my case, I disabled automatic canvas refresh by going to Editor -> Canvas -> Automatically Refresh Canvas and making sure it.
Then I use ⌥⌘P (Command-Option-P) to refresh the canvas preview.

Unable to find APP_BUNDLE_PATH. Cannot find a built app that is linked with calabash.framework

I am running calabash-cucumber in xcode 5.0.1 on OSX 10.9.1, but getting this error while executing the test script. I have installed calabash framework successfully, but don't know why this error occurs.
Error... Unable to find APP_BUNDLE_PATH.
Cannot find a built app that is linked with calabash.framework
Please build your app from Xcode
You should build your calabash target.
Alternatively, specify APP_BUNDLE_PATH in features/support/01_launch.rb
This should point to the location of your built app linked with calabash.
(RuntimeError)
/Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.9.168/lib/calabash-cucumber/launch/simulator_helper.rb:178:in `app_bundle_or_raise'
/Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.9.168/lib/calabash-cucumber/launcher.rb:307:in `relaunch'
/Users/mymac/Desktop/myproject/myproj/features/support/01_launch.rb:29:in `Before'
Does your simulator or device contain the YourApp-cal target installed? Check weather you run the YourApp-cal target once from the xcode to install the app with calabash server on simulator or device.
Then Check you have followed setup Process
You need to have xcode tools installed too.
Check these things too.
Build the yourApp-cal target and run using xcode once.
While App is running open a Terminal(console) and type calabash-ios console. If your ruby environment is correct it will open you a ruby console.
In that console type
server_version['version']
and
Calabash::Cucumber::FRAMEWORK_VERSION
you should get something like "0.9.164"
calabash.framework is installed correctly in your app.
If so You should go to the file /YourProject/features/support/01_launch.rb open it check weather app bundle path is specified or not (if it is commented out calabash automatically detect the default app bundle path) if you are building your app to somewhere else than the default place you need to specify the appbundle path here in this file.
Tell us more details after check this list so we can help you more..
I hit the same issue, the way I got around to it is, on Xcode's top-right corner there is "Identity and Type" window. There you will find the full path of anything that you select on left (Project Explorer window).
Now usually on the ProjectExplorer window you should have "Classes", "Common", "Frameworks", "Other Sources", "Product", "Resources", "Scripts" etc. (It might be slightly different project by project). Inside "Product" is where your .app lives.
Select your app and you'll see the whole path on "Identity and Type" window.
Copy and paste it to "support/launch.rb" where it says APP_BUNDLE_PATH.
Should work now.
Edit 29/07/14: Do you see
HTTPServer: Started HTTP server on port 37265 on 'All output' window of Xcode (my version of Xcode is 5.1) when you build ?
There is a better way to set up calabash so you won't have this problem.
It involves creating a configuration, rather than a -calabash target. Basically you
1. create a configuration
2. add calabash framework to that configuration in build settings
3. add framework search path to find that framework
4. create a scheme to run calabash
The longer version can be found
http://fangmobile.com/2014/05/08/do-you-love-calabash-ios-but-hate-that-cal-second-target/
Deleting the contents of /Library/Developer/Xcode/DerivedData and compiling again solved this problem for me.
My error message was Unable to auto detect APP_BUNDLE_PATH.

Unable to process application Info.plist validation at this time due to a general / IO error [duplicate]

I am creating a newsstand application. the application is ready, now i am trying to upload the app in apple store using Application Loader. While uploading the zip file its showing the error message as
Unable to process application info.plist validation at this time due to a general error (1095)
I googled this in the net, but did not find the solution still.
This is clearly an Apple server issue, not an Xcode/iOS/OSX issue. Just wait patiently and Apple's servers will catch up to the traffic, or solve whatever issues they're having at their end.
If you're anxious, feel free to just sit there and restart Xcode until it works - but it's not restarting Xcode, only the time you waste that's solving the issue.
While you're waiting, run your apps in Instruments and solve some performance issues ;)
I just had this error. I waited an hour and tried again with the exact same build and it was all good. Vote for it being Apple's temporary glitch.
I had the same problem. I closed Xcode, restart my computer and it worked.
One possible problem to this is corrupted png files. The png files should not be interlaced
I found a solution to the problem.
If you're using Xcode 4+, you don't have to use Application Loader anymore. Instead you should archive your project in Xcode (Product->Archive). It will then open the organizer, where 3 buttons are displayed. Hit the submit button.
If you've created an entry for your app with Itunes Connect, you should be able to choose that from the list, and then select your distribution profile. Then hit the next button, and you should get a message, that tells you, that your app has been submitted.
At least that worked for me.
Use Application Loader.
I'm getting this a lot today.
Application Loader worked.
XCode > Project > Archive
XCode > Organizer > Distribute > Enterprise/add Hoc > Save As
Saves as YOURAPP.ipa.
Make sure Save for Enterprise Deploy remains UNCHECKED.
Download latest Application Loader.
tap 'Deliver Your App'
make sure new version in itunes connect in WAITING FOR UPLOAD state
Click on Activity... button
TIP: open Console.app to see XCode Validation errors
Click on ALL MESSAGE on list of logs on right.
Then in search enter 'XCode' or 'Application Loader'
to monitor any errors with your upload.
Note:
I did all this and still got email about missing 120x120 icons.
Forgot to update them in Build Target > General Tab
List of new icon requirements for iOS7
http://www.icenium.com/resources/forums/icenium-general-discussion/missing-recommended-icon-file
Another reason why this can happen is the duplicate product name. Despite your app names, executable names, display names or bundle IDs are different, if the product name exists in your current apps this error is gonna occur.
"The server returned an invalid response. This may indicate that a network proxy is interfering with communication, or that Apple servers are having issues. Please try your request again later.""
Reset The internet connection.
Reopen the xcode.
Set the profile again.
Clean build.
And Archive the build.
Works perfect for me (With in 5 minutes no need to wait).
Thanks
It's just the time, because you can't control Apple's Server's traffic problem, We all merely become the victim of that..So cut the long story short...
By restarting XCODE may work but everyone as in my case, i tried by restarting XCODE, SYSTEM, ROUTER and anything and everything possible, only error name had changed from "The network connection was lost" to "The request timed out" and vice Versa..!
Just think at what time less people would be accessing the sever...
PS: Only perseverance can help you in this way..keep redialing..And WAIT and WATCH:P
I solved ... :)
Please remove all your icons and splash image also remove icon Files and icons File( IOS 5 ) from info.plist and then add all your icons to app bundle ...
After this update info.plist iconFiles field add desired name of icons....
And last but not least remove Provisioning profile from developer portal and recreate it ...
Clean your build and Archive it and using Application Loader submit it to AppStore ...
it work for me and i think it may help you...
Not every time not it is Apple server issue,sometime we did some bad linking according to me :)

Resources