-
问题背景
这个报错经常出现在我们使用诸如 React-Native-Navigation 组件切换导航或路由时的场景,似乎每个RN开发者都有此经历,频发高地。
Warning:
setState(...): Can only update a mounted or mounting component.
This usually means you called setSta...
-
问题背景
编译报错:expected a component class, got [object Object]
问题原因
解决方案
正确命名和使用组件,即:无论是定义或使用组件,其首字母必须是大写字母
-
问题背景
// 创建websocket
ws = new WebSocket("ws://192.168.1.234:7272");
// 当socket连接打开时
ws.onopen = () => { ...
-
运行环境
software
version
react-navigation
1.0.0-beta.11
react-native
0.44.2
...
-
问题背景
表单中创建了一个文本框和一个注册按钮,在点击文本框获得焦点输入数据之后,然后再去点击注册按钮,结果发现:我必须在按钮上点击2次,第一次是关闭键盘,第二次点击才会触发OnPress事件。
解决方案
确保ScrollView组件的 keyboardShouldPersistTaps='...
-
问题背景
编译RN报错:Error:(84, 7) No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
问题原因
1. compileSdkVersion 版本低于 26.0.X 会引起问题
2. compileS...
-
问题背景
开启Hot Loading情况下,更换头像图片,RN报错: Unexpected character ‘�’ (1:0)
问题原因
待确认......
解决方案
切记重新编译一遍是没有用的,必须重启 react native packager。
-
问题背景
编译报错:/path/to/UpgradePackage.java:26: 错误: 方法不会覆盖或实现超类型的方法
> Task :app:compileDebugJavaWithJavac
/path/to/UpgradePackage.java:26: 错误: 方法不会覆盖或实现超类型的方法
@Override
^
1 个错误...
-
问题背景
编译 react-native-image-crop-picker 报错:Could not find com.github.yalantis:ucrop:2.2.1-native
问题原因
缺少maven源
解决方案
vim /path/to/project/android/build.gradle,并行配置多个 maven 源:
...
-
问题背景
同样是在升级 gradle plugin V2.2.3 --> gradle plugin V3.0.1后,运行至打包APK期间报错:
Error:found unexpected optical bounds (red pixel) on top border at x=14.
Error:java.util.concurrent.Exe...
-
问题背景
React Native编译报错:Error:Failed to resolve: com.android.support:multidex:1.0.2
解决方案
问题本质一样,请移步金牛座另一篇博文寻找答案:http://www.blogdaren.com/post-2435.html
-
问题背景
同样是在升级 gradle plugin V2.2.3 --> gradle plugin V3.0.1后,运行至打包APK期间报错:
FAILURE: Build failed with an exception.
* Where:
Build file '/path/to/Project/android/app/build.gradle' line: 150
...
-
问题背景
升级 gradle plugin V2.2.3 --> gradle plugin V3.0.1后,运行报错:
* What went wrong:
A problem occurred configuring root project 'demoProject'.
> Could not resolve all files for configuration...
-
问题背景:
问题原因:
根据错误提示showAlert,推断原因应该是Alert参数类型错误,请仔细排查自己代码中调用 Alert.alert() 的地方。
问题解决:
Alert.alert('Fetch Error', e.message);
-
问题背景:
使用 npm install 安装依赖包时,会发现安装速度特别慢。
问题原因:
这是因为npm官方镜像速度太慢造成【默认官方镜像是:https://registry.npmjs.org/】。
获取当前默认镜像:
npm config get registry
更换为淘宝镜像:
npm config set registry https:/...
我就遇到了这个问题,终于找到解决办法...