question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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:closed
  • Created 3 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DingSoungcommented, May 25, 2021

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)

#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif

#import "EXiOSUtils.h"
#import "EXJSConvertTypedArray.h"
#import "EXJSUtils.h"
#import "stb_image.h"
//#import "EXGLContext.h"
#import "UEXGL.h"
#import "UEXGLcppheader.cpp.h"

FOUNDATION_EXPORT double EXGL_CPPVersionNumber;
FOUNDATION_EXPORT const unsigned char EXGL_CPPVersionString[];

solution

    ss.private_header_files = '**/{EXGLContext.h}'
0reactions
DingSoungcommented, Nov 29, 2022

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found