我将我的expo应用程序从sdk45升级到49,并且必须根据更改更改一些代码。
使用“npx expo start”测试应用程序效果很好,但是,当使用本地和eas云(eas build --platform android --local)构建apk时,应用程序立即崩溃,启动画面尚未显示并且应用程序不断停止发生对话框。 adb logcat 给了我这个:
--------- beginning of crash
01-18 18:29:28.019 5609 5609 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8 in tid 5609 (c.eACDS.hybrid2), pid 5609 (c.eACDS.hybrid2)
01-18 18:29:28.051 5678 5678 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstoneProto
01-18 18:29:28.051 213 213 I tombstoned: received crash request for pid 5609
01-18 18:29:28.052 5678 5678 I crash_dump64: performing dump of process 5609 (target tid = 5609)
01-18 18:29:28.191 5609 5661 I ReactNativeJS: Running "main
01-18 18:29:28.209 5609 5662 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.swmansion.rnscreens.ScreensShadowNode
01-18 18:29:28.213 5609 5662 D CompatibilityChangeReporter: Compat change id reported: 289878283; UID 10193; state: DISABLED
01-18 18:29:28.255 5678 5678 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-18 18:29:28.255 5678 5678 F DEBUG : Build fingerprint: 'google/sdk_gphone64_x86_64/emu64xa:14/UE1A.230829.036.A1/11228894:user/release-keys'
01-18 18:29:28.255 5678 5678 F DEBUG : Revision: '0'
01-18 18:29:28.255 5678 5678 F DEBUG : ABI: 'x86_64'
01-18 18:29:28.255 5678 5678 F DEBUG : Timestamp: 2024-01-18 18:29:28.063270894+0700
01-18 18:29:28.255 5678 5678 F DEBUG : Process uptime: 2s
01-18 18:29:28.255 5678 5678 F DEBUG : Cmdline: com.seafdec.eACDS.hybrid2
01-18 18:29:28.255 5678 5678 F DEBUG : pid: 5609, tid: 5609, name: c.eACDS.hybrid2 >>> com.seafdec.eACDS.hybrid2 <<<
01-18 18:29:28.255 5678 5678 F DEBUG : uid: 10193
01-18 18:29:28.255 5678 5678 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000008
01-18 18:29:28.255 5678 5678 F DEBUG : Cause: null pointer dereference
01-18 18:29:28.255 5678 5678 F DEBUG : rax 0000000000000000 rbx 00007362c4411000 rcx 0000000000000001 rdx 0000000000000002
01-18 18:29:28.255 5678 5678 F DEBUG : r8 000073643826f000 r9 0000000000000000 r10 000000005b1c4f38 r11 000073610676a8d0
01-18 18:29:28.255 5678 5678 F DEBUG : r12 0000000000000001 r13 00007ffc9ac4a080 r14 00007362e437a150 r15 00007362e437a178
01-18 18:29:28.255 5678 5678 F DEBUG : rdi 00007ffc9ac4a080 rsi 0000736294345d50
01-18 18:29:28.255 5678 5678 F DEBUG : rbp 00007ffc9ac4a050 rsp 00007ffc9ac4a020 rip 0000736106750213
01-18 18:29:28.255 5678 5678 F DEBUG : 31 total frames
01-18 18:29:28.256 5678 5678 F DEBUG : backtrace:
01-18 18:29:28.256 5678 5678 F DEBUG : #00 pc 0000000000081213 /data/app/~~-o1I18AvGwKxQrTzPhWFRQ==/com.seafdec.eACDS.hybrid2-JLVeJHpsRd1A4rYK_-nCaQ==/lib/x86_64/libreanimated.so (BuildId: d0be42da2b9965efa4d1960bf04a785be40c510a)
01-18 18:29:28.256 5678 5678 F DEBUG : #01 pc 0000000000098c04 /data/app/~~-o1I18AvGwKxQrTzPhWFRQ==/com.seafdec.eACDS.hybrid2-JLVeJHpsRd1A4rYK_-nCaQ==/lib/x86_64/libreanimated.so (reanimated::Scheduler::triggerUI()+228) (BuildId: d0be42da2b9965efa4d1960bf04a785be40c510a)
01-18 18:29:28.256 5678 5678 F DEBUG : #02 pc 000000000009c911 /data/app/~~-o1I18AvGwKxQrTzPhWFRQ==/com.seafdec.eACDS.hybrid2-JLVeJHpsRd1A4rYK_-nCaQ==/lib/x86_64/libreanimated.so (facebook::jni::detail::MethodWrapper<void (reanimated::AndroidScheduler::*)(), &(reanimated::AndroidScheduler::triggerUI()), reanimated::AndroidScheduler, void>::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>)+33) (BuildId: d0be42da2b9965efa4d1960bf04a785be40c510a)
01-18 18:29:28.256 5678 5678 F DEBUG : #03 pc 000000000009c884 /data/app/~~-o1I18AvGwKxQrTzPhWFRQ==/com.seafdec.eACDS.hybrid2-JLVeJHpsRd1A4rYK_-nCaQ==/lib/x86_64/libreanimated.so (facebook::jni::detail::FunctionWrapper<void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>), facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, void>::call(_JNIEnv*, _jobject*, void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>))+52) (BuildId: d0be42da2b9965efa4d1960bf04a785be40c510a)
01-18 18:29:28.256 5678 5678 F DEBUG : #04 pc 000000000009b8f0 /data/app/~~-o1I18AvGwKxQrTzPhWFRQ==/com.seafdec.eACDS.hybrid2-JLVeJHpsRd1A4rYK_-nCaQ==/lib/x86_64/libreanimated.so (facebook::jni::detail::MethodWrapper<void (reanimated::AndroidScheduler::*)(), &(reanimated::AndroidScheduler::triggerUI()), reanimated::AndroidScheduler, void>::call(_JNIEnv*, _jobject*)+32) (BuildId: d0be42da2b9965efa4d1960bf04a785be40c510a)
01-18 18:29:28.256 5678 5678 F DEBUG : #05 pc 0000000000391a4b /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+219) (BuildId: b6dc79e02101ea00827a35a55ab6597a)
01-18 18:29:28.256 5678 5678 F DEBUG : #06 pc 000000000036faed /apex/com.android.art/lib64/libart.so (nterp_helper+3837) (BuildId: b6dc79e02101ea00827a35a55ab6597a)
01-18 18:29:28.256 5678 5678 F DEBUG : #07 pc 0000000000a2bf3c /data/app/~~-o1I18AvGwKxQrTzPhWFRQ==/com.seafdec.eACDS.hybrid2-JLVeJHpsRd1A4rYK_-nCaQ==/oat/x86_64/base.vdex (com.swmansion.reanimated.Scheduler$1.run+28)
01-18 18:29:28.256 5678 5678 F DEBUG : #08 pc 00000000003707e5 /apex/com.android.art/lib64/libart.so (nterp_helper+7157) (BuildId: b6dc79e02101ea00827a35a55ab6597a)
01-18 18:29:28.256 5678 5678 F DEBUG : #09 pc 0000000000a2bf7c /data/app/~~-o1I18AvGwKxQrTzPhWFRQ==/com.seafdec.eACDS.hybrid2-JLVeJHpsRd1A4rYK_-nCaQ==/oat/x86_64/base.vdex (com.swmansion.reanimated.Scheduler$2.runGuarded+12)
01-18 18:29:28.256 5678 5678 F DEBUG : #10 pc 000000000036fa88 /apex/com.android.art/lib64/libart.so (nterp_helper+3736) (BuildId: b6dc79e02101ea00827a35a55ab6597a)
01-18 18:29:28.256 5678 5678 F DEBUG : #11 pc 00000000003a3970 /data/app/~~-o1I18AvGwKxQrTzPhWFRQ==/com.seafdec.eACDS.hybrid2-JLVeJHpsRd1A4rYK_-nCaQ==/oat/x86_64/base.vdex (com.facebook.react.bridge.GuardedRunnable.run+0)
01-18 18:29:28.256 5678 5678 F DEBUG : #12 pc 00000000005c4d09 /system/framework/x86_64/boot-framework.oat (android.os.Handler.dispatchMessage+89) (BuildId: e4c2202f7e80276bcdbfa046249d896342205aa9)
01-18 18:29:28.256 5678 5678 F DEBUG : #13 pc 00000000005c83ce /system/framework/x86_64/boot-framework.oat (android.os.Looper.loopOnce+1022) (BuildId: e4c2202f7e80276bcdbfa046249d896342205aa9)
01-18 18:29:28.256 5678 5678 F DEBUG : #14 pc 00000000005c7f01 /system/framework/x86_64/boot-framework.oat (android.os.Looper.loop+481) (BuildId: e4c2202f7e80276bcdbfa046249d896342205aa9)
01-18 18:29:28.256 5678 5678 F DEBUG : #15 pc 000000000033b44c /system/framework/x86_64/boot-framework.oat (android.app.ActivityThread.main+1628) (BuildId: e4c2202f7e80276bcdbfa046249d896342205aa9)
01-18 18:29:28.256 5678 5678 F DEBUG : #16 pc 0000000000378826 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+806) (BuildId: b6dc79e02101ea00827a35a55ab6597a)
01-18 18:29:28.256 5678 5678 F DEBUG : #17 pc 00000000003c538f /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+255) (BuildId: b6dc79e02101ea00827a35a55ab6597a)
01-18 18:29:28.256 5678 5678 F DEBUG : #18 pc 00000000007f07f4 /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1476) (BuildId: b6dc79e02101ea00827a35a55ab6597a)
01-18 18:29:28.256 5678 5678 F DEBUG : #19 pc 000000000075a387 /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*) (.__uniq.165753521025965369065708152063621506277)+39) (BuildId: b6dc79e02101ea00827a35a55ab6597a)
01-18 18:29:28.256 5678 5678 F DEBUG : #20 pc 00000000000a3ac0 /system/framework/x86_64/boot.oat (art_jni_trampoline+128) (BuildId: c78b6b6270062f2e659e76e5f8dac6d757f47ca6)
01-18 18:29:28.256 5678 5678 F DEBUG : #21 pc 00000000007e66a9 /system/framework/x86_64/boot-framework.oat (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+137) (BuildId: e4c2202f7e80276bcdbfa046249d896342205aa9)
01-18 18:29:28.256 5678 5678 F DEBUG : #22 pc 00000000007f0848 /system/framework/x86_64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2872) fault)
问题是我无法从日志中找到任何致命错误, 可能是“未知:ViewManagerPropertyUpdater:找不到类 com.swmansion.rnscreens.ScreensShadowNode 生成的设置器”
我已经用谷歌搜索了一天,但不知道如何处理“未知:ViewManagerPropertyUpdater:找不到类的生成设置器”。完整日志还有很多未知:ViewManagerPropertyUpdater
type h01-18 18:29:27.926 5609 5662 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.drawer.ReactDrawerLayoutManager
01-18 18:29:27.927 5609 5662 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.uimanager.LayoutShadowNode
01-18 18:29:27.928 5609 5662 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollViewManager
01-18 18:29:27.928 5609 5662 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager
01-18 18:29:27.928 5609 5662 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ReactProgressBarViewManager
01-18 18:29:27.929 5609 5662 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ProgressBarShadowNode
01-18 18:29:27.929 5609 5662 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactScrollViewManager
01-18 18:29:27.930 5609 5662 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager
01-18 18:29:27.930 5609 5662 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager$ReactSwitchShadowNode
01-18 18:29:27.930 5609 5662 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
01-18 18:29:27.931 5609 5662 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
01-18 18:29:27.931 5609 5662 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageShadowNode
我的项目名称是eacds,这是它的package.json。我多次尝试删除node_modules但不起作用。请帮我找出崩溃的原因。
type her{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject",
"postinstall": "jetify"
},
"dependencies": {
"@react-native-async-storage/async-storage": "1.18.2",
"@react-native-community/datetimepicker": "7.2.0",
"@react-native-community/netinfo": "9.3.10",
"@react-native-community/viewpager": "5.0.11",
"@react-native-masked-view/masked-view": "0.2.9",
"@react-navigation/native": "^6.1.9",
"@react-navigation/stack": "^6.3.20",
"deprecated-react-native-prop-types": "^5.0.0",
"expo": "^49.0.21",
"expo-asset": "~8.10.1",
"expo-background-fetch": "~11.3.0",
"expo-barcode-scanner": "~12.5.3",
"expo-camera": "~13.4.4",
"expo-constants": "~14.4.2",
"expo-file-system": "~15.4.5",
"expo-location": "~16.1.0",
"expo-notifications": "~0.20.1",
"expo-permissions": "~14.2.1",
"expo-task-manager": "~11.3.0",
"expo-updates": "~0.18.18",
"expokit": "^34.0.2",
"lz-string": "^1.4.4",
"patch-package": "^8.0.0",
"react": "18.2.0",
"react-native": "0.72.6",
"react-native-android-location-enabler": "^1.0.9",
"react-native-datepicker": "^1.7.2",
"react-native-dialog": "^9.3.0",
"react-native-elements": "^3.4.3",
"react-native-expo-viewport-units": "0.0.8",
"react-native-gesture-handler": "~2.12.0",
"react-native-html-parser": "0.0.5",
"react-native-image-base64": "^0.1.4",
"react-native-loading-gif": "github:Manit-Chan/lspg",
"react-native-modal-datetime-picker": "^17.1.0",
"react-native-modal-selector": "^2.0.2",
"react-native-popup-dialog": "^0.18.2",
"react-native-qrcode-svg": "^6.0.1",
"react-native-reanimated": "~3.3.0",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "~3.22.0",
"react-native-svg": "13.9.0",
"react-native-swiper": "^1.6.0",
"react-native-viewport-units": "0.0.5",
"react-navigation": "^3.13.0",
"rn-fetch-blob": "^0.10.15",
"save": "^2.4.0"
},
"devDependencies": {
"@types/react": "~18.2.14",
"babel-preset-expo": "^9.5.0",
"jetifier": "^1.6.5",
"typescript": "^5.1.3"
},
"private": true,
"overrides": {
"react-native-gesture-handler": "~2.12.0"
}
}
我的坏处是,我发现这是因为构建是在生产配置文件上进行的,需要预览或开发配置文件,而不是在真实设备上测试 apk。当我更改为
之后eas build --platform android --local --profile 预览
新的 apk 可以运行。在经典构建(expo构建)中,用于生产的apk可以在真实设备上进行测试。