Xcode 8 App installation failed, unknown error occured - ios

The following error occurred when I tried to run a project on my iOS device. Running it on a simulator works fine.
The other weird thing is that I am able to run my other projects on my device, only this particular project that is giving me this error.
I tried all the solutions I'm able to find:
Cleaning the project, deleting derived data
Restarting Xcode, my Mac, and my iOS device
Deselect 'Automatically manage signing' in the testing Target.
I couldn't delete the app from my device and re-install it because it wasn't installed on my device before.
Any help would mean alot to me! I am using Xcode 8.1 with Swift 3.0, running on a iOS 10.1.1 device.

Close your Xcode completely from currently running on Dock
Unplug your iDevices cable at your Mac and plug again.
Open Xcode Again.
Clean,Build and Wait for indexing the device
Delete the previous app you install on your iDevice
Then install
If you have free Developer ID, make sure you got the Internet access
right on your iDevices.
Else,
Check your provision profile or certificates of your app that it's still available or not [Expire or not].
If expired, please create again.
Install those latest provision profile at your Xcode Preferences/Account/Detail/
Make sure Signing "Debug" and "Release" aren't empty
Close the Xcode(Completely quit from Dock) after you completed those steps
Open the Xcode again and do Clean,Build and Install
Hope this help.
Other alternative way,
Remove the app on the device and re-install
Change build version no and install again

Clean your the project and reattach your device

Do a pod update if you are using CocoaPods. This error can occur due to one of the pod libraries, device logs can be checked for the name of the library.

I get this error only on the second compile for device targets, and I've found that if I just modify one critical source code file by adding just an empty line, the error goes away and Xcode will compile again. The other way is to target a second device which isn't always convenient.
A way around this confusion is to add a an Xcode Run Script that basically does this for you.
Force Xcode 9 to recompile after a build seems to be file dependent also
touch ${SRCROOT}/MyProject/MySourceFile.swift exit $?
With the above script my issues went away, and I never saw the Xcode Alert again. This bug has been in several iterations of Xcode now.

I have the same problem too, and also tried all the solution like you. unfortunately, not solve this problem, but I copied my project to another path, the copied one can build on my phone successfully, hope this can help you.

It can happen if you have debugged the same app(bundle identifier) with more than one Apple Ids. Remove all accounts from Xcode and sign in to the one which you're currently working with.

Restart your Xcode & Uninstall your app.
Build & Clean your Project, now it working good.
this works for me
above is not working please Restart your system

This error message occurred when I was building on an iPhone 5 and an iPhone 6 Plus with Xcode 10. Build in iPhone 5s Simulator gave a different error: "App could not be installed at this time…/Notification Extension: No such file or directory"
Problem was resolved by check marking Target Membership in my Notification Extension's source file.

Related

Xcode 14 Beta - Build Issues with LLDB

