Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode signing issues due to Facebook Team ID being used by default in npm release #16881

Closed
Rojuinex opened this issue Nov 19, 2017 · 27 comments
Closed
Labels
Help Wanted :octocat: Issues ideal for external contributors. Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@Rojuinex
Copy link
Contributor

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.

@JCMais
Copy link

JCMais commented Nov 21, 2017

Having same exact issue.

Were you able to fix this @Rojuinex ?

@Rojuinex
Copy link
Contributor Author

Rojuinex commented Nov 21, 2017

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

@JCMais
Copy link

JCMais commented Nov 21, 2017

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.

@Rojuinex
Copy link
Contributor Author

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.

@hammadzz
Copy link

hammadzz commented Dec 4, 2017

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

@Rojuinex
Copy link
Contributor Author

Rojuinex commented Dec 4, 2017

@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.

@hammadzz
Copy link

hammadzz commented Dec 4, 2017

@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.

@Rojuinex
Copy link
Contributor Author

Rojuinex commented Dec 4, 2017

@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.

@hammadzz
Copy link

hammadzz commented Dec 4, 2017

@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.

@Rojuinex
Copy link
Contributor Author

Rojuinex commented Dec 4, 2017

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.

@jjdp
Copy link

jjdp commented Dec 9, 2017

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

@hammadzz
Copy link

hammadzz commented Dec 9, 2017

@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.

@Rojuinex
Copy link
Contributor Author

@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.

@OrangeFlavoredColdCoffee

This comment has been minimized.

@irlabs
Copy link

irlabs commented Feb 22, 2018

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)

@react-native-bot

This comment has been minimized.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon. labels Feb 24, 2018
@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 24, 2018
@kingfreir
Copy link

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.

@joelgetaction
Copy link

+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 ...

@joelgetaction
Copy link

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;

@hramos hramos reopened this Jun 25, 2018
@hramos
Copy link
Contributor

hramos commented Jun 25, 2018

Re-opened. Can you send a PR?

@hramos hramos added the Platform: iOS iOS applications. label Jun 25, 2018
@hramos hramos changed the title Facebook Team ID published to NPM Xcode signing issues due to Facebook Team ID being used by default in npm release Jun 25, 2018
@hramos hramos added Help Wanted :octocat: Issues ideal for external contributors. Core Team labels Jun 25, 2018
@joelgetaction
Copy link

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?

@joelgetaction
Copy link

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.

@Rojuinex
Copy link
Contributor Author

Rojuinex commented Jul 5, 2018

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

@patrickkempff
Copy link
Contributor

@Rojuinex master is fine

@rawit1976
Copy link

Good

@esutton
Copy link

esutton commented Sep 18, 2018

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",

@hramos
Copy link
Contributor

hramos commented Sep 18, 2018

@esutton this should be fixed in master. The fix in 8103c43 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.

hramos added a commit that referenced this issue Sep 21, 2018
Summary:
Fixes #16881

Removing development team from Xcode project.
Pull Request resolved: #20054
GitHub Author: Caleb (Rojuinex) Bartholomew rojuinex@gmail.com

Differential Revision: D9440144

Pulled By: hramos

fbshipit-source-id: 5cb4cf24c5f7562632006f0d0143f762fed04295
@hramos hramos added this to the 0.58 RC milestone Sep 25, 2018
t-nanava pushed a commit to microsoft/react-native-macos that referenced this issue Jun 17, 2019
Summary:
Fixes facebook#16881

Removing development team from Xcode project.
Pull Request resolved: facebook#20054

Differential Revision: D9440144

Pulled By: hramos

fbshipit-source-id: 5cb4cf24c5f7562632006f0d0143f762fed04295
@facebook facebook locked as resolved and limited conversation to collaborators Aug 23, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Aug 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Help Wanted :octocat: Issues ideal for external contributors. Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests