为什么我在React-Native的Release版本中出现网络错误?

问题描述 投票:0回答:1

这是我第一次遇到此问题,该应用程序在开发环境中运行良好。检查了控制台,一切正常,但是当我在网络请求期间发布apk时,应用抛出错误Network Error

03-11 18:59:26.362  2188  2202 I system_server: Background young concurrent copying GC freed 73297(5652KB) AllocSpace objects, 2(40KB) LOS objects, 20% free, 22MB/28MB, paused 2.084ms total 305.053ms
03-11 18:59:26.740  1751 29331 E ResolverController: No valid NAT64 prefix (101, <unspecified>/0)
03-11 18:59:26.842  1768  1935 D gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 184320
03-11 18:59:26.875  1768  1935 D gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 184320
03-11 18:59:26.893 29260 29278 D EGL_emulation: eglMakeCurrent: 0xd641a120: ver 2 0 (tinfo 0xd640f330)
03-11 18:59:26.904  1768  1935 D gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 184320
03-11 18:59:27.239  1767  2527 E GnssHAL_GnssInterface: gnssSvStatusCb: a: input svInfo.flags is 8
03-11 18:59:27.239  1767  2527 E GnssHAL_GnssInterface: gnssSvStatusCb: b: input svInfo.flags is 8
03-11 18:59:28.238  1767  2527 E GnssHAL_GnssInterface: gnssSvStatusCb: a: input svInfo.flags is 8
03-11 18:59:28.238  1767  2527 E GnssHAL_GnssInterface: gnssSvStatusCb: b: input svInfo.flags is 8
03-11 18:59:29.056  1758  2036 W audio_hw_generic: Not supplying enough data to HAL, expected position 145902833 , only wrote 145685061
03-11 18:59:29.238  1767  2527 E GnssHAL_GnssInterface: gnssSvStatusCb: a: input svInfo.flags is 8
03-11 18:59:29.238  1767  2527 E GnssHAL_GnssInterface: gnssSvStatusCb: b: input svInfo.flags is 8
03-11 18:59:30.238  1767  2527 E GnssHAL_GnssInterface: gnssSvStatusCb: a: input svInfo.flags is 8
03-11 18:59:30.238  1767  2527 E GnssHAL_GnssInterface: gnssSvStatusCb: b: input svInfo.flags is 8
03-11 18:59:30.278 29260 29278 D EGL_emulation: eglMakeCurrent: 0xd641a120: ver 2 0 (tinfo 0xd640f330)
03-11 18:59:30.303  2188  3093 W NotificationService: Toast already killed. pkg=com.assignment callback=android.app.ITransientNotification$Stub$Proxy@6847bdb
03-11 18:59:31.110 28097 28107 W webview_servic: Reducing the number of considered missed Gc histogram windows from 149 to 100
03-11 18:59:31.239  1767  2527 E GnssHAL_GnssInterface: gnssSvStatusCb: a: input svInfo.flags is 8
03-11 18:59:31.239  1767  2527 E GnssHAL_GnssInterface: gnssSvStatusCb: b: input svInfo.flags is 8

这是运行发行版apk时的日志,我认为错误是此No valid NAT64 prefix (101, <unspecified>/0)

如何解决此问题?

react-native react-native-android react-native-ios
1个回答
0
投票

在您的androidManifest.xml中尝试一下:

<application
        ...
        android:usesCleartextTraffic="true"
        ...>
        ...
</application>

再次捆绑并重建apk,希望它有助于摆脱困境。

© www.soinside.com 2019 - 2024. All rights reserved.