The executable gets signed with invalid entitlements in Xcode

119,797

Solution 1

I found out the problem. The app I created on developer.apple.com does not include inter-app-audio. The project entitlements plist file on Xcode has inter-app-audio set to YES (by default). Once I changed the setting on my app configuration on developer.apple.com to enable the inter-app-audio. Then my app runs on my devices. I guess that is apple's new rule to make your app settings consistent on both developer.apple.com and your xcode project setting.

Solution 2

I grappled with this issue for an hour, and finally found a fix. Turned out the Development Team was different in ProjectTarget and ProjectTests.

Solution 3

Restarting Xcode was what worked for me

Solution 4

I was able to fix this by toggling on/off "Game Center" entitlement in Xcode 5 :-)

Solution 5

No solution worked for me until I've checked and set app Tests target to same provisioning profile as main app. Or if you are using automatic singing make sure you have same team selected in Tests target.

Share:
119,797
Emmy
Author by

Emmy

I am the founder and developer of AbiTalk. I started AbiTalk on 2011. I develop education apps for iOS and Andriod platform.

Updated on January 07, 2022

Comments

  • Emmy
    Emmy over 2 years

    I got this error with Xcode when I try to run the app on my device.

    The executable was signed with invalid entitlement

    It worked fine with old Xcode Anyone knows how to get rid of the error?

    enter image description here

  • Emmy
    Emmy over 10 years
    Thanks for your help. I found out the problem. The app I created on developer.apple.com does not include inter-app-audio. The project entitlements plist file on Xcode has inter-app-audio set to YES (by default). Once I changed the setting on my app configuration on developer.apple.com to enable the inter-app-audio. Then my app runs on my devices. I guess that is apple's new rule to make your app settings consistent on both developer.apple.com and your xcode project setting.
  • Gasper
    Gasper almost 10 years
    THANK YOU! You have no idea how frustrated I was this whole morning until I stumbled on your answer. Definitely fixed it for me.
  • Ferran Maylinch
    Ferran Maylinch over 9 years
    I toggled the Inter-App Audio capability to ON and then to OFF again, and this way the app worked... WT*?
  • hiroshi
    hiroshi over 9 years
    Also it solved "Invalid token" error response of APNs.
  • Rukshan
    Rukshan over 9 years
    adding game center entitlement and removing it back , worked for me as well. No idea why.
  • CaseyB
    CaseyB over 9 years
    Had to do the same for keychain sharing. I also had an app extension, I had to do it in both places to make it work.
  • Emastmagy MastMagy
    Emastmagy MastMagy over 9 years
    Thanks! Switching it to 'Automatic' did it for me
  • SafeFastExpressive
    SafeFastExpressive about 9 years
    Restarting/cleaning didn't work for me, but then I realized I hadn't added my new test phone to the Ad Hoc profile I was using to build with. I regenerated/downloaded a updated profile and the error went away. Note: you may get a "security" error after doing this, which means the device needs you to authorize the app, just tap the app on device for the "trust developer" alert to activate.
  • Keller
    Keller about 9 years
    Wow, unbelievable. Still a applicable fix, though for me it was the App Groups capability.
  • Jim Range
    Jim Range almost 9 years
    Strange that changing to automatic fixed it, but it worked for me. I had my provisioning profile set to com.mycompany.* and was getting this error. There were red FixMe under the Capabilities tab, but after fixing those issue I still received the invalid entitlements error. I then tried changing my provisioning profile from com.mycompany.* to automatic and it fixed the issue. I double checked that the bundleID is com.mycompany.blabla, so seems to be some sort of Xcode bug. I am using Xcode 6.3.2.
  • Van Du Tran
    Van Du Tran over 8 years
    Please be aware that Xcode will generate a provisioning profile for you, and invalidate your custom create provisioning profile.
  • Nik
    Nik over 8 years
    @VanDuTran no, it won't.
  • Enijar
    Enijar almost 8 years
    This was a fix for me too.
  • Andre Simon
    Andre Simon almost 8 years
    Same here! It's super weird. I guess you can toggle any capability to fix it.
  • Eric Soyke
    Eric Soyke almost 8 years
    So Xcode adopted the Microsoft universal fix. ;) For the record, this is still a problem and restarting is still the fix (I'm using v7.3.1).
  • jayellos
    jayellos over 7 years
    another +1, face this problem again, then google it, I landed here.
  • Matej Ukmar
    Matej Ukmar over 7 years
    After hours of checking every single detail ... this worked in XCode 8
  • Max
    Max about 7 years
    Does Anyone have a solid solution to this problem !!!!, All of these solution looks like some situational work arounds. Please help.
  • Max
    Max about 7 years
    Tried everything still facing the same problem !, any suggestions
  • Kavita
    Kavita over 6 years
    I guess there should be proper reasoning about why deleting derived data will solve the problem.
  • Marky
    Marky over 6 years
    Thanks so much! This just helped me out and saved a lot of time!
  • Tahmid Rahman
    Tahmid Rahman over 6 years
    Actually making project development team and project test development team same worked for me
  • Oren S
    Oren S about 6 years
    XCode 9.2: Turns out this "fix" is still maintained by Apple :) IOW, The question, and this answer, are as relevant as ever
  • bluebinary
    bluebinary about 6 years
    +1 This also worked with Xcode 5.1.1 (we are maintaining an older enterprise app so still have use of this older Xcode version), and restarting Xcode solved the issue!
  • dan
    dan about 6 years
    Very good point, this happens when you change your team in the main target but not in the test target. Changing the team in the test target to the team in the main target, solved the issue for me.
  • Noitidart
    Noitidart about 6 years
    Is it possible to remove game center, and in-app purchase from developer.apple.com?
  • Noitidart
    Noitidart about 6 years
    Where is entitlements file located?
  • Reinhard Männer
    Reinhard Männer about 6 years
    It is in your project folder, and called "yourProject.entitlements". You can find it in Xcode's project navigator.
  • Noitidart
    Noitidart about 6 years
    Thanks. it seems it was not created until i checked then unchecked "inter app audio". I have game center and in app purchases on developer.apple.com but i dont use it, these are defaults. So I marked in my capabilities in xcode as "on" but no matter what i keep getting the "The executable was signed with invalid entitlements." error. :(
  • Reid
    Reid almost 6 years
    Thanks!! This is what finally fixed it for me. Entitlements were a total red herring.
  • Kqtr
    Kqtr over 5 years
    Wow! Thanks @Krish
  • Samer Murad
    Samer Murad over 5 years
    you sir, just saved my Thursday, can't thank you enough
  • Pablo
    Pablo over 5 years
    where can I find ProjectTarget and ProjectTests?
  • Pablo
    Pablo over 5 years
    ah! found it! days on this and it wast just this setup!??
  • Vyrnach
    Vyrnach almost 5 years
    would like add for Cordova/Ionic users that you may also need to change your generated Xcode project to use legacy mode by "File > Project / Workspace Settings" and change it to the Legacy Build system" as detailed here: stackoverflow.com/a/52605878/2503520
  • Saurabh Bisht
    Saurabh Bisht almost 5 years
    Reinstallation is no solution, it happens mostly when the scheme configured does not match the running one
  • Dan Beaulieu
    Dan Beaulieu about 4 years
    This occurred in a Xamarin application as well in Visual Studio for mac. So it's not just isolated to Xcode.
  • Roi
    Roi about 3 years
    @Pablo where did you find it?
  • Pablo
    Pablo about 3 years
    @Roi I think it was here: stackoverflow.com/a/55466625/1958882
  • Nasir
    Nasir almost 3 years
    Worked perfectly
  • HartWoom
    HartWoom over 2 years
    It was another entitlement that was missing for me. It was in the LOC.entitlements file