react-native: Unable to build with XCode 14.2/14.3

Description

Im not able to built the app on simulator and physical devices and Im getting the error.:

/Users/juser/Library/Developer/Xcode/DerivedData/MyApp-abcizgwayvbfawfstnoivggojyex/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/DerivedSources/MyApp_vers.c module map file '/Users/juser/Library/Developer/Xcode/DerivedData/MyApp-abcizgwayvbfawfstnoivggojyex/Build/Products/Debug-iphonesimulator/NextLevelSessionExporter/NextLevelSessionExporter.modulemap' not found

When clicked on Xcode this error leads to a C file with the following content.:

 extern const unsigned char MyAppVersionString[];
 extern const double MyAppVersionNumber;

 const unsigned char MyAppVersionString[] __attribute__ ((used)) = "@(#)PROGRAM:MyApp  PROJECT:MyApp-6" "\n";
 const double MyAppVersionNumber __attribute__ ((used)) = (double)6.;

Tried to run in a new app using npx react-native init MyTestApp and npx react-native init MyTestApp --version 0.67.5

both new versions works fine.

This error started this morning, without any change in the previous working code. (Nothing was added).

React Native Version

0.67.5

Output of npx react-native info

System: OS: macOS 13.3 CPU: (8) x64 Apple M1 Pro Memory: 61.72 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v16.13.1/bin/yarn npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm Watchman: 2023.02.20.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.12.0 - /Users/user/.rbenv/shims/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 Android SDK: API Levels: 29, 30, 31, 32, 33 Build Tools: 28.0.0, 28.0.1, 28.0.2, 28.0.3, 29.0.0, 29.0.1, 29.0.2, 29.0.3, 30.0.0, 30.0.1, 30.0.2, 30.0.3, 31.0.0, 33.0.0 System Images: android-30 | Google Play ARM 64 v8a, android-31 | Google Play ARM 64 v8a, android-33 | Google APIs ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2021.3 AI-213.7172.25.2113.9123335 Xcode: 14.2/14C18 - /usr/bin/xcodebuild Languages: Java: 11.0.17 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.67.5 => 0.67.5 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

cd ios pod install && cd .. yarn ios --simulator="iPhone 14 Pro

Snack, code example, screenshot, or link to a repository

yarn ios --simulator="iPhone 14 Pro"


The following build commands failed:
	CompileC /Users/user/Library/Developer/Xcode/DerivedData/MyApp-abcizgwayvbfawfstnoivggojyex/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/MyApp.o /Users/user/Library/Developer/Xcode/DerivedData/MyApp-abcizgwayvbfawfstnoivggojyex/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/DerivedSources/MyApp.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler (in target 'MyApp' from project 'MyApp')
(1 failure)

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 3
  • Comments: 21 (1 by maintainers)

Most upvoted comments

I have faced a very similar issue, however after installing 14.3 I reverted to 14.2, but the issue persisted.

A colleague found a fix, and it solved it for me, too:

  1. Delete ~/Library/Developer and contents of /Library/Developer
  2. sudo xcode-select --install and (if needed I guess) sudo xcode-select -s /path/to/xcode
  3. Clean and rebuild

This makes it possible for me to continue using 14.2 (with Rosetta), I don’t know if it helps with 14.3.

Similar to @supmanyu my Xcode autoupdated to 14.3 and downgrading back to 14.2 is causing issues. I am seeing the same errors of a list of:

<unknown>:0: error: module map file ... not found

Running npx react-native info this is my device setting if it helps anyone else:

Xcode 14.2 (14C18) is what it was downgraded to (not just Xcode 14.3 as indicated below)

Using Rosetta 2 with 14.2 on 0.68.5

System:
    OS: macOS 13.3
    CPU: (10) arm64 Apple M1 Max
    Memory: 108.08 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.9.1 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.19.1 - /opt/homebrew/bin/npm
    Watchman: 2022.09.19.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9123335
    Xcode: 14.3/14E222b - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.16.1 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.68.5 => 0.68.5
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Screenshot 2023-04-06 at 4 05 03 PM

@davidking1234 If you open up xCode then select your project name file at the very top, then into build settings make sure you have “All” selected and do a search for “exclude architectures”. I had “arm64” and removed that unsure if you will have that if you haven’t changed it. Seem image.

Screenshot 2023-04-06 at 9 41 46 am

+1. I’m on Xcode 14.3 too

Also facing the same issue. I’m on xCode 14.3

Following @maxckelly suggestion and removing the excluded arch arm64 on Xcode 14.2 (using Rosetta 2) the build works until getting attached to simulator which I then get this error:

Could not attach to pid: "30947"
debugserver is x86_64 binary running in translation, attached failed.

Screenshot 2023-04-07 at 10 34 21 AM

Screenshot 2023-04-07 at 10 30 29 AM

I’m on a m1 mac and not running xCode using rosetta 2

Following @maxckelly suggestion and removing the excluded arch arm64 on Xcode 14.2 (using Rosetta 2) the build works until getting attached to simulator which I then get this error:

Could not attach to pid: "30947"
debugserver is x86_64 binary running in translation, attached failed.

Screenshot 2023-04-07 at 10 34 21 AM

Screenshot 2023-04-07 at 10 30 29 AM

Facing the same issue @quachdev , found any solution?

Im still facing this issue, React Native 0.64.4, xcode 14.3, macOS ventura

@jvfalco1 - I just got a build succeed. I removed the excluded arch of arm64 and seemed to have successfully built. I’m on xCode 14.3 however I downgraded back to react native 0.70.8

Worked for me! Thanks a lot @maxckelly.

Same here, macOs Ventura and Xcode 14.3 can’t get build to device or simulator

@jvfalco1 - I just got a build succeed. I removed the excluded arch of arm64 and seemed to have successfully built. I’m on xCode 14.3 however I downgraded back to react native 0.70.8

Not yet @jvfalco1 I tried updating react native and everything and can’t find a solution still getting multiple errors like the below…

error: module map file '/Users/xxx/Library/Developer/Xcode/DerivedData/xxx-eenuojeybtzhwibondqwqretupgd/Build/Products/Debug-iphonesimulator/EXBlur/EXBlur.modulemap' not found