-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS]'string' file not found (since RN 0.52) #17556
Comments
I think the reason is the OC file in React include yoga cpp has .m suffix,but it needs .mm.It builds success in only OC project,but failed in swift project. |
any solution for this? |
This is really bad, how can React Native release a new version that is totally unusable for an large subset of their users? Do they even test the releases on Swift? |
Assuming you're using CocoaPods, a generated umbrella header file breaks the build because some of the imported files include C++ headers. I added a post_install script in my Podfile and it seems to work. Hope this helps. # Podfile
def remove_unused_yoga_headers
filepath = './Pods/Target Support Files/yoga/yoga-umbrella.h'
contents = []
file = File.open(filepath, 'r')
file.each_line do | line |
contents << line
end
file.close
contents.delete_at(14) # #import "YGNodePrint.h"
contents.delete_at(14) # #import "Yoga-internal.h"
file = File.open(filepath, 'w') do |f|
f.puts(contents)
end
end
post_install do | installer |
remove_unused_yoga_headers
end |
I tried the following:
But now I do get |
try including tvOS in React subspecs pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge', # Include this for RN >= 0.47
'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
'RCTText',
'RCTNetwork',
'RCTWebSocket', # needed for debugging
+ 'tvOS',
] |
it goes on and on...
|
Pretty sure this helps #13198 (comment) Integrating React Native with CocoaPods has never been a pleasant experience. I'd advise that it is much better to link React Native dependencies by adding the *.xcodeproj files directly to your project rather than using CocoaPods unless you absolutely have to 🙂 |
fishhook/fishhook.h file not found in RCTReconnectingWebSocket.m @haemi fix #import <fishhook/fishhook.h> to #import "fishhook.h" |
@ldshangfeng wow - it works now, thanks a lot! |
@ldshangfeng is that the proper way to fix this issue?
|
@yuoppp see all of comments.It work successfully with CocoaPods only. |
Hello, Thanks |
After adding all these "workarounds" it's still not working. Getting the error: Makes sense because the post_install script removes it.... |
Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version? I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer. |
Bad bot. Don't close this. Still an issue even on 0.54.0-rc3. |
After changing from #import "<RCTNetworking/RCTNetworking.h" to "#import "RCTNetworking.h" got the issue "'RCTNetworking.h' file not found"? |
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment:
OS: macOS High Sierra 10.13.2
Node: 7.6.0
Yarn: 0.24.6
npm: 4.1.2
Watchman: 4.7.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: Not Found
Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: file:submodule/react-native => 0.52.0
Target Platform: iOS (11.1)
Steps to Reproduce
1.the react-native project complied with swift code
2.build project
Expected Behavior
Complied Success.
Actual Behavior
Complied failed.
Xcode shows 'string' file not found".
Reproducible Demo
Every react-native 0.52 or above project with swift has this problem.
The same issues:(facebook/yoga#697)
The text was updated successfully, but these errors were encountered: