gpt4 book ai didi

android - 应用程序仅在真实设备上崩溃 | react 原生 |世博会

转载 作者:行者123 更新时间:2023-12-04 23:45:18 25 4
gpt4 key购买 nike

我的应用程序是使用 Expo 开发的,该应用程序在 Expo Go 应用程序或任何模拟器上完美运行,0 错误、0(代码警告)和流畅,我最近生成了一个 APK 文件并想在真实设备上对其进行测试,所有 android 设备每次在加载时或加载特定屏幕时都会在非常不同的屏幕上崩溃
使用android studio并分析APK文件,加载时弹出以下错误,并且“java.lang.IllegalArgumentException:Unexpected type in an array: class org.json.JSONObject”恰好在crash时,我觉得这是主要原因它崩溃了(Logcat实际上说崩溃开始了),我不知道我做错了什么,是代码中的东西,库还是什么
完整的堆栈跟踪

2021-05-09 18:32:12.110 10581-10581/com.example.app E/f: Failed to clear legacy OkHttp cache
java.io.IOException: not a readable directory: /data/user/0/com.example.app/files/okhttp
at okhttp3.internal.io.FileSystem$1.deleteContents(FileSystem.java:7)
at okhttp3.internal.cache.DiskLruCache.delete(DiskLruCache.java:2)
at okhttp3.Cache.delete(Cache.java:1)
at host.exp.exponent.q.f.b(ExponentNetwork.java:4)
at host.exp.exponent.q.f.<init>(ExponentNetwork.java:7)
at host.exp.exponent.m.a.<init>(NativeModuleDepsProvider.java:7)
at host.exp.exponent.m.a.c(NativeModuleDepsProvider.java:2)
at g.a.a.b.<init>(Exponent.java:7)
at g.a.a.b.m(Exponent.java:2)
at host.exp.exponent.e.onCreate(ExpoApplication.java:9)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5871)
at android.app.ActivityThread.access$1100(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
2021-05-09 18:32:12.379 10581-10636/com.example.app E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
2021-05-09 18:32:12.379 10581-10636/com.example.app E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
2021-05-09 18:32:12.425 10581-10636/com.example.app E/eglCodecCommon: GoldfishAddressSpaceHostMemoryAllocator: ioctl_ping failed for device_type=5, ret=-1
2021-05-09 18:32:13.679 10581-10666/com.example.app E/h: java.net.MalformedURLException: no protocol:
2021-05-09 18:32:13.748 10581-10581/com.example.app E/e: java.lang.RuntimeException: A TaskDescription's primary color should be opaque
2021-05-09 18:32:13.777 10581-10667/com.example.app E/h: java.net.MalformedURLException: no protocol:
2021-05-09 18:32:13.785 10581-10581/com.example.app E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.app, PID: 10581
java.lang.IllegalArgumentException: Unexpected type in an array: class org.json.JSONObject
at com.facebook.internal.BundleJSONConverter$7.setOnBundle(BundleJSONConverter.java:10)
at com.facebook.internal.BundleJSONConverter.convertToBundle(BundleJSONConverter.java:10)
at host.exp.exponent.experience.v.A(ReactNativeActivity.java:53)
at host.exp.exponent.experience.ExperienceActivity$e.onSuccess(ExperienceActivity.java:1)
at g.a.a.b.w(Exponent.java:1)
at host.exp.exponent.experience.ExperienceActivity.B(ExperienceActivity.java:1)
at host.exp.exponent.experience.ExperienceActivity$d.execute(ExperienceActivity.java:4)
at host.exp.exponent.t.c.c(AsyncCondition.java:2)
at host.exp.exponent.experience.ExperienceActivity.t0(ExperienceActivity.java:4)
at host.exp.exponent.experience.ExperienceActivity$b.f(ExperienceActivity.java:1)
at host.exp.exponent.experience.ExperienceActivity$b.g(Unknown Source:0)
at host.exp.exponent.experience.f.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
我在项目中使用的包:
  "dependencies": {
"@expo-google-fonts/inter": "^0.1.0",
"@react-native-async-storage/async-storage": "^1.13.0",
"@react-native-community/masked-view": "0.1.10",
"@react-native-community/slider": "3.0.3",
"@react-navigation/bottom-tabs": "^5.11.9",
"@react-navigation/native": "^5.9.4",
"@react-navigation/stack": "^5.14.4",
"@reduxjs/toolkit": "^1.5.1",
"axios": "^0.21.1",
"expo": "^41.0.0",
"expo-font": "~9.1.0",
"expo-localization": "~10.1.0",
"expo-splash-screen": "~0.10.2",
"expo-status-bar": "~1.0.4",
"expo-updates": "~0.5.4",
"i18n-js": "^3.8.0",
"moment": "^2.29.1",
"native-base": "^2.15.2",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "0.63.4",
"react-native-calendars": "^1.1258.0",
"react-native-check-box": "^2.1.7",
"react-native-gesture-handler": "~1.10.2",
"react-native-i18n": "^2.0.15",
"react-native-maps": "0.27.1",
"react-native-material-dropdown": "^0.11.1",
"react-native-reanimated": "~2.1.0",
"react-native-safe-area-context": "3.2.0",
"react-native-screens": "~3.0.0",
"react-native-snap-carousel": "^3.9.1",
"react-native-svg": "12.1.0",
"react-native-svg-transformer": "^0.14.3",
"react-native-unimodules": "~0.13.3",
"react-native-web": "~0.13.12",
"react-navigation": "^4.4.4",
"react-navigation-stack": "^2.10.4",
"react-redux": "^7.2.3",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"@babel/core": "~7.9.0",
"@expo/webpack-config": "~0.12.63",
"@svgr/webpack": "^5.5.0",
"babel-jest": "~25.2.6",
"jest": "~25.2.6",
"react-test-renderer": "~16.13.1"
},
编辑:
我高度认为问题出在 react-native-maps 库中,我要么配置不正确,要么包有一些错误。
编辑:
通过从“react-native-maps”中删除 MapView 解决了上述问题。
这是代码
              <MapView
initialRegion={{
latitude: Number(lat),
longitude: Number(lng),
latitudeDelta: 0.005,
longitudeDelta: 0.005,
}}
>
<Marker
coordinate={{
latitude: Number(lat),
longitude: Number(lng),
}}
title={name}
/>
</MapView>

最佳答案

我有同样的问题。
我在 react-native-maps Github 存储库中发现了这个错误:
https://github.com/react-native-maps/react-native-maps/issues/3652
尝试在 app.json 中添加您的 API key ,如下所示:
https://github.com/react-native-maps/react-native-maps/issues/3652#issuecomment-751512109

关于android - 应用程序仅在真实设备上崩溃 | react 原生 |世博会,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67459462/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com