【发布时间】:2021-01-15 20:58:45
【问题描述】:
我是 react-native 的新手,这个社区很棒。
但我在使用 npx create-react-native-app 配置 https://github.com/terrylinla/react-native-sketch-canvas 时遇到问题。
到目前为止我所做的只是编辑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,
},
}),
},
};
然后 cmd react-native run-android 它会正确捆绑,但它永远不会加载到模拟器上:
这就是它在 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
【问题讨论】:
标签: react-native metro-bundler