构建失败,因为 react-native-reanimated

Posted

技术标签:

【中文标题】构建失败,因为 react-native-reanimated【英文标题】:Build failed because react-native-reanimated 【发布时间】:2021-11-25 15:04:51 【问题描述】:

我安装了 react-native-reanimated 但安装后我无法运行该应用程序,它一直给我以下错误。这真的令人沮丧。如果有人能指导我,我将非常感激。

/Users/rawandmajeed/Desktop/tmp/ddan/node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm:221:33: error: expected a type
/Users/rawandmajeed/Desktop/tmp/ddan/node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm:224:76: error: property 'nativeEventPath' not found on object of type '__strong id'
  eventMappingDict[@"nativeEventPath"] = RCTConvertVecToArray(eventMapping.nativeEventPath());
                                                                           ^
/Users/rawandmajeed/Desktop/tmp/ddan/node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm:226:20: error: property 'animatedValueTag' not found on object of type '__strong id'
  if (eventMapping.animatedValueTag()) 
                   ^
/Users/rawandmajeed/Desktop/tmp/ddan/node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm:227:61: error: property 'animatedValueTag' not found on object of type '__strong id'
    eventMappingDict[@"animatedValueTag"] = @(*eventMapping.animatedValueTag());
                                                            ^


** BUILD FAILED **


The following build commands failed:
        CompileC /Users/rawandmajeed/Library/Developer/Xcode/DerivedData/ddan-bfgjptmiribfbdbjbkbxincjrevk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTVibration.build/Objects-normal/x86_64/RCTVibration.o /Users/rawandmajeed/Desktop/tmp/ddan/node_modules/react-native/Libraries/Vibration/RCTVibration.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
        CompileC /Users/rawandmajeed/Library/Developer/Xcode/DerivedData/ddan-bfgjptmiribfbdbjbkbxincjrevk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTLinking.build/Objects-normal/x86_64/RCTLinkingManager.o /Users/rawandmajeed/Desktop/tmp/ddan/node_modules/react-native/Libraries/Linkingios/RCTLinkingManager.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)**

【问题讨论】:

尝试再次删除库,然后运行pod install。然后重新安装并再次在ios文件夹中运行pod install 我尝试了很多次,但它没有工作已经2天我尝试了很多东西,它没有工作 【参考方案1】:

我发现(新版本的 react-native-reanimated 即 Reanimated 2 )不适用于 react native V 0.66.0 所以我将我的 react native 版本更改为 0.64.0 我也更改了 Flipper-FollyFlipperFlipper-RSocket 版本,通过将此行添加到 Podfile

 use_flipper!( 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0','Flipper-RSocket' => '1.3.1' )

pod 安装后

一切正常

【讨论】:

以上是关于构建失败,因为 react-native-reanimated的主要内容,如果未能解决你的问题,请参考以下文章

Unity3D - 构建失败,因为“[Unity] 错误:资产标记为 HideFlags.DontSave 但包含在构建中:”

使用 Spring Security 配置 Spring Boot 会导致构建失败,因为引用缺少依赖项

无法发布,因为项目未能构建“SignFile”任务意外失败

构建失败,因为 react-native-reanimated

为啥在 Visual Studio 中构建失败,因为它无法从引用的程序集中解析命名空间?

无法构建 xcode4.3,因为获取命令失败,退出代码为 1