react-native-reanimated: 2.0.0 stable build error on iOS - `hidden_headers/Logger.h` not found

Description

Upgrading from 2.0.0-rc.3 to 2.0.0 produces an error when building for iOS, 2.0.0-rc.3 is working without issue.

[12:46:26]: ▸ Linking React
[12:46:26]: ▸ Compiling WorkletsCache.cpp
[12:46:26]: ▸ Compiling WorkletEventHandler.cpp
[12:46:26]: ▸ Compiling UIResponder+Reanimated.mm
[12:46:26]: ▸ Compiling ShareableValue.cpp
[12:46:26]: ▸ Compiling Scheduler.cpp
[12:46:26]: ▸ Compiling RuntimeDecorator.cpp
[12:46:26]: ▸ ❌  /Users/levi/src/project/native/node_modules/react-native-reanimated/Common/cpp/headers/Tools/ReanimatedHiddenHeaders.h:10:14: '../../hidden_headers/Logger.h' file not found
[12:46:26]: ▸     #include "../../hidden_headers/Logger.h"
[12:46:26]: ▸ ^

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

image

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

  • React: 16.13.1
  • React Native: 0.63.4
  • React Native Reanimated: 2.0.0
  • NodeJS: 15.3.0

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 18 (14 by maintainers)

Commits related to this issue

Most upvoted comments

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

Hi guys, @piaskowyk I have same issue. can not build.

Screen Shot 2021-03-08 at 3 05 37 PM Screen Shot 2021-03-08 at 3 04 42 PM

Awesome! 🎉 Thanks all for your commitment and help!

@karo-dc I’m working on a solution now.

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.

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?

I’m also hitting this. It appears the issue is related to using use_frameworks! in your Podfile:

Repro steps:

  • Create new project
npx react-native init ReanimatedHeaderIssue --skip-install
cd ReanimatedHeaderIssue
yarn add react-native-reanimated@2.0.0
  • Open ReanimatedHeaderIssue/ios/Podfile and add use_frameworks!
platform :ios, '10.0'

+use_frameworks!

target 'ReanimatedHeaderIssue' do
  • Close Podfile and run npx pod-install
  • Open ios/ReanimatedHeaderIssue.xcworkspace and run the project