为什么我在 React-Native 的 Release build 中出现网络错误?
Why do I get Network error in Release build in React-Native?
这是我第一次遇到这个问题,应用程序在开发环境中运行良好。检查控制台一切正常,但是当我在网络请求期间发布 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)
。
如何解决这个问题??
在你的 androidManifest.xml 中试试这个:
<application
...
android:usesCleartextTraffic="true"
...>
...
</application>
重新捆绑并重建apk,希望对有疑惑的人有所帮助。
这是我第一次遇到这个问题,应用程序在开发环境中运行良好。检查控制台一切正常,但是当我在网络请求期间发布 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)
。
如何解决这个问题??
在你的 androidManifest.xml 中试试这个:
<application
...
android:usesCleartextTraffic="true"
...>
...
</application>
重新捆绑并重建apk,希望对有疑惑的人有所帮助。