[expo-gl][expo-gl-cpp]#import <future> file not found in bare react-native project
See original GitHub issue🐛 Bug Report
Summary of Issue
Adding react-native-unimodules, expo-gl, and expo-gl-cpp has caused some build errors in my Xcode project. I followed installing unimodules documentation.
The errors
- node_modules/expo-gl-cpp/cpp/EXGLContext.h:15:10: ‘future’ file not found
- node_modules/expo-gl/ios/EXGL/EXGLView.h:3:9: Could not build module ‘EXGL_CPP’
My Podfile
platform :ios, '11.1'
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
target 'MyTarget' do
use_frameworks!
use_unimodules!
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
end
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "React-Core"
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCTLOG_REDBOX_LEVEL=RCTLogLevelFatal'
end
end
end
end
Any suggestions for a fix would be appreciated. Thanks.
Environment - output of expo diagnostics
& the platform(s) you’re targeting
Reproducible Demo
Steps to Reproduce
npx react-native init AwesomeProject
cd AwesomeProject
npm i -S react-native-unimodules expo-gl expo-gl-cpp
# edit AppDelegate.m according to unimodules installation instructions
# edit Podfile according to unimodules installation instructions
# add use_frameworks! below use_unimodules!
# comment out the flipper section of the Podfile
cd ios && pod install && cd ..
npx react-native start
# open a second terminal
npx react-native run-ios
Alternatively, the .xcworkspace file can be opened in Xcode and the errors can be viewed there.
Expected Behavior vs Actual Behavior
The Xcode project is expected to build without failure.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (5 by maintainers)
Top Results From Across the Web
Header file not found for embedded framework inside library ...
I'm currently working on a contract job where I've been asked to help integrate a 3rd party SDK with an existing React Native...
Read more >Framework header file not found error in Xcode 8 editor
The imported framework's xcodeproj file is referenced by the dependent project (i.e. the xcodeproj file was added to the project using "Add Files...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
usually Xcode buildsetting - GCC_INPUT_FILETYPE is set to automatic (by file type)
if a header is imported by c file, it will be combined as c, if is imported by cpp file, it will be combined as cpp
I have check EXGLContext.h is always imported by cpp file, so the source code is correct.
finally I found EXGLContext.h is imported by EXG_CPP-umbrella.h, witch is combined by automatic(default obj-c)
solution
这是来自QQ邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。