wonsikin / react-native-barcode-builder

Component for generating barcode in react native app
Other
175 stars 116 forks source link

No component found for view with name "ARTShape" #49

Closed cdesch closed 4 years ago

cdesch commented 4 years ago

After Upgrading from Expo 35 to Expo 36 [React 16.8.3 -> 16.9.0 and React Native 0.59.8 -> 0.61.4] I receive this error with the Barcode Builder: No component found for view with name "ARTShape"

Error Dump

No component found for view with name "ARTShape"

-[ABI36_0_0RCTUIManager createView:viewName:rootTag:props:]
    ABI36_0_0RCTUIManager.m:949
__invoking___
-[NSInvocation invoke]
-[NSInvocation invokeWithTarget:]
-[ABI36_0_0RCTModuleMethod invokeWithBridge:module:arguments:]
ABI36_0_0facebook::ABI36_0_0React::invokeInner(ABI36_0_0RCTBridge*, ABI36_0_0RCTModuleData*, unsigned int, folly::dynamic const&)
invocation function for block in ABI36_0_0facebook::ABI36_0_0React::ABI36_0_0RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_lane_serial_drain
_dispatch_lane_invoke
_dispatch_workloop_worker_thread
_pthread_wqthread
start_wqthread
Screen Shot 2019-12-12 at 1 17 43 PM
cdesch commented 4 years ago

Looks like for react-native >= 0.60, we will need to include @react-native-community/art as per the deprecation of ART

Error is replicated here: https://github.com/cdesch/barcode-test/tree/ErrorReference

When adding @react-native-community/art and changing the following code to the project I get a new error.

Code:

import {ART} from 'react-native';
const {Surface, Shape} = ART;

to:

import {Surface, Shape} from '@react-native-community/art';

New Error:

Invariant Violation: requireNativeComponent: "ARTShape" was not found in the UIManager.

This error is located at:
    in ARTShape (at Shape.js:58)
    in Shape (at react-native-barcode-builder/index.js:174)
    in ARTSurfaceView (at Surface.js:37)
    in Surface (at react-native-barcode-builder/index.js:173)
    in RCTView (at react-native-barcode-builder/index.js:172)
    in Barcode (at BarcodeComponent.tsx:21)
    in RCTView (at BarcodeComponent.tsx:17)
    in BarcodeComponent (at App.tsx:9)
    in RCTView (at App.tsx:7)
    in App (at withExpoRoot.js:26)
    in RootErrorBoundary (at withExpoRoot.js:25)
    in ExpoRoot (at renderApplication.js:40)
    in RCTView (at AppContainer.js:101)
    in DevAppContainer (at AppContainer.js:115)
    in RCTView (at AppContainer.js:119)
    in AppContainer (at renderApplication.js:39)

getNativeComponentAttributes
    getNativeComponentAttributes.js:30:4
exports.get
    ReactNativeViewConfigRegistry.js:102:25
renderRoot
    [native code]:0
runRootCallback
    [native code]:0
unstable_runWithPriority
    scheduler.development.js:643:23
renderApplication
    renderApplication.js:52:52
runnables.appKey.run
    AppRegistry.js:116:10
runApplication
    AppRegistry.js:197:26
callFunctionReturnFlushedQueue
    [native code]:0
Screen Shot 2019-12-17 at 11 51 19 AM
cdesch commented 4 years ago

There seems to be an effort to add ART to EXPO

https://forums.expo.io/t/please-add-react-native-community-art-to-expo-sdk/31100 and https://expo.canny.io/feature-requests/p/continued-support-for-art

I can't get the Example to run in Development to try to apply a update. @wonsikin what is the process to get Example running?

Run installer

    npm install
    cd Example
    npm install
    yarn start
    npx react-native run-ios --device="iPhone 6s"
cdesch commented 4 years ago

ART was removed from RN and in Expo 36 (issue 6482).

This library will need to be migrated to SVG for it to work at all.

gang544043963 commented 4 years ago

@cdesch So, have you solved this issue? I met the same issue