I am having issues when building any app with an iPhone 11 Pro or iPad Pro as the physical device destination. A new instance of a standard template app with Hello World takes moments to build and install on the phone, but then the app freezes on a black screen. Console reports the following.
warning: libobjc.A.dylib is being read from process memory. This indicates that LLDB could not find the on-disk shared cache for this device. This will likely reduce debugging performance.
Interestingly, if I stop the build in Xcode, which quits the app on the device, then manually launch the app on the device, everything works as expected but no logging of course. Reverting back to Xcode 13.4, the same issue occurs suggesting its an iOS 16 beta issue?
Further testing suggests this is an issue with the debugger. If I allow Xcode to build and run an app to one of my devices, it will launch and then freeze on a black screen. After a few minutes the app progresses to its main ContentView and the console appears to then function as normal.
Any thoughts? Thanks.
To those who bump into this later (or future-me) - I had the same issue.
Entirely removing the Device Support folder and re-opening Xcode forces it to recreate the device support files.
tl;dr
rm -r ~/Library/Developer/Xcode/iOS\ DeviceSupport
And then re-open Xcode.
More context:
lldb uses the gdb-remote protocol for reading memory from a device. This has the benefit of being a widely supported protocol, but it is not blazingly fast. So lldb will work much better if it has copies of the binaries that get loaded into your program on the local host where it can inspect them directly.
Xcode is the one that makes that happen. When you plug in a device and start up Xcode, if the OS is one Xcode hasn't seen before, it copies the system binaries over in one gulp and puts them in ~/Library/Developer/Xcode/{DeviceType} DeviceSupport/SystemVersion. If this process fails for some reason, then lldb will have to fall back to reading symbol information from the device, which is slow - that's what the warning is warning about.
If you delete the current version of the DeviceSupport directory, the next time you try to debug, Xcode will copy the binaries over again. If the error you had was transitory, then that should fix the problem. If not, it would be good to file a report with Apple Feedback to figure out what's actually going wrong.
Just open Xcode, it will ask you to install some required additional components. That's it.
It happens after updating Xcode or Mac OS.
Updating xcode then reopening it did it for me.
Merging the current top-voted answer and the steps in the other question's solution worked for me only:
rm -r ~/Library/Developer/Xcode/iOS\ DeviceSupport
Open the Xcode project/workspace with your device connected
Wait until the “Fetching debug symbols” process finished
Close the Xcode
Reopen the Xcode again and try to Build and Run on your device
You are using Connect via Network. Uncheck it and use a Cable. Looks like some recent Issue in iOS 16
I had this issue while using flutter and iPhone. I fixed it by just running flutter clean and then flutter pub get in the terminal and worked. Incase any are having the issue while using flutter.
If you are using 2 xcode apps try deleting 1 old one might fix it

Invalid Device State - Xcode/iOS Simulator error

Problem: I cannot simulate an Apple watch interface. Whenever I try and test my Apple watch app on the iPhone 6 simulator, Xcode successfully finishes and builds the app, attempts at opening simulator and fails with an error message which reads 'Invalid Device State'.
I believe simulator has a watch simulator that opens along with the compatible iPhone simulator models that can communicate with Apple watch (example: iPhone 6) Although I have yet to see it work. I have built a universal interface for iPad and iPhone and another for the watch, so it's not a matter of the app being for the wrong device. Whenever I test on my actual iPhone I can test the universal interface successfully.
I'm using Xcode 6.2 on iMac OS X 10.10.3
I have tried restarting Xcode/Computer. I can't seem to find any other mention of 'Invalid Device State' anywhere, hopefully due to it being an obvious thing to avoid/fix that I've overlooked. Any help would be appreciated.
Force Quit xCode and restart will resolve problem.
I had come across this issue after updating Xcode 6.4 to 7.1.
Below are fixes for this :
Clean project (cmd+shift+k) as well as clean build folder
(cmd+shift+k+option)
Quit simulator and run again
Quit Xcode and Simulator and run again
Restart your Mac.
Solution 3 worked for me!
I had the same issue. Generally it is because you just update Xcode or change its name in the Applications folder.
If you just restart your computer it will work correctly.
Hope it helps !
I observed this happening when more than one Xcode app installed.
To fix this,
Launch Xcode and click preference..,
Go to "Location" Tab, Select correct options from "Command Line Tools" dropdown
Quit Xcode and relaunch it.
Run your app.
First of all, just clean the project.
Quit your project.
Quit your Xcode.
Restart Xcode.
This happens to me when I have two different Xcode versions running at the same time. Hopefully this helps you.
No need to quit, restart or even re-install. Switch to another iOS Simulator device (6s if you were using 6s plus) and voila!
Nothing worked for me on XCode 7.3.1.
Had to reinstall it to make the simulator work.
Go to applications folder. Drag drop XCode to Dustbin.
Empty dustbin contents.
Go to App Store and install XCode.
Run XCode. The simulator should work now.
I have Xcode 7.3 and Xcode 8.0 Installed.
If a am working with Xcode7.3 and opens Xcode8.0 to get some code from Xcode8.0 project.
When i run my application on Xcode7.3 So it will give me same error.
Solution is simple ForceQuit or Quit all Xcode's and open the required one.
In my case, the simulator would show an indefinite black screen whether attempting to run a project, or running the simulator directly (which should bring you to the simulated home screen). This would happen even on a newly created simulated device.
After the existing suggestions failed, the following worked for me:
Delete the Simulator
Delete XCode
Delete the Developer folder
Reinstall XCode from the app store. This requires attempting to run XCode again so that Mac OS will realize it's no longer installed.
Jus clean the project and restart Xcode. This happens to me when I have two diffent xcode versions running at the same time.
Robust fix is Just Quit your xcode and run again, hope so it will help you. This heck work for me.
On M1 Mac I've found more than 3 open simulators can cause this error. Quit the simulator app to fix this error.
I am pretty sure that in my case the simulator was corrupt after a failed language change.
Following this answer to reset the simulator worked.

