Can't run app on device after upgrade to xcode 7 - ios

I updated my iphone 6 to ios 9 and I also updated Xcode to version 7.0. When I run my project on the simulator, the app works fine. When I try to run the app on my device the app crashes and I see this:
dyld`dyld_fatal_error:
-> 0x120049088 <+0>: brk #0x3
Originally I was using cocoapods and getting an error that said "Image not found" for each of my frameworks I had configured. I removed cocoapods and manually added all the frameworks but now I'm getting the error above. Any help would be appreciated.
Thanks

I had this issue. Clean, Xcode update, deletion of derived data - all didn't help.
What helped was based on this answer:
Go to "Build Phase" section of your target settings.
Click on the + button in the top left and select "New Copy Files Phase".
Under the Copy File Phase, select the "Destination" dropdown and select "Frameworks".
Drag and drop your framework from the project navigator into the "Name" section.

Sometimes you need to use Clean & Build (Cmd+Shift+K), most of the times it helps to eliminate weird problems like this one. If this doesn't help - try cleaning ~/Library/Developer/Xcode/DerivedData.

Related

Could not build module 'Foundation', 'UIKit, 'CoreFoundation' on Xcode 9.3 and Xcode 9.4 [duplicate]

Suddenly it stops building application in device. In simulator its working but when I connect the device and try to run it in device it gives me an error:
Could not build module UIKit
I tries a lot but couldn't solve it.
A full clean + deleting the derived data worked for me.
Be sure to fix any code that may be broken because UIKit cannot be installed, before the clean and build.
So, for example, if you are trying to reference UICollectionViewController, and need UIKit to reference it, comment out the code that is using UICollectionViewController, comment out the import for UIKit.
Then clean, build. Now uncomment import UIKIt, build. NOW uncomment UICollectionViewController code, build again.
Please don't make the same mistake like I did. In my case, I accidentally typed some words into Foundation framework file.
Something that might help would be to set the Derived Data location to "Relative" in XCode preferences, then Clean & Build
For some reason your UIKit.framework is corrupted, either copy a working UIKit.framework from somewhere else into
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks
Or reinstall Xcode the fix the issue.
I accidentally edited the Foundation framework file
so UIKit.framework got corrupted. The only solution is recover the original.
You have two ways to achieve the same:
Just reinstall Xcode. OR
copy the Framework from another machine with the same XCode version and paste into yours.
Location:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks
If you have two Xcode then uninstall both and again install Xcode. It worked for me.
If cleaning the project and deleting the 'derived data' doesn't work,
try to change the 'Deployment target' (at 'General' tab) from 7.0 to 7.1
Check whether the appropriate target is selected or not from the "active scheme selector". Selecting "Generic iOS Device" solved my problem.
Click to select simulator
Select "Generic iOS Device":
Make sure none of the files are edited in the UIKit framework located inside Xcode.
Cleaning Derived data worked for me
Check the tool chains installed and select the right xcode tool chain. In my case i changed it from Swift 4.0 to xcode 9.2 and it worked.
In my case, after cleaning the project, only restarting my Mac helps.
Cleaning the project and restart xCode worked for me.
I am also facing this issue for very long time and after trying all the suggestions given in the different portals, i came to know that the issue is with the device you want to run the application. Device have latest iOS and your Xcode is not supporting that iOS.
For example you have Xcode 7.2 and want to run the application on device which have iOS 9.2.1. So you only need to update your Xcode.
And one more thing Base Sdk in Build Settings is always greater or equal to the software version number on your development device.
Already tried all the solutions above. I still could not solve my problem. So I uninstall the Xcode and reinstall it. It worked magically.hope this helps.
Suppose you have changed or deleted anything in the UIKit framework, then shows this error.
If you are able to find that class or .h file to be changed or deleted, then replace that whole file content in that .h file from other system's Xcode (confirm that should be similar Xcode version).
For example, In UIView.h file - I have deleted a method and closed and opened the Xcode. Then I couldn't reverted that code.
I tried with delete derived data,delete application from project list but when i delete xcode and install new one its working so its best way just delete xcode and install new xcode.
This error happened to me when I accidentally modified the uikit framework. Removing and re-adding the uikit framework in link binary with library, cleaning derived data and restarting xcode didn't work. I don't want to uninstall my xcode so I tried to copy codes of the class that I might have modified from other pc with xcode that works fine and paste it to mine. It worked!
If your project builds for another target (e.g. it builds for simulator and NOT your device), then it's confirmed you accidentally edited one of the header files of the frameworks for that target. The affected framework is the one you are receiving compiling errors for.
It worked for me after remove all folders in DerivedData folder.
My Issue causing this same error was due to working in a workspace created by coco pods, somehow the link to the UiKit Framework had been lost from the original project.
To solve this i just reopened the xCode project not the workspace and re added the missing UIKit framework, saved the project and closed it, re opened my workspace for the project and the annoying nag messages caused by this were fixed. Hopefully this helps someone else.
I had this issue, and I set Device on Generic iOS Device, clean project, make build. Then I switched device to my real device and run project. The error does not appear.
Cleaning some unnecessary Xcode data using DevCleaner for Xcode app worked for me.
My error was a wrong version of command line tools - go to Preferences->Locations and change the command line tools version - quit xcode and try again.

iOS app testing. App installation failed. No code signature found [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I've tried to install my app on several iOS devices. But this thing didn't let me to.
I want to know, what the problem is and how should I solve it.
In my case, the problem was unsigned frameworks.
Xcode 11 or above:
Go to Build Phases, expand Embedded Frameworks and select all Code Sign on Copy checkboxes.
Xcode 10 or earlier:
Build Phases > Copy Files > Code Sign on Copy (select all checkboxes)
I had this problem, this is what I did to resolve it:
Run "clean" in Xcode
Close Xcode
Remove all data in ~/Library/Developer/Xcode/DerivedData
Remove all xcuserdata folders in your project (check in your xcodeproj and project.xcworkspace directories)
Only if you have Cocoapods in your project:
Run pod deintegrate.
Remove your .xcworkspace if it was created by CocoaPods.
Run pod install or pod update
Now you can open your fresh Xcode.
Hope this help you.
In my case the problem was created by adding a new cocoa touch framework.
If "code sign on copy" fails, then check if you are modifying the frameworks in a run script after the "Embed Frameworks" phase.
If you are, then move the Run script to a position before the "Embed Frameworks" phase.
In my case, I have created an unsigned IPA file and for this i had made some changes in SDKSetting.plist file (changed CODE_SIGNING_REQUIRED = NO) and it should be always YES if you are running application on the device.
To resolve this follow the below steps:
Steps to create unsigned IPA (Tested on Xcode 9.4.1)
Step 1: Open finder > Go to Folder.. as below screen
and then copy and past the below line:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.*.sdk/SDKSettings.plist
Open iPhoneOS.sdk as showing in below image:
Step 2:
Copy the SDKSettings plist in another folder because you can't make changes here:
Step 3: Make the change in duplicate
set CODE_SIGNING_REQUIRED to YES
Step 4: Now replace duplicate Plist with the original one (Both names must be the same).
This will also ask admin permission to change.
********************************OR**************************************
If you will update your Xcode then the problem will also disappear because updated xcode will come with default SDKSetting.plist
I also faced same issue.
I tried all above solution none work from me.
Below stuff worked for me,
Select Build settings
Locate "Code Signing identity"
select "IOS Developer" or any other correct option for all.
Then build and run.
Folks, My problem's Root cause was modifications that were done by iOSOpenDev installer. I did restore the original plist file that was backed up by the installer. that solved my problem
you need to look into the SDK directory to see if something funky has happened.
at least one more option to try.
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS<SDK version>.sdk/
example:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/
by default code signing must be turned on, if that is turned off then something funky happened. (for ref See Alok's answer below)
If nothing works. My recommendation would be to delete and reinstall Xcode as this error would not arise in the normal scenarios. So resetting Xcode can greatly reduce troubleshooting time.
1) Try to clean project
2) Try to relaunch XCode
3) Reset your mac
I have some issues during App upload to the Appstore then i Add Some Code
in Build Phase -> Run Script
done
I clean Build folder and remove t above code from Run Script
And Build again and run on my Iphone it work fine
You can remove the code of run script or
check the check box of ."Run script only when installing " then also it will work
Enabling "Automatically manage signing" solved the issue for me. (In the target settings, "General" tab, section "Signing")
Restarting my device fixed the problem
It is clear you do not have the developer and the distribution profile set for the devices you are trying to install the app.

Unable to run app in Simulator: An error was encountered while running (Domain = LaunchServicesError, Code = 0)

After successfully compiling the project in Xcode 6, I am unable to run it in the simulator with the above mentioned message. I did all the possible research, tried everything and still no advances.
I am not working with swift, neither I use widgets or extensions, so please do not suggest solutions caused by these as can be seen in similar questions.
If someone found a possible cause (or solution!!) other than these, please help. Thanks
"Reset Content and Settings" from iOS Simutalor menu options and launching simulator after Quitting solved my issue.
Cleaning the build folder resolved the issue for me.
(While holding down the Alt-key: Product > Clean build folder)
I tried every other solution listed here. Well, I ported my project from Swift 1.2 to Swift 2.0. The application was stuck even after a lot debugging and launch services error 0 was reported.
solution: It happens because of framework compilation.
App target -> Build Phases -> Embed Frameworks.
So mark copy only when installing on. Clean the project and run it!
This has now been resolved. The problem was caused by ShareKit library added by CocoaPods for compatibility reasons. After removing the library and all related code, the app successfully launched in simulator. I recommend checking the system log for more details on the issue as to me it pointed me in the right direction (stating the name of conflicting library).
In case anyone has this problem in combination with cocoa pods, these steps helped me to solve this error (after few hours):
run pod cache clean
from SRC_ROOT run rm -rf Pods (optionally rm Podfile.lock)
Click on the Simulator app, click Simulator -> Reset Content and Settings...
Go into Xcode, In the Menu bar click Product -> Clean (or click Shift + Command + K).This will to clean your Xcode project.
Create a new Terminal Shell (From menu bar click Shell -> New Window)
run rm -rf ~/Library/Developer/Xcode/DerivedData/
...then try to Build & Run your project.
Note:
SRC_ROOT can be found by entering the Navigator, clicking on the project, clicking on the project again from the project and targets list, going into Build Settings, scrolling all the way to the bottom to the User-Defined Section, and the SRC_ROOT will be labeled as PODS_ROOT. Take that and copy it verbatum into the Terminal and proceed with step 2 from the list above.
Hope it helps.
I get rid from the issue by the given steps for simulator
1. Way
Reset Content and Settings of Simulator.
Clean your project by Cmd+Shift+K.
Clear your Derived Data.
The last one which is more important change your Bundle Identifier by "com.yourcompanyname.projectname" like "com.facebook.Facebook"
2. Way
You can do only be the given line, it works for me
The last one which is more important change your Bundle Identifier by "com.yourcompanyname.projectname" like "com.facebook.Facebook"
Thanks and enjoy programming.
Might be related to this issue: "This app contains an app extension with an illegal bundle identifier" issue
I had to format the bundle identifiers for my app and extension as follows:
com.company.AppName
com.company.AppName.Extension
First "Reset Content and Settings"
If you didn't fill the build number and fill it and Run.
It's solved for me.
If you change the name of the supplied class InterfaceController set by default when you start a new project. This class is referenced in the Info.plist under the key RemoteInterfacePrincipalClass. In my case, I got the error mentioned by the OP until I fixed the name of the class in there (see screenshot).
If you are here after having issues doing an integration with WatchOS 2.0, go to - ~/Library/Logs/CoreSimulator/[Device UDID]/system.log and if says something like WatchKit 2 app has frameworks; that's not allowed. then follow the link below.
http://zyafa.me/blog/watchos-2-and-embedded-frameworks
Thanks for pointing this out #Miki and kudos to you. I had the same issue as you yesterday (and I added ShareKit 3.0.0 from CocoaPods to the app a few days ago). I suspected ShareKit giving me this problem, but now I can be confident of exactly which library is causing this. Here is what I found in my log (if it can benefit others):
Error Domain=LaunchServicesError Code=0 "The operation couldn’t be
completed. (LaunchServicesError error 0.)" UserInfo=0x7fa836097aa0
{Error=PackageInspectionFailed, ErrorDescription=Failed to load
Info.plist from bundle at path
/Users/{UserName}/Library/Developer/CoreSimulator/Devices/99FEB34E-6F00-4EFA-861A-A6985AFE96D8/data/Library/Caches/com.apple.mobile.installd.staging/temp.X7eead/extracted/{AppName}.app/Frameworks/LiveSDK.framework}
I'm adMob user and I solved enabling "Copy only when installing" in App target -> Build Phases -> Embed Frameworks.
Have the same problem after localizing my app. Especially Info.plist. Seems I had empty CFBundleShortVersionString in InfoPlist.strings, after fixing that the simulator started to work properly.
I got this issue by adding a folder reference named "Resources".
If I give it another name, then it runs !
There are a number of things that can cause this error. The best general answer is to search the console log for CoreSimulator, as the simulator logs the underlying problem when it displays this message.
If you have installed any libraries using CocoaPods while XCode was open, all you have to do is, Close XCode and remove the library from Pod file, run the command pod install it will uninstall that library. then install library again. Please make sure that XCode is always closed while installing and uninstalling libraries.
I hade exactly the same problem and it was ShareKit.
On the simulator I had "Error Domain=LaunchServicesError Code=0".
On the iPhone6 device I had "App installation failed Could not inspect the application package."
When I removed ShareKit it worked.
I had this problem when I added an Apple Watch target to my app, and accidentally removed the InterfaceController.m file. Adding back the file in the target fixed the problem.
There are different things that can cause this. Looking in the console may well give you a clue.
In my case - the issue was an extension built before I changed the name of the product. Xcode didn't clear the old one out, then got stressed at two extensions with the same bundle id.
(Deleting the build folder fixed my particular issue).
In my case the issue came from an icon set added with some images missing. Once I replaced the icon set with another one, and uninstalled the app in the simulator; I was able to run it again.
I removed all my pod files and replaced them all, seems the problem for me was the bolts framework was old, and causing this error. I did a clean & reset content and now it's all good.
Do not add the google maps framework to the embedded lib section this solved my build break.
I had this error in developing app for Apple Watch after adding in Info.plist: "App Transport Security Settings" and "Allow Arbitry Loads" = YES. (In WatchKit App, in WatchKit Extension is good!!)
Deleting this two rows, it keeps working.
For me, the problem occurs because I added my framework (GoogleMobileAds.framework in my case) to Embedded Binaries, not Linked Frameworks and Libraries.
For your information, AdMob instructs you to use Add Files to "Your Project" menu on Xcode, but I was too lazy to obey the instruction.
I had this problem when trying to run UI tests in a project containing AWS Cognito.
Here's how I resolved it.
Select the UI test target.
Click on the Build Phases section.
Click the plus to add a Copy Files phase
In the Copy Files phase, change the destination to Frameworks (see the last image)
Hit the plus below the Copy Files phase.
Select the framework for which you're receiving an error and hit the Add button (yours will probably not be the first item in your project hierarchy).
It should end up looking like this.
Repeat steps 5 and 6 for all frameworks giving you an error.
Run your tests.

Xcode 6 Interface Builder "cannot open compiled nibs" error, FiksuSDK

I have an app that runs great in Xcode 5, using CocoaPods.
When I open the app on Xcode 6 and hit build and run, I get four errors from the FiksuSDK about compiled nib files.
On the side, it states that I do not have permission to view it, but tapping on it shows the error: "The document "FMVerifyViewController.nib" could not be opened. Interface Builder cannot open compiled nibs." I don't directly call any of these nib files, however it's possible that the Facebook API does.
Screenshots attached.
I've tried removing the Pods directory, deleting derived data, updating pods and restarting Xcode. Nothing.
Any help would be really appreciated.
Screenshots:
Go to the "Build Settings" of your Project and set "Strip NIB Files" in "Interface Builder NIB Postprocessor - Options" to NO - worked quite well for me :)
This isn't a very good answer, but I had this same problem and in order to keep developing (until this gets figured out), I just removed those 4 nibs from the project. Just go to the project file, select the target you're building against, go to the "Build Phases" tab, and delete those 4 nibs from the "Copy Bundle Resources" section. Your project should build and run fine for the time being (I haven't encountered any negative effects to not having these nibs). By the way I think they're from the Fiksu SDK, not the Facebook SDK.
The error messages unfortunately are misleading because it's not a permissions problem and the nibs are valid. It appears that because they are provided as symlinks to the resource files, Xcode complains.
Fiksu just released a new version of their SDK where this issue is fixed. (look for version 4.3.1)"
Disclosure: I am a Fiksu Employee

"Base SDK Missing" after upgrading to Xcode 3.2.5

So I took the step upgrading to Xcode 3.2.5 (iPhone SDK 4.2) and now I cannot run to device. I always see this now in the dev environment:
In my current projects, when going to the project settings I can only set the Base SDK to iOS 4.2 but this doesn't change the "Base SDK Missing" problem. :/
I can however deploy to the simulator, and change which version I want the simulator to load as.
Does anyone know how to fix this?
If I create a new project I don't get this...
Thanks
I solved this problem, by doing this:
Project->Edit Project Settings->Build->Base SDK->Latest SDK (4.2)
Project->Edit Project Settings->Build->iOS Target Deployment->iOS 4.2
Project->Edit Active Target (myTarget)->Base SDK->Latest SDK (4.2)
Project->Edit Active Target (myTarget)->iOS Target Deployment->iOS 4.2
And, If you still have problems:
Click the box that says base SDK missing, and select:
Simulator -> Debug
That should do it.
You can double-click or right-click on your target and pull up it's Info. Click on the build tag and look for the setting for Base SDK. You probably want this set to Latest iOS, which is a new option and should prevent this from happening the next time you upgrade.
However, you might be better off doing this at the Project level, by selecting Project -> Edit Project Settings and following the steps above. You can also select the general tab under the project settings and set your Base SDK with the "Base SDK for all Configurations" drop down. That has the advantage of fixing a problem that sometimes crops up with your linked frameworks (if they are all in red in the sidebar, you have the problem).
I found that, with Xcode 3.2.5 after setting the Base SDK to Latest iOS in the Project and Target Build info settings, quitting and restarting Xcode automatically got rid of the "Base Missing SDK" message in the select widget.
Here's what you have to do:
Double click on the main project icon to open properties.
Under the General tab, set "Base SDK for all configurations" to "Latest iOS".
Under Build tab, set Base SDK to the same thing.
Repeat this step for all framework projects under your main project.
Finally, and this is the bit I was missing for an annoying week or so, double-click your TARGET (under "Targets") and perform the same steps.
Things should be back to normal - and since "Latest iOS" should hopefully keep you updated with each new SDK released, you won't have to go through all that again.
Finally - restart Xcode or otherwise cause the project file to be reloaded.
Unless you work with people who haven't upgraded yet and persist in submitting changed project files. Apply a similar penalty as you would for breaking a build until they get it. :-)
RESTarting is must folks .. if u won't restart your project (just close the project and then reopen it ) you will see the same thing " base sdk missing"... i also had the same trouble .. but restarting works..
I do not think you need to restart xCode, nor reopen your projects. Try this:
In the main project window, select Option-Cmd-E, choose build and "latest ios...".
Close the build window.
In the main project window, option-click the dropdown for Base SDK and you should see the latest build available.
Select that and you should be good to go.
Takes 5 seconds. I hope this helps..
This works fine for me. Just don't forget to restart Xcode.

Resources