Android模拟器网络请求失败+Hook调用错误,iOS模拟器正常求助
Expo+React Native+Apollo项目Android模拟器测试异常问题
- 首次配置Android Studio/Android Emulator,用于测试基于Expo、React Native和Apollo GraphQL开发的项目
- iOS模拟器测试完全正常,登录及页面跳转功能无问题
- Android模拟器中登录应用时,设备提示「无效凭证」,终端报错:
{ "name": "ApolloError", "graphQLErrors": [], "clientErrors": [], "networkError": { "line": 21252, "column": 33, "sourceURL": "..." }, "message": "Network request failed", "line": 142425, "column": 30, "sourceURL": "..." }
- 尝试创建新用户时同样报错,错误信息如下:
Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as React DOM) 2. You might be breaking the Rules of Hooks 3. You might have more than one copy of React in the same app See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem. LOG [Network error]: TypeError: Network request failed LOG true LOG { "name": "ApolloError", "graphQLErrors": [], "clientErrors": [], "networkError": { "line": 21252, "column": 33, "sourceURL": "..." }, "message": "Network request failed", "line": 142425, "column": 30, "sourceURL": "..." }
- 模拟器提示错误出自
useNavigation.tsx,但项目中不存在该文件
请问该问题的原因是什么?求解决建议,谢谢!
内容的提问来源于stack exchange,提问作者pelotador.1
相关产品推荐
相关产品推荐

