react-native icon indicating copy to clipboard operation
react-native copied to clipboard

unstable_reactLegacyComponentNames IOS Issue

Open affansk opened this issue 1 year ago • 2 comments

Description

i get this Failure Error in IOS when i make use of this unstable_reactLegacyComponentNames: ['BVLinearGradient'] to support in new architecture

Thread Performance Checker: Thread running at QOS_CLASS_USER_INTERACTIVE waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions

Assertion failed: (module), function constructCoordinator, file LegacyViewManagerInteropComponentDescriptor.mm, line 64.

React Native Version

0.72.0

Output of npx react-native info

Assertion failed: (module), function constructCoordinator, file LegacyViewManagerInteropComponentDescriptor.mm, line 64

Steps to reproduce

  1. Add unstable_reactLegacyComponentNames in react native config file for the component which is not compatible with new architecture
  2. run the xcode
  3. the build will be successfull
  4. the xcode will crash with above error

Snack, code example, screenshot, or link to a repository

just add this in react-native config file project: { ios: { unstable_reactLegacyComponentNames: ['BVLinearGradient'], }, android: {}, // grouped into "project" },

affansk avatar Jun 15 '23 06:06 affansk

:warning: Missing Reproducible Example
:information_source: It looks like your issue is missing a reproducible example. Please provide either:

github-actions[bot] avatar Jun 15 '23 15:06 github-actions[bot]

We would need a full repro to look into this. Also: what is BVLinearGradient? Which library is exposing it? Is it a component you created?

cortinico avatar Jun 15 '23 15:06 cortinico

@cortinico the library could be this one. I'm, getting the exact same error with the package's latest release 2.7.3.

cpintos-sc avatar Jun 22 '23 20:06 cpintos-sc

@cpintos-sc thanks for the update. Does the issue happen on both Android & iOS?

cortinico avatar Jun 23 '23 10:06 cortinico

@cortinico sorry for late reply, i just tested on Android with version 0.72.0, its working fine. On IOS I can still see that issue.

project: { ios: { unstable_reactLegacyComponentNames: ['BVLinearGradient','RNSVGImage'], }, android: { unstable_reactLegacyComponentNames: ['BVLinearGradient', 'RNSVGImage'], }, // grouped into "project" },

Update : @cortinico i guess the problem is with this package https://github.com/react-native-linear-gradient/react-native-linear-gradient

i just use unstable_reactLegacyComponentNames only with RNSVGImage for IOS. it works fine.

affansk avatar Jun 23 '23 11:06 affansk

is the actionable that something needs to be changed in linear-gradient, or in the interop layer?

kelset avatar Jun 26 '23 10:06 kelset

not 100% Percent sure! i guess need to change in linear-gradient package. there is already a PR https://github.com/react-native-linear-gradient/react-native-linear-gradient/pull/606 for New architecture

affansk avatar Jun 26 '23 13:06 affansk

Hi, just to let you know. There is already a forked version of that project that supports the fabric renderer, rnx-gradient. And JUST IN CASE! you are happening to use react-native-skeleton-placeholder here is a patch for that package that replaces the old react-native-linear-gradient for the one that supports fabric. This solved my issues! Hope it helps. cc: @affansk

cpintos-sc avatar Jun 26 '23 21:06 cpintos-sc

Update : @cortinico i guess the problem is with this package react-native-linear-gradient/react-native-linear-gradient

i just use unstable_reactLegacyComponentNames only with RNSVGImage for IOS. it works fine.

Given this, I'd probably close this issue and ask @affansk to eventually open an issue in the react-native-linear-gradient repo as this looks more like a lib problem rather than an interop layer problem. Opinions @affansk, @cortinico, @kelset?

cipolleschi avatar Jun 27 '23 10:06 cipolleschi

Yup let's close this as multiple alternatives have been raised.

cortinico avatar Jun 27 '23 11:06 cortinico

Actually, this highlighted a shortcoming of the Interop Layer for iOS, so I'm looking into this. A PR will come soon

cipolleschi avatar Jun 27 '23 12:06 cipolleschi

module.exports = {
    project: {
      ios: {
        unstable_reactLegacyComponentNames: [
          'FastImageView',
        ],
      },
      android: {},
    },
    // assets: ['./src/assets/fonts'],
  };

Crash 截屏2023-10-23 18 05 35

renyufei8023 avatar Oct 23 '23 10:10 renyufei8023

@renyufei8023 can you share which library are you using? I guess it is react-native-fastimage but could be wrong.

What's happening here is that FastImage is probably not following one of the supported convention to define the ViewManager and, therefore, the InteropLayer fails to create it.

I can look into how the view manager is called and see if we can extend the interop layer somehow.

cipolleschi avatar Oct 23 '23 10:10 cipolleschi

这里发生的情况是 FastImage 可能没有遵循定义 ViewManager 的受支持约定之一,因此 InteropLayer 无法创建它。

我可以研究如何调用视图管理器,看看我们是否可以以某种方式扩展互操作层。

I am currently using react native fast image,repo:https://github.com/DylanVann/react-native-fast-image#readme

renyufei8023 avatar Oct 24 '23 01:10 renyufei8023