0

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

but i'm having an issue with configuring https://github.com/terrylinla/react-native-sketch-canvas 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
Kevorkian
  • 396
  • 5
  • 12

1 Answers1

0

So I just got metro to bundle my js files correctly. I discovered it was something to do with the react-native android gradle it's very confusing. But I just restarted my computer and ran the same commands. That fixed it.

these stackoverflow answers worked before for me to get my build working:

Stuck on info starting JS server

React-native run-android stuck at 99% appDebug

I hope this helps to anyone using create-react-native-app & metro-bundler

Kevorkian
  • 396
  • 5
  • 12