42
votes

I've tried to install my app on several iOS devices. But this thing didn't let me to.

enter image description here

I want to know, what the problem is and how should I solve it.

11
Have you clean your build or uninstall app from device and install again ? - Ashish Thakkar
surely you need to have a look on app distribution - childrenOurFuture
@AshishThakkar yes, I've tried to - Robert Khaireev
have you restart your xcode as well ? - Ashish Thakkar
@AshishThakkar yep, didn't work - Robert Khaireev

11 Answers

78
votes

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)

Code Sign on Copy selected in every row

24
votes

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.

18
votes

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.

10
votes

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

enter image description here

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: enter image description here

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 enter image description here

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

2
votes

I also faced same issue. I tried all above solution none work from me.

Below stuff worked for me,

  1. Select Build settings
  2. Locate "Code Signing identity"
  3. select "IOS Developer" or any other correct option for all.

Then build and run.

1
votes

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.

0
votes

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

0
votes

Enabling "Automatically manage signing" solved the issue for me. (In the target settings, "General" tab, section "Signing")

0
votes

Restarting my device fixed the problem

-1
votes

1) Try to clean project 2) Try to relaunch XCode 3) Reset your mac

-4
votes

It is clear you do not have the developer and the distribution profile set for the devices you are trying to install the app.