Closed levibuzolic closed 3 years ago
The issue is valid!
Yes, we moved these header files to another location. Did you run pod install
again after the update? Sorry if it is obviously for you. At first, You can try something like this:
//in project root directory
cd ./ios/Pods && rm -rf ./* && cd .. && pod deintegrate && pod install
If this doesn't help, I'll investigate this problem.
Thanks for the fast reply and suggestion @piaskowyk -- hadn't tried pod deintegrate
previously but looks like the result is the same. Have made sure to do a fresh install of all node_modules
, pods and tried cleaning, but to no avail yet. We're getting the same result in our CI environment too.
I can see in the cpp
directory that the hidden_header
folder doesn't seem to be getting linked into the project the way I'd expect, they're present in the file system though. I'll try experimenting with the podspec tomorrow to see if I can work anything out.
It'll be really helpful for me if you can try to run this example app and let me know does it work for you.
@piaskowyk yep, can run and build the playground without issue. I suspect this is related to something specific to our brownfields app. I'll keep digging to see if I can figure anything out.
Hi guys, @piaskowyk I have same issue. can not build.
Some ideas to try: https://stackoverflow.com/questions/5198905/h-file-not-found https://stackoverflow.com/questions/33691707/xcode-cant-find-header-file
BTW, do you use Swift by any chance?
EDIT: since you use Swift I'll add one more link that maybe is relevant: https://developer.apple.com/forums/thread/69606?answerId=283546022#283546022
Thanks @jakub-gonet , will give those suggestions a try in the morning.
Yes, our app uses a good amount of swift, we’re also using swift for AppDelegate instead of Objective-C.
@levibuzolic have you found any solution?
@karo-dc I'm working on a solution now.
I'm also hitting this. It appears the issue is related to using use_frameworks!
in your Podfile:
Repro steps:
npx react-native init ReanimatedHeaderIssue --skip-install
cd ReanimatedHeaderIssue
yarn add react-native-reanimated@2.0.0
ReanimatedHeaderIssue/ios/Podfile
and add use_frameworks!
platform :ios, '10.0'
+use_frameworks!
target 'ReanimatedHeaderIssue' do
npx pod-install
ios/ReanimatedHeaderIssue.xcworkspace
and run the projectuse_frameworks!
causes a lot of issues with React Native, so let's stay away from that. This is related to how CocoaPods flattens out headers and preserves paths for hidden headers (hides them).
I'm not exactly sure what the problem on your end is, but I cannot reproduce it in my/our project 🤔
use_frameworks!
causes a lot of issues with React Native, so let's stay away from that
Unfortunately I'm working in a RN project that requires use_frameworks!
🙈 and Reanimated2 alpha releases have worked in this project the entire time.
So far that's the only difference I can find that my RN project has to a vanilla RN project, and adding use_frameworks!
to a brand new project causes the same ../../hidden_headers/Logger.h' file not found
issue. I created a simple project that repo's it https://github.com/mrbrentkelly/reanimated2-logger-not-found.
Are you saying that once this issue is fixed then the fact I'm using use_frameworks!
should be ok?
I have found solution, you can add it like static library and it will work.
pre_install do |installer| Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod| pod.name.eql?('RNReanimated') def pod.build_type; Pod::BuildType.static_library # >= 1.9 end end end end
I have found solution, you can add it like static library and it will work.
pre_install do |installer| Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod| pod.name.eql?('RNReanimated') def pod.build_type; Pod::BuildType.static_library # >= 1.9 end end end end
Nice @karo-dc 👍 I've been using something similar as a workaround as well. Feels like a workaround though rather than a true solution... I remember React Native going through something similar a while ago when use_frameworks was causing issues. I believe this is the PR that fixed that https://github.com/facebook/react-native/pull/12089
Perhaps reanimated could do something similar with header search paths in its podspec to work for projects that use the use_frameworks flag?
We're using use_frameworks!
too for Swift, so it very likely that this is the cause.
Can confirm that setting the pod to static works and our app can be built without issue.
pre_install do |installer|
installer.pod_targets.each do |pod|
if pod.name.eql?('RNReanimated')
puts "Link #{pod.name} as static_library"
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
Dug into this a bit more this morning and changing the paths slightly in ReanimatedHiddenHeaders.h
allows a project that uses use_frameworks!
to compile.
#if defined(ONANDROID)
#include "Logger.h"
#include "LoggerInterface.h"
#include "SpeedChecker.h"
#else
- #include "../../Logger.h"
- #include "../../LoggerInterface.h"
- #include "../../SpeedChecker.h"
+ #include "Common/cpp/hidden_headers/Logger.h"
+ #include "Common/cpp/hidden_headers/LoggerInterface.h"
+ #include "Common/cpp/hidden_headers/SpeedChecker.h"
#endif
Raised a PR with this suggested change https://github.com/software-mansion/react-native-reanimated/pull/1810
Awesome! 🎉 Thanks all for your commitment and help!
Description
Upgrading from
2.0.0-rc.3
to2.0.0
produces an error when building for iOS,2.0.0-rc.3
is working without issue.This appears to be related to #1775 however I haven't been able to find any reports of others facing the same issue and beleive that it's likely related to something specific in our brownfield app, but haven't been able to find a way to solve it in userland.
I'm not sure this is necessarily a bug, but any pointers on resolving it would be incredibly helpful.
Screenshots
Steps To Reproduce
I'm trying to put together a minimal reproduction, but our app is quite large closed source, so I haven't been able to extract a reproduction yet. At this stage I'm looking for tips/suggestions.
Expected behavior
App builds.
Actual behavior
App build fails. 😅
Snack or minimal code example
TBD
Package versions