React-native: Xcode signing issues due to Facebook Team ID being used by default in npm release

Created on 19 Nov 2017  Â·  27Comments  Â·  Source: facebook/react-native

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: macOS High Sierra 10.13.1
Node: 9.2.0
Yarn: 1.3.2
npm: 5.5.1
Watchman: Not Found
Xcode: Xcode 9.1 Build version 9B55
Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
react: 16.0.0-beta.5 => 16.0.0-beta.5
react-native: ^0.49.5 => 0.49.5

Steps to Reproduce

  1. Bootstrap a project using react-native init.
  2. Build the project
  3. Go to the issues navigator and observe all of the Update Signing issues.

Note: You will most likely have to do this with a version of Xcode that does not have access to Facebooks developer team as the issue will only be present for instances of Xcode that are not linked with Facebooks

Alternately

  1. Bootstrap a project using react-native init
  2. Navigate to node_modules/react-native/React/React.xcodeproj
  3. Open project.pbxproj with your favorite editor and navigat eto lines 3420 - 3450 and note the lines with DevelopmentTeam = V9WTTPBFK9;

Expected Behavior

A new project does not have update signing errors

Actual Behavior

Because Facebooks DevelopmentTeam identifier is being published to npm there are tons of errors the editor reports which can be really difficult to track down. If the Developer ID lines were removed before publishing to npm Xcode would use what ever Developer ID is default for the user and they would not have to track down all the stray ID's and fix them.

screen shot 2017-11-18 at 21 44 32

Reproducible Demo

Follow the Building Project with Native Code section.

Open the project with a version of Xcode that is not linked to Facebook's Developer ID.

Navigate to the issues section and observe the update signing issues.

Help Wanted iOS Ran Commands Locked

Most helpful comment

It's an error; the error won't go away until you remove the DeveloperID from the Xcode project file.

screen shot 2017-12-04 at 11 23 04

And they just keep stacking up:

screen shot 2017-12-04 at 11 26 54

But after performing the aforementioned sed command it stops generating new errors.

All 27 comments

Having same exact issue.

Were you able to fix this @Rojuinex ?

As a work around you can remove all the developer id’s every time you npm install or update with this command

sed -i '' '/DEVELOPMENT_TEAM = V9WTTPBFK9/s/.*//' node_modules/react-native/React/React.xcodeproj/project.pbxproj

Fixed our issue here, the problem was that we were trying to run on device without a provisioning profile for development (we had configured fastlane match only with the distribution one), so it was picking those infos from Facebook.

Adding the development provisioning profile fixed it.

Yeah that's true, but there will still be warnings in the message center unless you remove it from the file. Not that it really is necessary but my OCD makes me try and get rid of error and warning messages.

If you see this error and can't figure out what the hell is going on:

  1. Delete all provisioning profiles in here
cd ~/Library/MobileDevice/Provisioning\ Profiles/
rm -rf *
  1. Redownload provisioning profiles
    Xcode > Preferences > Accounts (select yours) > Download Manual Profiles

  2. Celebrate

@hammadzz I don't think that will actually do it; the issue is that the development team key is set to "V9WTTPBFK9" in React.xcodeproj that is installed from NPM. So xcode tries to find a provisioning profile with said ID but fails and thus you see the error displayed. I'm _fairly_ confident that the only way to remove the error is to remove the keys from the .xcodeproj; though I feel like this file should be sanitized before being published to NPM in the first place. It doesn't _really_ cause any build problems but it does show up a thousand times in the error log which can be annoying and misleading.

I mean, maybe you know something about the provisioning profiles that I don't but it seems Xcode is looking for a profile that matches the developer ID that is set in React.xcodeproj and throws an error when it can't find it.

@Rojuinex this will fix it if your provisioning profiles is being missed which is why XCode is defaulting to picking up Facebooks from the npm module. So it is avoiding the issue. Yes Facebook should remove those to save people like me from chasing errors that made no sense.

@hammadzz I did the steps you recommended and I am still getting the update signing issue as I suspected. The issue is No "iOS Development" signing certificate matching team ID "V9WTTPBFK9" with a private key was found. which is because the ID V9WTTPBFK9 exists in the React.xcodeproj. The only way I was able to resolve the issue is by running sed to remove the lines in the project file where the DeveloperID is set to Facebook's developer ID.

@Rojuinex is it a warning or an error?

For me it was an error with the exact same text you quoted. I did that procedure to clear the error as the provisioning profile with my hardware device was missing so it was defaulting to Facebooks. Won't clear the warnings.

It's an error; the error won't go away until you remove the DeveloperID from the Xcode project file.

screen shot 2017-12-04 at 11 23 04

And they just keep stacking up:

screen shot 2017-12-04 at 11 26 54

But after performing the aforementioned sed command it stops generating new errors.

