App Installation failed. No code signature found
Asked Answered
F

9

22

I recently upgraded to Xcode 10 and began the process of updating our app to switch 4.2 After a day or so of rebuilding 3rd party frameworks and adding in workarounds to various issues, I was able to run our app on the new simulators.

However, when I tried running on my personal phone (running iOS 12.0 GM) I ran into an error when installing the app as described in the title.

I know that there are a lot of already answered questions regarding this topic on SO & the Internet, however I was unable to get any of these to work.

It's been blocking me for around a day & a half now so I was wondering if anyone had any insight into how this could be mitigated.

Here are the steps I've take so far that have not worked (perhaps they will work for others in the future!):

  1. Clearing derived data
  2. Deleting and re-downloading all provisioning profiles on my computer
  3. Cleaning the build directory (cmd + k & cmd + shft + k)
  4. Deleting the original app from my phone
  5. Restarting Xcode (Version 10.0 (10A254a) [the GM])
  6. Restarting my Mac (Macbook Pro 2018 running macOS High Sierra)
  7. Restarting my device (iPhone X running iOS 12.0 GM)
  8. Many various combinations of the above, including all at once
  9. Re-generating provisioning profiles for the app on developer.apple.com (we use manual signing)
  10. Deleting and recreating provisioning profiles for the app on developer.apple.com
  11. Sacrificed a goat to Tim Cook
  12. Ensuring the signing certificate matches the provisioning profile
  13. Deleting the old version of Xcode from my computer & insuring command line tools are on the xcode 10.0 gm version
  14. Deleting & reinstalling Xcode 10.0 GM
  15. Ensuring all copied frameworks have code sign on copy checked
  16. Rebuilding all frameworks via Carthage using the swift 4.2 compiler (remember, it all works on the simulator).
  17. Ensured code signing required is set to YES in the SDKSettings.plist
  18. deleted all old signing certificates on my computer
  19. Deleted & recreated certificates on developer.apple.com
  20. Removed & re-added my device to developer.apple.com
  21. Changed code signing from manual to automatic
  22. Ensured that signing certificates are Developer and not Distribution

Any help would be greatly appreciated :)

Update: I tried redownloading and rebuilding from the ground up on a fresh machine, and the same issue occurs. Interestingly I can archive and validate the app just fine.

Also tried signing an empty project with the same bundle ID and it worked fine. So the issue is either in our 3rd party frameworks or some weird setting that got enabled while transitioning from Xcode 9.4. Going to start removing 3rd party frameworks one by one until I can get this to compile.

Update 2: Still no luck. Tried clearing out most frameworks and nothing. Here are the device logs, wondering if Skipping a profile because of error 0xe8008012 has something to do with it:

https://gist.github.com/joshuawright11/6889ce1a0872262df77f97d63830baa5

Update 3: So I was able to get it to install, by commenting out the carthage copy-frameworks script in the build phases (and cleaning/nuking derived data after doing so). Of course this means that it crashes on boot since it's missing those frameworks, but it does mean the issue is either with carthage or one of the linked carthage frameworks. Not our signing certs, provisioning profiles, or codebase. Going to try removing those frameworks one by one and I'll update here.

Final Update Figured it out finally. The solution turned out to be pretty niche (see below) but hopefully this question serves as a compilation of every solution related to this issue across the internet haha.

Fanfaronade answered 17/9, 2018 at 18:21 Comment(13)
You can create new project, set there bundle id of your broken project and configure yours signing identities, then try to run it on device. If it will run - problem most probably in frameworks. Btw, have you tried to clone your repository on another machine?Caritta
good ideas, I will try that and report back in a fewFanfaronade
@Caritta so creating the new project and running it worked fine, so the issue must be in one of the frameworks, thanks for the tip! I'm curious how you would go about debugging the frameworks and seeing which one the problem might be in? I rebuilt everything in carthage using swift 4.2 compiler and things still don't seem to work. Currently attempting install on a new machine.Fanfaronade
make sure to setup properly .gitignore fileCaritta
its set up properly for sureFanfaronade
@Caritta any idea on how I could see which framework might be causing this issue?Fanfaronade
First of all, I would try to launch your app on another machine - it is the easiest way to find out where is the problem (in the project itself or your environment). It will save you so much time. If it will run on another machine, then the problem in the environment. In this case, check your dependency manager (Carthage) - clean its caches, update Carthage, remove everything except of Cartfile in your project and do carthage update. If the problem in the project itself - you need to review your frameworks. If just reviewing frameworks brings no luck- remove them and try to run the projectCaritta
I have the same problem in a React Native app with Xcode 9.2 after adding lottie-react-native library: github.com/react-community/lottie-react-native If I create a new react-native app with same version for React and React Native and I add lottie-react-native using the same steps, then I can run it on real iPhone.Verruca
I tried to run the app on 2 different machines with the same error.Verruca
I also tried launching on a separate machine and no dice :( must be a project/frameworks issueFanfaronade
@Josh, I found what was causing the issue for me, but still not sure why the error. I had this Run Script in Build Phases after Embedded Frameworks: ikennd.ac/blog/2015/02/… If I remove that script it installs on the device.Verruca
for those who but don't use carthage: you may set correct Developer for both target and project, and choose the correct provision in Xcode10Annalisaannalise
Did you make sure that it was a slate gray goat?Opsis
F
8

Figured it out:

I ran into this issue with carthage: https://github.com/Carthage/Carthage/issues/2472 and used their suggested solution of setting EXPANDED_CODE_SIGN_IDENTITY='' when I was transferring stuff over to xcode 10.

Evidently this line is what causing carthage to hurt itself when copying frameworks, causing the error. I downloaded the most recent version of carthage to fix the issue, and then removed the EXPANDED_CODE_SIGN_IDENTITY='' line and everything worked. What a waste of time.

Fanfaronade answered 26/9, 2018 at 18:46 Comment(0)
V
6

Not sure if this is also your case, but I also encountered this error recently while trying to run a React Native app on iPhone. It started happening after I integrated Lottie library for React Native

The issue was caused by this Run Script added in Build Phases: http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/. The script failed to extract architectures from Lottie.framework giving a "input file (.../Lottie.framework/Lottie) must be a fat file when the -extract option is specified

To fix this I added a verification in the script to skip non-fat files:

# ...
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"

if lipo -info "$FRAMEWORK_EXECUTABLE_PATH" | grep -iq "Non-fat file"
then
echo "This is a non-fat file, skipping"
continue
fi

EXTRACTED_ARCHS=()
# ...
Verruca answered 19/9, 2018 at 12:42 Comment(3)
Thanks for replying @mihai1990; we don't use react native however I suspect that it does have something to do with the 3rd party libs we've been using. Ended up taking all day to revert everything back to Xcode 9.4 and am using that for now; over the weekend ill dig deeper into the Xcode 10 builds and see if there are any build scripts in 3rd party libs hurting themselves. I'll post results here.Fanfaronade
@Fanfaronade Did you have results since then?Biomass
yeah, @LouisCAD it turned out to be a custom carthage build script I was using, see the selected answer belowFanfaronade
S
5

For me it was my Carthage frameworks code signs. I fixed it by setting them like this picture:

enter image description here

Sly answered 25/3, 2020 at 13:6 Comment(0)
T
3

I have had the same problem with xcode 10.0 (10A255).

Invalid Signature - A sealed resource is missing or invalid. The file at path [xxxx.app/xxxxx] is not properly signed.

xcode 9.4.1 (9F2000) was always able to submit the app without problems.

I could fix the problem deleting all of the supporting files (txt,json,rtf,html,ttf, etc.) and then, adding them again.

I suggest you to submit a build without the files. If this works you can add them again step by step

Thou answered 20/9, 2018 at 12:45 Comment(1)
Hmm, good idea but no dice. Removed all fonts & assets and got the same error.Fanfaronade
C
2

In my case I had both an invalid iPhoneXS provision and bundle identifier conflict. My project was attempted after an Xcode upgrade and said new phone attached. After doing the above steps (completely recreated key chain and profiles, deleted persistent folder etc...).

On Target Project Settings:

  1. Set bundle identifier from com.proj.app to anything else, ex: com.proj.app2
  2. Change Product name from Product to Product123

I'm pretty sure only the bundle identifier conflict blocked the normal auto entry of my device into the provisioned devices.

  1. Change back identifiers to normal (if desired)
Collaborate answered 9/10, 2018 at 2:22 Comment(0)
H
1

I've tried everything in this thread but nothing worked. So I just reinstalled Xcode and suddenly everything works again.

Hypertonic answered 29/12, 2019 at 16:39 Comment(0)
M
1

If anyone is still interested: I just found another instance where the new Xcode 14 will throw this error. My app was in Dev, only have links to the icons; I did some disk cleanup, moved the icons to a new folder. When I tried to rebuild/run I got this error.

Multifold answered 30/12, 2022 at 16:58 Comment(0)
V
0

In the build phases/Carthage of the project target put the carthage command like this:

EXPANDED_CODE_SIGN_IDENTITY='' carthage copy-frameworks

This is only a temporal solution while the get environments var issue is solved.

Vasta answered 15/2, 2019 at 10:4 Comment(0)
M
0

Abstract:

Problem solved, by waiting for one night and literally do nothing.

Detail:

App Installation failed. No code signature found tortured me for a whole afternoon yesterday,

I had every approach tried: "build settings, framework settings, cache dirs, sign settings, cleanings, re-initialization, re-git-clone, cocopods clean, etc."

and they turned out to be totally invalid/not-working.

So, I left work and go home. After a nice sleep, everything works in the morning.

I guess, my problem was related to the abnormal latency in developer Bundle-identifier registration.

But atlast, things still breaks and works with no clear reason.

-- update --

I encountered this problem again in another project.

Quickly fixed it by including all imported frameworks as targets of the current project, rather than importing external framework as sub-project

Maximin answered 14/1, 2021 at 6:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.