App Installation failed - The application does not have a valid signature on build

612 Views Asked by At

I am getting following error on build:

The application does not have a valid signature

After playing with it a little while I have found following:

  • error appears only after building app with no changes - that is, if I encounter crash during development and try to build again it will show error
  • in order to build again I need to add space or new line and after that it will work
  • it will work after full clean -> build. This is not really acceptable since project is huge (over 300 files) and build time is around 20 mins with cocoapods and what not.
  • Happens on all kind of iOS, but only on device. On simulator it is working correctly. Tried from 8.0 to 10.2 iOS versions.
  • Clean build will fix for only one time, after that if I try to build the same code again, same error occurs.

Other relevant information:

  • Xcode 8.2 ( happened on 8.0 and 8.1 as well)
  • Language is Swift 3
  • MacOS is Sierra (10.12.1)
  • Certificates used for signing are enterprise

Already tried all proposed solutions online including SO (e.g. App installation failed) but no luck.

My question is: How can I resolve this issue so I am able to build without changing code each time I want to build? I assume that this has something to do with Build settings...

1

There are 1 best solutions below

10
On BEST ANSWER

It seems that this is a known issue with Xcode. I haven't experienced it with our project, so it may be related to CocoaPods, or something else that is specific to your project. I remembered seeing this problem on Apple's forums here.

Though more of a workaround than a solution, you can force the app to rebuild each time by adding a BuildDate.plist file, adding a build phase to throw the current date / time into the plist file. This change is enough to trigger enough of a rebuild so that the code signing bug doesn't affect you. And it should cause a recompile of anything time consuming.

This should save you and your team from having to make a simple change to the code when this happens.