Open delorali opened 4 years ago
Same issue here. I really hope this is fixed, because there aren't really any sketch components out there that are maintained.
Same issue encountered here, can be fixed by swapping the following:
// SketchCanvas.MAIN_BUNDLE = Platform.OS === 'ios' ? UIManager.RNSketchCanvas.Constants.MainBundlePath : '';
// SketchCanvas.DOCUMENT = Platform.OS === 'ios' ? UIManager.RNSketchCanvas.Constants.NSDocumentDirectory : '';
// SketchCanvas.LIBRARY = Platform.OS === 'ios' ? UIManager.RNSketchCanvas.Constants.NSLibraryDirectory : '';
// SketchCanvas.CACHES = Platform.OS === 'ios' ? UIManager.RNSketchCanvas.Constants.NSCachesDirectory : '';
SketchCanvas.MAIN_BUNDLE = Platform.OS === 'ios' ? UIManager['getConstants'].MainBundlePath : '';
SketchCanvas.DOCUMENT = Platform.OS === 'ios' ? UIManager['getConstants'].NSDocumentDirectory : '';
SketchCanvas.LIBRARY = Platform.OS === 'ios' ? UIManager['getConstants'].NSLibraryDirectory : '';
SketchCanvas.CACHES = Platform.OS === 'ios' ? UIManager['getConstants'].NSCachesDirectory : '';
@sadelbrid @delorali
this guy already forked the project and fixed those errors: https://github.com/terrylinla/react-native-sketch-canvas/pull/107/files
@colelogan @dottd-admin
I linked the repo following the instructions and am also getting this error. Where does that code snippet need to be changed? I don't see a src/SketchCanvas.js on my end, does that mean I linked it wrong?
Any update on this? I'm using expo
Any update on this? I'm using expo
I'm using expo too and having the same error
SketchCanvas.MAIN_BUNDLE = Platform.OS === 'ios' ? UIManager['getConstants'].MainBundlePath : ''; SketchCanvas.DOCUMENT = Platform.OS === 'ios' ? UIManager['getConstants'].NSDocumentDirectory : ''; SketchCanvas.LIBRARY = Platform.OS === 'ios' ? UIManager['getConstants'].NSLibraryDirectory : ''; SketchCanvas.CACHES = Platform.OS === 'ios' ? UIManager['getConstants'].NSCachesDirectory : '';
This works for me, but now I have another error : requireNativeComponent: "RNSketchCanvas" was not found in the UIManager.
I'm using this component:
<View style={styles.container}>
<View style={{ flex: 1, flexDirection: 'row' }}>
<SketchCanvas
style={{ flex: 1 }}
strokeColor={'red'}
strokeWidth={7}
/>
</View>
</View>
requireNativeComponent: "RNSketchCanvas" was not found in the UIManager.
I also face this problem using Expo
Hi @terrylinla , I installed the package, and automatically linked it. However, when I try to run the example code in my project, I get the error Unhandled JS Exception: Error: Requiring module "node_modules/.../SketchCanvas.js", which threw an exception: TypeError: undefined is not an object (evaluating '_reactNative.UIManager.RNSketchCanvas.Constants')
Has anyone had experience dealing with this error before? Also, does someone know if this has to do with an automatically linking error?
Thanks