react-native: Unable to build with XCode 14.0
Description
XCode 14.0 is released since yesterday, and I have the following error while building a fresh app on a physical device:
[...]/ios/Pods/Pods.xcodeproj error project: Signing for "React-Core-AccessibilityResources" requires a development team. Select a development team in the Signing & Capabilities editor.
Is react-native ready for XCode 14?
Version
0.70.0
Output of npx react-native info
System: OS: macOS 12.5.1 CPU: (10) arm64 Apple M1 Pro Memory: 6.53 GB / 32.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node Yarn: Not Found npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm Watchman: 2022.08.29.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0 Android SDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8815526 Xcode: 14.0/14A309 - /usr/bin/xcodebuild Languages: Java: 11.0.16.1 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.1.0 => 18.1.0 react-native: 0.70.0 => 0.70.0 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
- Create a fresh react-native app with
npx react-native init MyApp
- Open XCode and try to build the app on a real device
Snack, code example, screenshot, or link to a repository
https://github.com/BeTomorrow/react-native-file-logger/tree/master/example
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 54
- Comments: 40 (2 by maintainers)
Commits related to this issue
- [native] Add Podfile hack to disable Signing Team requirement Summary: Addresses [ENG-1942](https://linear.app/comm/issue/ENG-1942/pod-install-leaves-certain-pods-with-unconfigured-signing-team). Got... — committed to CommE2E/comm by Ashoat 2 years ago
- fix(ios): add xcode 14 workaround (turn off signing resource bundles) for pods (#34826) Summary: This is inspired by the Expo workaround https://github.com/expo/expo/commit/d970a9ecbb15b554b6fa23e8d4... — committed to facebook/react-native by kelset 2 years ago
- fix(ios): add xcode 14 workaround (turn off signing resource bundles) for pods (#34826) Summary: This is inspired by the Expo workaround https://github.com/expo/expo/commit/d970a9ecbb15b554b6fa23e8d4... — committed to facebook/react-native by kelset 2 years ago
- chore: modify podfile to address example signing issue context: https://github.com/facebook/react-native/issues/34673 — committed to livekit/client-sdk-react-native by davidliu a year ago
- fix(ios): add xcode 14 workaround (turn off signing resource bundles) for pods (#34826) Summary: This is inspired by the Expo workaround https://github.com/expo/expo/commit/d970a9ecbb15b554b6fa23e8d4... — committed to OlimpiaZurek/react-native by kelset 2 years ago
- update podfile lock to prevent crash on ios build see https://github.com/facebook/react-native/issues/34673#issuecomment-1482449310 — committed to MetaMask/metamask-mobile by NicolasMassart a year ago
- update podfile lock to prevent crash on ios build see https://github.com/facebook/react-native/issues/34673#issuecomment-1482449310 — committed to MetaMask/metamask-mobile by NicolasMassart a year ago
- upgrade to cocoapods 1.12.0 fixes issue while building iOS, see https://github.com/facebook/react-native/issues/34673#issuecomment-1482449310 — committed to MetaMask/metamask-mobile by NicolasMassart a year ago
- upgrade to cocoapods 1.12.0 (#6512) fixes issue while building iOS, see https://github.com/facebook/react-native/issues/34673#issuecomment-1482449310 — committed to MetaMask/metamask-mobile by NicolasMassart a year ago
- upgrade to cocoapods 1.12.0 (#6512) fixes issue while building iOS, see https://github.com/facebook/react-native/issues/34673#issuecomment-1482449310 — committed to MetaMask/metamask-mobile by NicolasMassart a year ago
- upgrade to cocoapods 1.12.0 (#6512) fixes issue while building iOS, see https://github.com/facebook/react-native/issues/34673#issuecomment-1482449310 — committed to MetaMask/metamask-mobile by NicolasMassart a year ago
- upgrade to cocoapods 1.12.0 (#6512) (#6538) fixes issue while building iOS, see https://github.com/facebook/react-native/issues/34673#issuecomment-1482449310 Co-authored-by: Nicolas MASSART <Nicol... — committed to MetaMask/metamask-mobile by wachunei a year ago
- feat(release): 7.1.0 (#6480) * 7.1.0 * feat(release): 7.0.0 (#6465) * 6.6.0 * notify appium server test is done (#6349) * add tags and simplify feature description (#6353) * [FIX] Appi... — committed to MetaMask/metamask-mobile by github-actions[bot] a year ago
- feat(release): 7.1.0 (#6480) * 7.1.0 * feat(release): 7.0.0 (#6465) * 6.6.0 * notify appium server test is done (#6349) * add tags and simplify feature description (#6353) * [FIX] Appi... — committed to MetaMask/metamask-mobile by github-actions[bot] a year ago
I use this script and it works
Hey Everyone! I was able to find a solution! It’s honestly much simpler than I thought.
I believe the bug must have gotten introduced in XCode 14 and it was not setting a development team for the iOS pod named “React-Core-AccessibilityResources”. This was stopping me from being able to build my app on my IPhone and likely would have stopped me from being able to archive my build to get it on the App Store.
Solution:
When you see this message:
The MISTAKE I was making was trying to go to my AppName -> Signing & Capabilities. This message is trying to tell you the error is within this specific POD.
All you have to do is
Select your team of choice and move on with your day!
xcode downgrade 13.4.1 version.
My workaround was to specify the TEAM_ID, my lines looks like this:
I hope it helps!
Replace with this
I solved this problem select development team.
hey folks, we have released a fix for this in 0.70.3 - please update to this new version: https://github.com/facebook/react-native/releases/tag/v0.70.3
can you folks try this workaround? https://github.com/expo/expo/commit/d970a9ecbb15b554b6fa23e8d43006fd15152028
it’s the one the Expo team has been implementing and it seems to be in line with some comments in the pods issue.
Downgrade is not a real solution, only a quick fix.
Worked perfectly thanks!
If anyone else isn’t sure where to get his team ID, it can be found on the apple developer website https://developer.apple.com/account/#/membership under the menu “Certificates, Identifiers & Profiles” and then look at the top right under your account name.
I tried adding the fix mentioned here to the Podfile, and it worked locally.
But on the CI running on App Center for release builds, I am now getting this error:
/Users/runner/work/1/s/ios/Pods/Pods.xcodeproj: error: No signing certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID "XXX" with a private key was found. (in target 'React-Core-AccessibilityResources' from project 'Pods')
Any ideas about that?
@ucheNkadiCode this works only until you do
pod install
the next time.just as an headsup, we have a PR getting merged with a fix that we think is the right level of “scope”: https://github.com/facebook/react-native/pull/34826 it will get cherry picked for the next 0.70 release
I tried setting the team manually and was able to build the app. But somehow the globals declared in
babel.config.js
failed withReferenceError: Can't find variable: <variable_name>
. I had this issue with__scanCodes
from https://github.com/rodgomesc/vision-camera-code-scanner.As expected reverting XCode to version 13.4.1 fixed all of the above.
I have a problem with this new release unless @kelset can answer. For new version 70.3, the solution involves turning off code signing for all React-Core packages. What does that do and how does it affect publishing to App Store?
Thank you
Yes, Cocoapods 1.12.0 contains a fix for this issue (although it was missing from the release notes): https://github.com/CocoaPods/CocoaPods/commit/141a082a3fda27e73fe7b32bd999eac53b44cf12
From https://github.com/facebook/react-native/issues/34673#issuecomment-1245445193. What does
CODE_SIGNING_ALLOWED
do? Isn’t it needed?thank you @tomwanzek for checking!
Sorry, forgot to give update here, yes, it’s indeed something wrong with our app, i documented the problem and solution here: https://github.com/CocoaPods/CocoaPods/issues/11402#issuecomment-1489846509
In case someone has the same problem.
@kelset That workaround works for me.
I found out this script actually works on my CI, just this doesn’t.
When implementing this fix, I am getting the following error: “undefined method `react_native_post_install’ for #Pod::Podfile:0x00007fea76758c18”
Is there something else we have to do to get that method to work?
Thanks in advance!