12

When I'm running the application on device aftercleaning, removing derived data, first time it runs without any issues. Second time when I'm trying to run, it say's "A signed resource has been added modified or deleted."

On the simulator app run's without problem.

I think it's because of extensions, I have editing, share and today extensions, when I'm deleting this extensions, then I can run second time without this message.

The problem has been since from xcode 6 beta 5.

Maybe issue related to provisioning profiles and signing ? I has created different provisioning profiles for each extension target.

So my question is, how can I fix this ? How can I run on the device second time without cleaning project?

hsafarya
  • 993
  • 9
  • 21
  • When removing my extension targets, there is no such a problem. – hsafarya Sep 06 '14 at 12:03
  • When removed all extension targets that contains swift code it's started working normally. I think it's a bug in xcode, for now if we have extension with swift code, don't know why, but second time run gives "A signed resource has been added modified or deleted." error. – hsafarya Sep 07 '14 at 06:04

3 Answers3

21

It is still not fixed in XCode 6 RTM. But I found an easy walk around. Simply delete the ShareExtension.appex folder under your build. Then rebuild again. You don't need to clean project, so rebuild is quite fast.

A actually alias the command to do the cleaning

rm -rf ~/Library/Developer/Xcode/DerivedData/<your_app>-*/Build/Products/Debug-iphoneos/ShareExtension.appex/
Cloud Xu
  • 2,837
  • 2
  • 13
  • 14
6

I used a slight modification of Cloud Xu's script to delete both the .appex and .appex.dSYM

rm -rf ~/Library/Developer/Xcode/DerivedData/YourAppName-*/Build/Products/Debug-iphoneos/com.yourcompany.Name.extension.*

You can put this in your scheme so that it executes with every build:

Edit scheme... > Expand the Run mode in the sidebar > Pre-actions > Click '+' > New Run Script Action.

dmzza
  • 2,299
  • 1
  • 18
  • 33
5

Edit: There is an another workaround: for each extension target containing .swift file, add build pre-action in project running scheme configuration:

touch "${PROJECT_DIR}/SOME SWIFT FILE IN EXTENSION.SWIFT"

So I've found a workaround for this issue. For now we can't have swift code in extensions. As mentioned in the comment

When removed all extension targets that contains swift code it's started working normally. I think it's a bug in xcode, for now if we have extension with swift code, don't know why, but second time run gives "A signed resource has been added modified or deleted." error.

hsafarya
  • 993
  • 9
  • 21
  • 1
    This solved it for me. I had a today extension with multiple swift files in it. I did have to add the extension folder name after the PROJECT_DIR though. – MattDice Jan 01 '15 at 16:19
  • 1
    Works perfectly for Obj-C extensions as well – hashier Mar 04 '15 at 11:46
  • 1
    Thank you! This works for Xcode 6.2 with an ObjC extension. Had to add a run script to my extension target. I was usually not getting the error in the title. The app would just not run unless I cleaned, and Xcode would say "Finished running." – Eric Hedstrom Apr 02 '15 at 19:19