Skip to content

Importing RNScreens in Xcode iOS Swift file fails to compile #2158

@Brett-Best

Description

@Brett-Best

Description

Attempting to import RNScreens in a swift file inside the main Xcode project where you'd define modules for example cause the build to fail.

I've attached a link to a new project I created using Expo.
The only customisation I made was to make CocoaPods use frameworks linking them statically.

The errors I'm getting are:

❌  (/Users/brettbest/Library/Developer/Xcode/DerivedData/Reproducer-favipxwwmbqszdfdwlhacyleizcj/Build/Products/Debug-iphonesimulator/RNScreens/RNScreens.framework/Headers/RNScreensTurboModule.h:1:10)

> 1 | #include <array>
    |          ^ 'array' file not found
  2 | #include <jsi/jsi.h>
  3 | 
  4 | #define JSI_HOST_FUNCTION(NAME)   \


❌  (/Users/brettbest/Library/Developer/Xcode/DerivedData/Reproducer-favipxwwmbqszdfdwlhacyleizcj/Build/Products/Debug-iphonesimulator/React-jsi/jsi.framework/Headers/decorator.h:10:10)

   8 | #pragma once
   9 | 
> 10 | #include <tuple>
     |          ^ 'tuple' file not found
  11 | 
  12 | #include <jsi/instrumentation.h>
  13 | #include <jsi/jsi.h>


❌  (ios/Reproducer/noop-file.swift:6:8)

  4 | //
  5 | 
> 6 | import RNScreens
    |        ^ could not build Objective-C module 'RNScreens'
  7 | 


❌  (/Users/brettbest/Library/Developer/Xcode/DerivedData/Reproducer-favipxwwmbqszdfdwlhacyleizcj/Build/Products/Debug-iphonesimulator/RNScreens/RNScreens.framework/Headers/RNScreensTurboModule.h:1:10)

> 1 | #include <array>
    |          ^ 'array' file not found
  2 | #include <jsi/jsi.h>
  3 | 
  4 | #define JSI_HOST_FUNCTION(NAME)   \


❌  (/Users/brettbest/Library/Developer/Xcode/DerivedData/Reproducer-favipxwwmbqszdfdwlhacyleizcj/Build/Products/Debug-iphonesimulator/React-jsi/jsi.framework/Headers/decorator.h:10:10)

   8 | #pragma once
   9 | 
> 10 | #include <tuple>
     |          ^ 'tuple' file not found
  11 | 
  12 | #include <jsi/instrumentation.h>
  13 | #include <jsi/jsi.h>


❌  (ios/Reproducer/noop-file.swift:6:8)

  4 | //
  5 | 
> 6 | import RNScreens
    |        ^ could not build Objective-C module 'RNScreens'
  7 | 


❌  (/Users/brettbest/Library/Developer/Xcode/DerivedData/Reproducer-favipxwwmbqszdfdwlhacyleizcj/Build/Products/Debug-iphonesimulator/RNScreens/RNScreens.framework/Headers/RNScreensTurboModule.h:1:10)

> 1 | #include <array>
    |          ^ 'array' file not found
  2 | #include <jsi/jsi.h>
  3 | 
  4 | #define JSI_HOST_FUNCTION(NAME)   \


❌  (/Users/brettbest/Library/Developer/Xcode/DerivedData/Reproducer-favipxwwmbqszdfdwlhacyleizcj/Build/Products/Debug-iphonesimulator/React-jsi/jsi.framework/Headers/decorator.h:10:10)

   8 | #pragma once
   9 | 
> 10 | #include <tuple>
     |          ^ 'tuple' file not found
  11 | 
  12 | #include <jsi/instrumentation.h>
  13 | #include <jsi/jsi.h>


❌  (ios/Reproducer/noop-file.swift:6:8)

  4 | //
  5 | 
> 6 | import RNScreens
    |        ^ could not build Objective-C module 'RNScreens'
  7 | 

Steps to reproduce

  1. Download the project linked, set Xcode 15.4 using xcode-select (haven't tested other Xcode versions)
  2. cd into it
  3. Run npx expo run:ios
  4. Observe the build errors

Snack or a link to a repository

https://www.icloud.com/iclouddrive/0f302pmEmM-cWmg6lRoATfeuw#RNScreens-Issue-Reproducer

Screens version

3.31.1

React Native version

0.74.1

Platforms

iOS

JavaScript runtime

Hermes

Workflow

None

Architecture

None

Build type

None

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Missing reproThis issue need minimum repro scenarioPlatform: iOSThis issue is specific to iOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions