- 1.原生壳子报错:’Application XXX has not been registered’
- 2.原生壳子加载bundle时报错:’java.lang.IllegalStateException: Expected a string but was BEGIN_ARRAY’
- 3.引入iconfont后原生工程报错:’requireNativeComponent: “RNSVGPath” was not found in the UIManager’
- 4.引入iconfont后原生工程报错:’@androidx.annotation.NonNull’找不到类
- 5.引入的iconfont图标不显示
- 6.taro工程icon-font编译不通过
- 7.taro1.x不支持async/await
- 8.引入axios-taro库后RN端加载bundle失败
- 9.mobx在RN端不支持es6的类语法
- 10.壳子工程报错’ERROR: [TAG] Failed to resolve variable ‘${animal.sniffer.version}‘
- 11.Windows小程序调试时报错:‘Error: Missing binding F:\taro\Taro-Demo\node_modules\node-sass\vendor\win32-x64-64\binding.node
- Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 10.x’
- 12.UnhandledPromiseRejectionWarning: TypeError: items.forEach is not a function
- 13 taro-ui部分组件在小程序中,样式文件全部丢失
1.原生壳子报错:’Application XXX has not been registered’
必须保证编译配置文件的rn配置项中name字段和壳子工程MainActivity.java中的getMainComponentName保持一致
2.原生壳子加载bundle时报错:’java.lang.IllegalStateException: Expected a string but was BEGIN_ARRAY’
Taro工程中依赖的rn版本号必须和原生壳子工程依赖的版本号保持一致
3.引入iconfont后原生工程报错:’requireNativeComponent: “RNSVGPath” was not found in the UIManager’
原生壳子工程安装依赖库并建立连接
yarn add react-native-svg
react-native link react-native-svg
4.引入iconfont后原生工程报错:’@androidx.annotation.NonNull’找不到类
在报错的module里添加依赖:implementation ‘androidx.annotation:annotation:1.0.2’
5.引入的iconfont图标不显示
iconfont.json中默认设置了前缀icon,所以用的时候,icon-font组件的name属性值要去掉icon前缀
6.taro工程icon-font编译不通过
对应RN版本必须是0.59.9,低版本的不支持icon-font库
7.taro1.x不支持async/await
安装@tarojs/async-await库,所有用到这个异步语法的文件必须:import ‘@tarojs/async-await’
8.引入axios-taro库后RN端加载bundle失败
暂时无解,放弃使用axios,使用官方request的api
9.mobx在RN端不支持es6的类语法
10.壳子工程报错’ERROR: [TAG] Failed to resolve variable ‘${animal.sniffer.version}‘
as:File->Invalidate Caches / restart,不再报错了。
11.Windows小程序调试时报错:‘Error: Missing binding F:\taro\Taro-Demo\node_modules\node-sass\vendor\win32-x64-64\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 10.x’
windows电脑上这个错误是因为node和node-sass版本 不匹配,需要彻底卸载node-sass,然后再重新安装即可
12.UnhandledPromiseRejectionWarning: TypeError: items.forEach is not a function
使用高版本的taro-cli来编译低版本的taro工程时导致的
13 taro-ui部分组件在小程序中,样式文件全部丢失
如果taro脚手架用的1.x版本,那么对应的taro-ui的版本不要高过2.0,一般1.5.4就够了