An Unknown Error occurred in Xcode

I'm trying to test out my app on my ipad and when I decide to run it on my ipad, Xcode says that it's successfully built. On the top, it says that it's runnning the app, but nothing happens for 2-3 minutes. Finally, I get two screens popping up saying "An unknown error occurred." I have tried running other apps through Xcode on my ipad and they work fine. I also decided to exit Xcode and restart everything, but the problem still exists. Does anyone know what the problem is?
Not sure if this will be useful but
Xcode Version: 5.1.1
Ipad Version: 7.0.4
Mac OS X 10.9
I found one approach:
Before this approach make sure that you have all certificates and other documentation updated.
I have faced same issue, now I have a way to fix this. I am using iPhone 5 with OS version 9.1
First, delete the app from your device and then restart the xcode by force quit and then again open it. Now clean your project and run the project in your device. Now it will be run without any issue.
Close your simulator or unplug and plug back in your device, and re-select the device target.
In my case . I cleaned the product and rebuild it and it worked.
Sometime is you forget to unlock your device.

Xcode Developer Preview: Cannot Run on Device

When trying to run any project in an Xcode Developer Preview (Xcode 5 DP6 in my case), the app is not started and the following error message appears:
Could not launch "" - No such file or directory (/private/var/mobile/Applications/741F0826-E354-4E13-9CC3-0FB3A66E8798/.app)
The solution was very simple in my case, in Terminal just execute
sudo xcode-select -switch /Applications/Xcode5-DP6.app/Contents/Developer/
with the path for the currently used Xcode Developer Preview.
Do not forget to switch back when developing on the previous stable Xcode version again - especially when archiving for AppStore submit.
I faced the same problem, I did following things to sort out my problem:-
1) Changed "don't sign" and "iPhone distribution" to my valid developer provisioning profile in Xcode's build setting.
2) Quit Xcode.
3) Uninstalled App from device.
4) Unplugged device.
5) Plugged in device.
6) Ran Xcode
7) Built and Ran App.
Thats it :)
This has a very simple solution (works on every Xcode so it's not NDA thing):
Kill all Xcode running
Delete the app from device (if there is any), Restart your device and disconnect it (if was connected).
Open organiser in Xcode and check that device is connected and used for development, if not select "use for development"). Device should be on and connected.
Check the signatures are good.
Build& run.
This should work. Let me know if it doesn't.
I worked on this issue for about an hour, trying everything on every post I could find on SO, but nothing worked. I then compared my project settings to another project that did run on iOS and found the issue was MACOSX_DEPLOYMENT_TARGET was set to 10.7 on the iOS build. I share the same project for my iOS and OSX targets for each app I make, so it's easy to see how this happened. I deleted the setting at the project level, added it to the target level for each OSX target, stripped and built the iOS target and it finally ran! Not to say the other solutions are wrong here, there just could be multiple causes.

Application not automatically launching in device and getting error on xcode

I'm getting a weird bug on Xcode 4.5. When i tried to run my application on Ipad 2 from xcode with iOS 6, I'm getting this error.
I done the following methods to run the application, but no luck.
Cleaned the project and run
Restarted the device
Restarted xcode
I have a valid certificate in my machine and the application is installing on the device but it's not launching automatically. What could be the issue ?
Thanks in advance
That is really annoying. This error happens in a number of different situations. Sometimes restarting the Xcode, fixes the problem. If not, follow these steps:
Disconnect your device.
Delete the app from your device.
Quit Xcode (Do not just simply close the window, quit it)
Delete derived data folder (~/Library/Developer/Xcode/DerivedData/-gbrvhlvwmpiobxdujegtghggrffp - or something like that)
Now start Xcode once again, connect device and run the project. It should work fine.
from DhilipSiva blog

Resources