android - fetch SyntaxError: Unexpected token U in JSON at position 0 in react native Android
问题描述
我正在将 fetch 用于“https” GET 请求,它在 IOS 中运行良好,但在 android中的位置 0 处抛出SyntaxError: Unexpected token U in JSON at position 0错误。当我检查状态它是“状态 401”时,我什至检查了我的域的等级它的“A”等级。
这是我的 build.gradle
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
我的反应和反应本机版本如下
"react": "16.9.0",
"react-native": "0.61.4"
我什至尝试在我的 AndroidManifes.xml 文件中添加以下代码。
android:usesCleartextTraffic="true" tools:targetApi="28"
我尝试了一切,但我不知道是什么问题,请帮助谢谢。
解决方案
推荐阅读
- reactjs - 在执行时更改对象引用
- spring-boot - Springboot 2.2 和 graphql RawClassRequiredForGraphQLMappingException: Entity cannot be mapped to a GraphQL type
- pkcs#7 - 在tomcat 8.5上部署war文件
- c# - Application not showing updated string value
- python-3.x - convert the image to rgb so that i can visualize the image
- php - 成功登录我的网站后,如何正确地进行会话
- php - 如何通过许多 id-s 从 DB 中获取行
- fortran - How to fix 'undefined reference to _gfortran_concat_string and to _gfortran_etime when building MXNET?
- php - magento 2 使用 installschema 在多个列上添加唯一键
- javascript - 将格式正确的 JSON 对象从 PHP 返回到 JS