Repository navigation
Cannot build React Native 0.55.3 with Xcode 8 due to RCTLayout typedefs #18944
Copy link
Copy link
Closed
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
- I have reviewed the documentation
- I have searched existing issues
- I am using the latest React Native version
Environment
Environment:
OS: macOS Sierra 10.12.6
Node: 9.11.1
Yarn: 1.5.1
npm: 5.6.0
Watchman: 4.7.0
Xcode: Xcode 8.3.2 Build version 8E2002
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: ^16.3.2 => 16.3.2
react-native: ^0.55.3 => 0.55.3
Steps to Reproduce
Either build the project with xcode using yarn run react-native run-ios or build the project in Xcode.
Expected Behavior
A successful build.
Actual Behavior
The build fails on a few RCTLayout typedefs.
In file included from /[redacted]/node_modules/react-native/React/Views/RCTShadowView+Internal.m:8:
In file included from /[redacted]/node_modules/react-native/React/Views/RCTShadowView+Layout.h:10:
In file included from /[redacted]/node_modules/react-native/React/Views/RCTShadowView.h:11:
/[redacted]/node_modules/react-native/React/Views/RCTLayout.h:30:43: error: expected ';' after top level declarator
typedef struct CG_BOXABLE RCTLayoutMetrics RCTLayoutMetrics;
^
;
/[redacted]/node_modules/react-native/React/Views/RCTLayout.h:30:44: warning: declaration does not declare anything [-Wmissing-declarations]
typedef struct CG_BOXABLE RCTLayoutMetrics RCTLayoutMetrics;
^~~~~~~~~~~~~~~~
/[redacted]/node_modules/react-native/React/Views/RCTLayout.h:37:43: error: expected ';' after top level declarator
typedef struct CG_BOXABLE RCTLayoutContext RCTLayoutContext;
^
;
/[redacted]/node_modules/react-native/React/Views/RCTLayout.h:37:44: warning: declaration does not declare anything [-Wmissing-declarations]
typedef struct CG_BOXABLE RCTLayoutContext RCTLayoutContext;
^~~~~~~~~~~~~~~~
/[redacted]/node_modules/react-native/React/Views/RCTLayout.h:39:74: error: variable has incomplete type 'RCTLayoutMetrics' (aka 'struct CG_BOXABLE')
static inline BOOL RCTLayoutMetricsEqualToLayoutMetrics(RCTLayoutMetrics a, RCTLayoutMetrics b)
^
/[redacted]/node_modules/react-native/React/Views/RCTLayout.h:30:16: note: forward declaration of 'struct CG_BOXABLE'
typedef struct CG_BOXABLE RCTLayoutMetrics RCTLayoutMetrics;
^
/[redacted]/node_modules/react-native/React/Views/RCTLayout.h:39:94: error: variable has incomplete type 'RCTLayoutMetrics' (aka 'struct CG_BOXABLE')
static inline BOOL RCTLayoutMetricsEqualToLayoutMetrics(RCTLayoutMetrics a, RCTLayoutMetrics b)
^
/[redacted]/node_modules/react-native/React/Views/RCTLayout.h:30:16: note: forward declaration of 'struct CG_BOXABLE'
typedef struct CG_BOXABLE RCTLayoutMetrics RCTLayoutMetrics;
^
/[redacted]/node_modules/react-native/React/Views/RCTLayout.h:39:74: warning: unused parameter 'a' [-Wunused-parameter]
static inline BOOL RCTLayoutMetricsEqualToLayoutMetrics(RCTLayoutMetrics a, RCTLayoutMetrics b)
^
/[redacted]/node_modules/react-native/React/Views/RCTLayout.h:39:94: warning: unused parameter 'b' [-Wunused-parameter]
static inline BOOL RCTLayoutMetricsEqualToLayoutMetrics(RCTLayoutMetrics a, RCTLayoutMetrics b)
^
4 warnings and 4 errors generated.
There are two reproductions of the same problem in #18793 (by @DarkSector and @f3ist), but since the title of that issue is incorrect (it fails in the Xcode GUI as well as on the command line), the original reproduction case is messy due to third-party dependencies, and an old version of RN is used, I decided to create a new issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Activity
Upgraded all packages except the QR scanner. Unfortunately doesn't bu…
Upgraded all packages except the QR scanner. Unfortunately doesn't bu…
Upgraded all packages except the QR scanner. Unfortunately doesn't bu…
randerson112358 commentedon Apr 29, 2018
Same issue for me.
THE ERROR MESSAGE I GET:
/Users//Desktop/AwesomeProject/node_modules/react-native/React/Views/RCTLayout.h:30:44: warning: declaration does not declare anything [-Wmissing-declarations]
typedef struct CG_BOXABLE RCTLayoutMetrics RCTLayoutMetrics;
^~~~~~~~~~~~~~~~
/Users//Desktop/AwesomeProject/node_modules/react-native/React/Views/RCTLayout.h:37:43: error: expected ';' after top level declarator
typedef struct CG_BOXABLE RCTLayoutContext RCTLayoutContext;
^
;
/Users//Desktop/AwesomeProject/node_modules/react-native/React/Views/RCTLayout.h:37:44: warning: declaration does not declare anything [-Wmissing-declarations]
typedef struct CG_BOXABLE RCTLayoutContext RCTLayoutContext;
^~~~~~~~~~~~~~~~
/Users//Desktop/AwesomeProject/node_modules/react-native/React/Views/RCTLayout.h:39:74: error: variable has incomplete type 'RCTLayoutMetrics' (aka 'struct CG_BOXABLE')
static inline BOOL RCTLayoutMetricsEqualToLayoutMetrics(RCTLayoutMetrics a, RCTLayoutMetrics b)
^
/Users//Desktop/AwesomeProject/node_modules/react-native/React/Views/RCTLayout.h:30:16: note: forward declaration of 'struct CG_BOXABLE'
typedef struct CG_BOXABLE RCTLayoutMetrics RCTLayoutMetrics;
/Users//Desktop/AwesomeProject/node_modules/react-native/React/Views/RCTLayout.h:39:94: error: variable has incomplete type 'RCTLayoutMetrics' (aka 'struct CG_BOXABLE')
static inline BOOL RCTLayoutMetricsEqualToLayoutMetrics(RCTLayoutMetrics a, RCTLayoutMetrics b)
^
/Users//Desktop/AwesomeProject/node_modules/react-native/React/Views/RCTLayout.h:30:16: note: forward declaration of 'struct CG_BOXABLE'
typedef struct CG_BOXABLE RCTLayoutMetrics RCTLayoutMetrics;
^
/Users//Desktop/AwesomeProject/node_modules/react-native/React/Views/RCTLayout.h:39:74: warning: unused parameter 'a' [-Wunused-parameter]
static inline BOOL RCTLayoutMetricsEqualToLayoutMetrics(RCTLayoutMetrics a, RCTLayoutMetrics b)
^
/Users//Desktop/AwesomeProject/node_modules/react-native/React/Views/RCTLayout.h:39:94: warning: unused parameter 'b' [-Wunused-parameter]
static inline BOOL RCTLayoutMetricsEqualToLayoutMetrics(RCTLayoutMetrics a, RCTLayoutMetrics b)
^
4 warnings and 4 errors generated.
** BUILD FAILED **
The following build commands failed:
CompileC /Users//Desktop/AwesomeProject/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTShadowView+Internal.o Views/RCTShadowView+Internal.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/AwesomeProject.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/AwesomeProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
srslafazan commentedon May 6, 2018
I solved this issue by upgrading to High Sierra and upgrading XCode to latest.
confiks commentedon May 6, 2018
I didn't upgrade to High Sierra, but installed the latest version compatible with Sierra, XCode 9.2. It can be downloaded here.
cidevant commentedon May 8, 2018
I cant upgrade to sierra (macbook pro late 2009), so how to solve it?
buf1024 commentedon May 8, 2018
this is due to the newer version of react native use some new feature of xcode sdk, it should fixed when upgrade new version xcode in theory,
TyrealGray commentedon May 16, 2018
So it also means 0.55 documentation is wrong because it said "If you have already installed Xcode on your system, make sure it is version 8 or higher."
stephenkopylov commentedon May 16, 2018
Guys, if you're using cocoapods in your projects, just try to renew your pods
react-native-bot commentedon Jun 12, 2018
Closing as resolved. Please use Xcode 9.
LeoNatan commentedon Jul 7, 2018
This can easily be fixed by using a custom macro in the form of
LeoNatan commentedon Jul 7, 2018
@hramos ^
pranavjandial123 commentedon Aug 28, 2018
@stephenkopylov renewing the pods fixed my issue!! Thanks..