terrylinla / react-native-sketch-canvas

A React Native component for drawing by touching on both iOS and Android.
MIT License
692 stars 450 forks source link

How to configure with create-react-native-app metro bundler. #191

Closed colelogan closed 3 years ago

colelogan commented 3 years ago

I'm new to react-native, this repo is awesome.

but i'm having an issue with configuring it with npx create-react-native-app .

all I've done so far is edit the metro.config.js


const extraNodeModules = {
  '@terrylinla/react-native-sketch-canvas': './node_modules/@terrylinla\react-native-sketch-canvas/'
}

const resolverMainFields = ['browser','main'];

module.exports = {
  resolver: {
    extraNodeModules,
    resolverMainFields
  },
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: false,
      },
    }),
  },
};

then cmd react-native run-android it bundles correctly but it never loads onto the emulator:

this is what it says in shell:

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. (node:8712) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use node --trace-warnings ... to show where the warning was created) Jetifier found 987 file(s) to forward-jetify. Using 4 workers... info Starting JS server... info Launching emulator... info Successfully launched emulator. info Installing the app...

Configure project :terrylinla_react-native-sketch-canvas WARNING: Configuration 'provided' is obsolete and has been replaced with 'compileOnly'. It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

Task :app:stripDebugDebugSymbols UP-TO-DATE Compatible side by side NDK version was not found. <============-> 99% EXECUTING [10m 30s] IDLE IDLE :app:installDebug IDLE

colelogan commented 3 years ago

I using expo too. Can you show me how to configure this with expo?