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

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.

Related

'Realm/Realm.h' file not found in iOS when Archiving

When Archiving the project for Enterprise Distribution I'm getting an error "'Realm/Realm.h' file not found" .
Screenshot:
Realm works fine both on simulator and devices when I run it. But the problem is when Archive the project.
thanks for your answers. my problem is solved. But I'm very sorry that, I can't remember now how I was able to fix it. Most probably I had to do a "pod update" and i didn't override any settings from pods.xcodeproj to my main app .xcodeproj, I used "$(inherited)" as cocoapods suggested in command line. Cheers.
See if framework search path is set correctly for release build.
Solved the same issue with these steps:
Clean project
Delete 'Derived Data'
Set a correct provisioning profile for Realm subproject (I'm not a fan of Cocoa pods)

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.

dyld: Library not loaded: #rpath/libswiftCore.dylib / Image not found

I am running my app from xcode to my iOS device and I get this and black screen on iOS device.
Console text:
dyld: Library not loaded: #rpath/libswiftCore.dylib
Referenced from: /private/var/mobile/Containers/Bundle/Application/10DB2FE8-EF09-4857-B4AC-0DB2E4419D6F/App-Name.app/App-Name
Reason: image not found
(lldb)
Try adding the following line to Runpath Search Paths of your target.
#executable_path/Frameworks
your_target -> Build Settings -> Linking -> Runpath Search Paths
I had this same issue. I ended up adding the framework in the following locations:
General > Embedded Binaries
General > Linked Frameworks and Libraries
Build Phases > Link Binaries with Libraries
The embedded binaries seemed to be the key for me.
For me helps adding #executable_path/Frameworks to the project Runpath Search Paths, not target.
your_project -> Build Settings -> Linking -> Runpath Search Paths
None of the other solutions helped me, but everything was fixed by deleting Xcode's Derived Data directory.
Oh yes. I've faced with that problem spending hours on solution.
You may try to set "Always Embed Swift Standard Libraries" to "Yes" under your Build Settings > Build Options
(don't forget to shift+cmd+K your project after)
I had to switch 'Embedded Content Contains Swift Code' to 'Yes' to get my Obj-C app to work after updating the Obj-C embedded framework with a Swift object.
In the Framework Target (not the app target), go to Build Settings > Build Options > Always Embed Standard Swift Libraries to YES.
This solved the issue for me!
I had this error in a command line project (Xcode 10.2 and macOS 10.14.3)
The solution was to update to macOS 10.14.4
Swift command line projects won’t run on macOS 10.14.3 and earlier unless you install the Swift 5 Runtime Support for Command Line Tools package. Without that package, Swift command line projects crash on launch with “dyld: Library not loaded” errors. (46824656)
From Swift 5 Release Notes for Xcode 10.2
In my case, This issue is coming in Objective-c project in which I am using a Swift framework (AirWatch SDK).
Solutions:
I have resolved this issue with Xcode 9.3 and 11.0.1 iOS as mentioned bellow steps :
Drag and drop your swift framework in your project and move in default Framework folder of your project.
Then add them as Embedded binaries as shown in screenshot.
Change your framework status from Required to Optional as shown in screenshot. (Build Phases > Link Binary with Library)
Set Always Embed Swift Standard Libraries to Yes in your build settings.
Set Subpath and select destination as Framework for your added framework in Build Phases> Embed frameworks
as shown in screenshot.
Hope it will help someone.
I have faced the same issue, setting the right code sign identity solved the problem(Build settings->Code Signing Identity).
As per Apple technical questions "All Enterprise and standard iOS developer certificates that are created after iOS 8 was released have the new Team ID field in the proper place to allow Swift language apps to run"
I fixed by deleting all from Xcode Derived Data directory:
~/Library/Developer/Xcode/DerivedData
Good luck all!
This error message can also occur when using a framework build in a different Swift version then the one currently being used, e.g. if you upgrade Xcode.
I had the same error message, that is how I solved it :
The issue came from the certificates generated automatically by Xcode. I had to revoke these certificates dans generate them back from developer.apple.com
The solution is then :
- Go to developer.apple.com / certificates --> Revoke certificates
OR go in Xcode > preferences > accounts > View details > select Sigining identities > clic setting whell > revoke
- Got to developper.apple.com and follow instructions to generate new certificates
- In Xcode in my project : go to Code Signing Identity and sign both Debug lines with the generated certificate
- Both release lines are set to "iOS Developer"
- Then project > clean
- Build and run on device
#Saikiran's answered worked.
My certificates were generated before iOS 8 was released. I revoked all my certificates and regenerated all provisioning profiles and it solved my problems immediately.
I don't have enough reputation to vote up #Saikiran's answer, but that definitely helped solving the problem.
For me has worked set the option
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES
to YES in Project -> Build Settings -> Build Options
(Namirial framework through Cocoapods)
None of the above solutions worked for me. I changed the iPhone Developer Certificate trust settings in Keychain. It should be Always Trust. Change it to Use System Defaults. Double click the certificate in Keychain to open the option screen
Discovered that from this blog
I had the same error message, this is how I solved it :
This is happening because i changed bundle identifier, so i just put old bundle id and it started to work again
I already had the Runpath Search Paths set correctly, but it still didn't work. #Justin Domnitz's answer put me on the right track: Setting "Always Embed Swift Standard Libraries" to Yes in my target's build settings did the trick for me.
Seems this issue was caused by the inclusion of Swift file into objective-c custom framework. Also unsure if related but my app target was built in objective-c as well. Also building to simulator in debug. Haven't verified for release or archive build yet.
Additionally Runpath Search Settings for the project target were set to "#executable_path/Frameworks", within the target settings for the framework they were set to: "#executable_path/Frameworks" and "#loader_path/Frameworks".
After having tried rebuilding custom framework and reattaching to app target, clearing derived data folder and a couple other suggestions, what ultimately worked for me was changing the build setting within Project target for the custom framework project (not app target): "Always Embed Swift Standard Libraries" to "YES". It appeared not to matter what the setting for the app target was set to. I verified this by resetting the simulator and rebuilding. This is similar to Daniele Ceglia's answer but I wasn't able to add a comment and wanted to provide more clarity.
For me Cleaning the project solve the issue!
I got such issue, too
All other ways could not help me,
so I have done it on stupid way
created new project and pod install from scratch
and after confirmed it is working correctly, I copied all class files and storyboard files, at last done!
I think it is the last way for it, maybe could help you
I had a similar problem in an Objective-C project where I started to include Swift files.
In my case, I created two targets in the main project, and I added a Swift empty file, that creates a bridging header file and some configurations, but I only marked it as a member of one target. The first target works properly, but the second not, and I noticed that the differences in build settings were this setting:
Runpath Search Paths -> $(inherited) and #executable_path/Frameworks
And I also needed to reference Objective-C Bridging Header to the file that was created before:
Objective-C Bridging Header -> pathTo/Target-Bridging-Header.h
After adding this two settings, the second target started to work properly.
Try cleaning the build folder, I was having the same problem and I solved it this way:
Product -> Clean Build Folder
For Me restart simulator solved this problem.
I tried a bunch of the cases above and it didn't seem to solve my issue. I use git and cocoapods for a project, and the error went away as soon as I made a new commit.
I had this problem before in iPod touch iOS 9.3. And I used all the methods mentioned in this post, but none of them worked.
I checked my project setting. And in the other link flag, I found I added -Wl,-sectcreate,__RESTRICT,__restrict,/dev/null.
This flag prevents dyld insert in the jailbroken phone. When I delete this flag, the app can be launched again. I am not sure why it worked. Because in iPhone se iOS 10 I don't have to delete this line. But it did work in iPod touch iOS 9.3. So check it if you have the same situation like me.
Please check the *.framework If there is a _CodeSignature signature framework directory.
If there is no _CodeSignature folder,
Navigate to the Build Phases ,click + to add New Copy File Phase to create Copy Files.
after that, reference *.framework and choose Code Sign On Copy

PhoneGap Xcode Missing Header files on Build 'Cordova/CDVViewController.h' file not found

I am using PhoneGap 2.2.0 and XCode 4.5.2.
I can test my programs in the simulators, and I can put them on my devices to test them.
But I simply cannot build for distribution. It always fails with the following error:
my-projevt-path/Classes/AppDelegate.h:30:9: 'Cordova/CDVViewController.h' file not found
I've seen this problem around the web and still can't make it work, given whatever solutions have been posted.
I've changed things in Build Settings, I've reinstalled PhoneGap, I've run new lines in terminal, I've done my app over starting a new PhoneGap project from scratch, I've checked preferences in the build location in Xcode... I can't figure this out AT ALL.
Please, can anyone help? I've been working on this for days.
Thanks!
Problems in Xcode
If you have compilation problems related to missing headers, the build products should build into the same build directory. You may need to set the preference "Xcode Preferences -> Locations -> Derived Data -> Advanced…" to "Unique". This is the default setting for Xcode on a fresh new install, if you upgraded from older versions of Xcode, you might have a legacy preference in there that you need to update.
Found the answer!!!
Yes I am getting the same problem yeah and some help could be great.....
I followed all the instructions even with the ./update_cordova_subproject path as well it does not work. Also I solved the locking problem but I could not find the solution to this problem
The answer, in my case, had seemingly nothing to do with the error message that was being sent. Missing header files? That didn't seem to be the issue. Or, at least, not the direct cause of the issue.
This was an issue with my provisioning/certificates being somehow not right. I had re-created them several times, but it continued to be an issue.
I sent the job to another developer, who opened it on his machine, revoked my certificates and created new ones, and built it without changing anything else. He forwarded me the certificate, the provisioning, and an archive of the job. I opened the archive in xCode and validated it and uploaded it. And it was fine.
If you have got this problem, be certain your certificate/provisioning is set up right. I thought mine was, but apparently it wasn't? The "Apple Process" is definitely weird, and when certificates / profiles gets messed up, problems arise.
I was having the same problem and just solved it! First of the problem may very well be because of your distribution provisioning files... but when you look at the Project Navigator in xCode at the top level you have your Project and inside you have the CordovaLib.xcodeproj click on this file and you will see the iOS Deployment target. Make sure the proper IOS version is selected there. This is 1/2.
2) Then you need to duplicate the Release configuration and rename it Distribution. While the CordovaLib.xcodeproj is selected make a build and then build the actual project. This worked smoothly for me.
Add this line to your Build Settings -> Header Search Paths:
$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include
Don't replace the existing line that looks similar, that is still needed to be backwards compatible with Xcode 7 and Xcode 6.4.

armv6 and armv7

I've got an app that I created that I'm trying to test on an older iphone 3g. I've used this phone many times for testing but this new app for some reason will not accept the build.
I've done some searching and found that I need to charge the architecture from "armv7" to "armv6", I did this in both the project and target. After doing that I get the following error when trying to build to the device (construction is the name of the app)
Could not launch "construction"
No such file or directory (/Users/Matthew/Library/Developer/Xcode/DerivedData/Construction-cqtujdbjhpvbkrehtfzwvuhvxdrs/Build/Products/Debug-iphoneos/Construction.app/Construction)
But I can build in the simulator at it works fine... any idea?
thank you so much - clearing UIRequiredDeviceCapabilities in Info.plist would have never appeared to me.
None of these solutions worked for me. I'm using XCode 4.5 and ML. What I ended up doing (and still need to test thoroughly), was to re-create my project, started clean and then moved all sources and libraries to the new project and chose my provisioning profile for this new project. In the copy, I also manually copied the contents of the old Info.plist file and pasted them onto the newly Info.plist replacing them all.
In my case, I'm using CorePlot and that library needs armv7 (according to linker), so I can't just go armv6.
What I'm trying to figure out is when (cheap) XCode changed some settings to not run as a debugger on the device. I'm guessing something in the 'project.pbxproj' file. Otherwise I can't explain why the newly created project works and the old one doesn't.
I know this solution might not work for everyone, as in my case, as would lose all svn changes.
I'll post any progress on this.
My next step is to add CorePlot and let the project build it and not use the prebuilt one.
None of these worked for me either. But this DID work...
DO THE USUAL THINGS:
I cleared the build directory (cmd-k),
cleared the DerivedData (see prefs|Locations),
deleted the app from my iPhone 5,
unplugged the iPhone, and
restarted Xcode.
AND LASTLY DO THIS:
Open Xcode Organizer. Click on Devices | (your device name) | Applications. And finally, delete your application from here (aka. delete the app from your device, AGAIN).
Build and run...
Sorry I answered my own question! I figure I should leave this up in case anyone else has the same problem... I didn't update the plist setting to armv6 before... I did have to delete the armv7 in the plist to make it work

Resources