I'm getting a sed: 1: "node_modules/react-nati ...": extra characters at the end of n command. How to fix that? @Rojuinex

@jjdp if you don't know sed commands go in and manually remove their development team.

You could open node_modules/react-native/React/React.xcodeproj/project.pbxproj and remove development team by selecting none in the project properties and see which lines it removes.

@jjdp Interesting; I swear I ran this command on my machine and it worked, but I just ran it again and it's failing. It looks like OSX requires an extension to be set after the -i and an empty string should work, so -i ''. I've also modified my original comment with the new command.

+1

To patch the React.xcodeproj we also need to remove the DevelopmentTeam elsewhere in the .pbproj file:

sed -i.bak -e '/DEVELOPMENT_TEAM = V9WTTPBFK9/d' node_modules/react-native/React/React.xcodeproj/project.pbxproj
sed -i.bak -e '/DevelopmentTeam = V9WTTPBFK9/d' node_modules/react-native/React/React.xcodeproj/project.pbxproj

And some more adjustments to @Rojuinex patch script:

  • using sed's /d to remove the line completely, not leaving an empty line
  • using sed -i.bak -e instead of sed -i '' to be GNU-sed compatible (if this needs to be run on a CI-server as well)

Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?

I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.

How to Contribute • What to Expect from Maintainers

This remains an issue on v0.55.3.

Had to run @irlabs's command to remove dev team reference in order to remove code signing errors, but I don't consider it to be a "clean" solution. Would be preferable to not have that team reference at all.

+1 still seeing this on 0.55.4. @hramos or somebody from FB, can we figure out a solution to this? I just resynced my RN app to another dev machine which has all the needed certs and prov profs installed and I'm unable to build from within Xcode due to this although fastlane CLI builds succeed ...

Here's evidence that this team id is quite clearly being published and included in the projects:

grep -ri V9WTTPBFK9 .
./node_modules/react-native/React/React.xcodeproj/project.pbxproj:                      DevelopmentTeam = V9WTTPBFK9;
./node_modules/react-native/React/React.xcodeproj/project.pbxproj:                      DevelopmentTeam = V9WTTPBFK9;
./node_modules/react-native/React/React.xcodeproj/project.pbxproj:                      DevelopmentTeam = V9WTTPBFK9;
./node_modules/react-native/React/React.xcodeproj/project.pbxproj:                      DevelopmentTeam = V9WTTPBFK9;
./node_modules/react-native/React/React.xcodeproj/project.pbxproj:              DEVELOPMENT_TEAM = V9WTTPBFK9;
./node_modules/react-native/React/React.xcodeproj/project.pbxproj:              DEVELOPMENT_TEAM = V9WTTPBFK9;
./node_modules/react-native/React/React.xcodeproj/project.pbxproj:              DEVELOPMENT_TEAM = V9WTTPBFK9;
./node_modules/react-native/React/React.xcodeproj/project.pbxproj:              DEVELOPMENT_TEAM = V9WTTPBFK9;
./node_modules/react-native/React/React.xcodeproj/project.pbxproj:              DEVELOPMENT_TEAM = V9WTTPBFK9;
./node_modules/react-native/React/React.xcodeproj/project.pbxproj:              DEVELOPMENT_TEAM = V9WTTPBFK9;
./node_modules/react-native/React/React.xcodeproj/project.pbxproj:              DEVELOPMENT_TEAM = V9WTTPBFK9;
./node_modules/react-native/React/React.xcodeproj/project.pbxproj:              DEVELOPMENT_TEAM = V9WTTPBFK9;

Re-opened. Can you send a PR?

Thanks for the quick response @hramos ! :-) Sure, I'd be happy to help however I can. Did you want a PR for just the .pbxproj file or for the whole react-native repo or for the npm module?

OK, mine was failing even after @irlabs suggestion for another reason. I had changed the PRODUCT_NAME of my main target from MyApp to MyApp Devo but that borked the tests for some reason. So I turned off build tests in the main app scheme as part of the run action and suddenly I was able to compile. I fixed this by going to the test target and changing the "Host Application" back to the main app target. I guess changing the PRODUCT_NAME in the main app target screwed up the tests somehow.

All is well and I'm able to build now. :-) Thanks for everybody's help and patience.

@hramos I can create a PR or a patch; do want it for master or is another branch preferred?

@Rojuinex master is fine

Good

I am seeing this after upgrading to Xcode 10 from Xcode 9.4

Several repair target team warnings for V9WTTPBFK9 on several iOS and tvOS node_module projects.

Using:

        "react": "16.3.1",
        "react-native": "0.55.4",

@esutton this should be fixed in master. The fix in https://github.com/facebook/react-native/commit/8103c431c897c02d47cfad1e71bb2e6ddaabbdc0 did not make the cut for 0.57, so unless you're building RN from source, it's expected you'll still see this in 0.57.

Was this page helpful?
0 / 5 - 0 ratings