I have an interesting issue which causes me to spend more than 2 days.
As you know, we can load different kinds of resources from the Resources folder. Everything is fine if I directly called Resources.Load() in any MonoBehaviour script. But if I triggered the same code block from the 3rd party(DLL library) callback function, it throws an exception. There are simple 3 lines of code;
var catIcon = Resources.Load<Sprite>("icons/" + category.icon);
var tImage = transform.Find("CategoryIcon").GetComponent<Image>();
tImage.sprite = catIcon;
P.S: variable of category.icon is always the same for working and crashing cases.
This is the exception if I call the above code block on 3rd party:
2020/11/23 18:36:53.405 27165 27165 Error CRASH uid: 10195
2020/11/23 18:36:53.405 27165 27165 Error CRASH signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
2020/11/23 18:36:53.405 27165 27165 Error CRASH Cause: null pointer dereference
2020/11/23 18:36:53.405 27165 27165 Error CRASH x0 0000000000000000 x1 00000070ff79c2d0 x2 0000000000000003 x3 00000071b1bb1420
2020/11/23 18:36:53.405 27165 27165 Error CRASH x4 00000071b1bb14a4 x5 0000007ff86dbca8 x6 0000000000000000 x7 000000000000004e
2020/11/23 18:36:53.405 27165 27165 Error CRASH x8 00000072b257b1d8 x9 0000000000000001 x10 0000000000000000 x11 0000000000000001
2020/11/23 18:36:53.405 27165 27165 Error CRASH x12 0000000000000001 x13 0000000000000000 x14 00000072123e5d10 x15 aaaaaaaaaaaaaaab
2020/11/23 18:36:53.405 27165 27165 Error CRASH x16 00000071a68ad960 x17 00000072ad356970 x18 00000071a3142d32 x19 00000070f5a24210
2020/11/23 18:36:53.405 27165 27165 Error CRASH x20 00000000000000a8 x21 0000000000000001 x22 00000071408291a0 x23 0000000000000001
2020/11/23 18:36:53.405 27165 27165 Error CRASH x24 00000071a68ae168 x25 00000000000000ff x26 0000000000000000 x27 00000071a68ae168
2020/11/23 18:36:53.405 27165 27165 Error CRASH x28 0000000000000100 x29 0000000000000001
2020/11/23 18:36:53.405 27165 27165 Error CRASH sp 0000007ff86dbf60 lr 00000071a5b9fae4 pc 00000071a5b9fae4
2020/11/23 18:36:53.405 27165 27165 Error CRASH
2020/11/23 18:36:53.405 27165 27165 Error CRASH backtrace:
2020/11/23 18:36:53.405 27165 27165 Error CRASH #00 pc 000000000021aae4 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libunity.so (BuildId: 9813e3430b6c0af74f584f5dee48fc1204786872)
2020/11/23 18:36:53.405 27165 27165 Error CRASH #01 pc 00000000001ee6dc /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libunity.so (BuildId: 9813e3430b6c0af74f584f5dee48fc1204786872)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #02 pc 00000000001ee77c /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libunity.so (BuildId: 9813e3430b6c0af74f584f5dee48fc1204786872)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #03 pc 000000000032bf34 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libunity.so (BuildId: 9813e3430b6c0af74f584f5dee48fc1204786872)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #04 pc 000000000032bdf8 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libunity.so (BuildId: 9813e3430b6c0af74f584f5dee48fc1204786872)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #05 pc 000000000032bd5c /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libunity.so (BuildId: 9813e3430b6c0af74f584f5dee48fc1204786872)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #06 pc 000000000031e48c /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libunity.so (BuildId: 9813e3430b6c0af74f584f5dee48fc1204786872)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #07 pc 000000000031eaa8 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libunity.so (BuildId: 9813e3430b6c0af74f584f5dee48fc1204786872)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #08 pc 000000000031ef04 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libunity.so (BuildId: 9813e3430b6c0af74f584f5dee48fc1204786872)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #09 pc 00000000000d6ca8 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libunity.so (BuildId: 9813e3430b6c0af74f584f5dee48fc1204786872)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #10 pc 00000000007b0f1c /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libunity.so (BuildId: 9813e3430b6c0af74f584f5dee48fc1204786872)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #11 pc 000000000036f84c /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libunity.so (BuildId: 9813e3430b6c0af74f584f5dee48fc1204786872)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #12 pc 00000000011b6028 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (Resources_Load_mF0FA033BF566CDDA6A0E69BB97283B44C40726E7+100) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #13 pc 0000000000dc12b4 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (Resources_Load_TisRuntimeObject_m5DBFEC24E0DC9FC8734E858A489BC7B8B64B0BFF_gshared+308) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #14 pc 0000000000550b70 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (Resources_Load_TisSprite_tCA09498D612D08DE668653AF1E9C12BF53434198_m4D732253DAFFFF80236ADB5E86A68B5999B6549C(String_t*, MethodInfo const*)+36) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #15 pc 0000000001723e6c /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (CategoryItem_RenderUi_m3094D1C08A752B1D4A9F9F268341BF05931933AE+248) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #16 pc 0000000001721c74 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (CategoryPanel_RenderUi_m646A1B8853845F8071385BD21E33FD8350A17495+688) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #17 pc 00000000017218c0 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (StoreSceneManager_LoadUi_m554F8A5BF2D558A64454C28E452D9802D6D33C67+460) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #18 pc 0000000001722ec0 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (StoreSceneManager_OnProductsQuerySuccess_m34A2D383654202CB21A0FB7E9297490E661CFD20+276) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #19 pc 000000000054aaac /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (InterfaceActionInvoker0::Invoke(unsigned int, Il2CppClass*, Il2CppObject*)+804) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #20 pc 0000000001720e38 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (IapManager_OnProductsQuerySuccess_mEBD5D08198FCE8631E0D80895A29A1785D987E66+144) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #21 pc 000000000054aaac /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (InterfaceActionInvoker0::Invoke(unsigned int, Il2CppClass*, Il2CppObject*)+804) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #22 pc 0000000001726fcc /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (UnityIAP_OnInitialized_m2EF1D7762B0FC51D1EBAA3412007222120096560+152) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #23 pc 0000000000580270 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (InterfaceActionInvoker2<Il2CppObject*, Il2CppObject*>::Invoke(unsigned int, Il2CppClass*, Il2CppObject*, Il2CppObject*, Il2CppObject*)+820) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #24 pc 00000000016969a0 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (StoreListenerProxy_OnInitialized_mABFD1FD2355DF07BAB449438FE638580A8CED43A+176) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #25 pc 0000000000579750 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (InterfaceActionInvoker1<Il2CppObject*>::Invoke(unsigned int, Il2CppClass*, Il2CppObject*, Il2CppObject*)+812) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #26 pc 0000000001696064 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (PurchasingManager_CheckForInitialization_m6F2F5A6991096BF7FE6B257A5BFC72A3F4B71908+1372) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #27 pc 000000000169586c /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (PurchasingManager_OnProductsRetrieved_mC5FEF916A0DF1800C54DB0AB559BE7EC4AD0F7E0+2056) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #28 pc 0000000000565690 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (InterfaceActionInvoker1<List_1_tDDE9FB7179695109BF14DE699E3B378F438F4F68*>::Invoke(unsigned int, Il2CppClass*, Il2CppObject*, List_1_tDDE9FB7179695109BF14DE699E3B378F438F4F68*)+812) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #29 pc 00000000009d2b98 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (HuaweiStore_ProductsLoaded_mCEE68E0E5010BFA3ED208C0FF632710A07A7C4C6+2264) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #30 pc 00000000009d22a4 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (HuaweiStore_LoadSubscribeProducts_m7C72F66B2267E152E51E1E5897056BBA71E09916+1620) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #31 pc 00000000009d1c34 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (HuaweiStore_LoadNonComsumableProducts_m99AC168B29B376D66CAEDC2CF15AB8C7DB8BA318+1620) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.406 27165 27165 Error CRASH #32 pc 0000000000c7f9c0 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (Action_Invoke_mC8D676E5DDF967EC5D23DD0E96FB52AA499817FD+564) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.409 27165 27165 Error CRASH #33 pc 00000000009d509c /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (U3CU3Ec__DisplayClass19_0_U3CCreateProductRequestU3Eb__0_m7B0122FD121B906D3E2FE3DD19AAC2C8CBF0C34F+272) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.410 27165 27165 Error CRASH #34 pc 000000000110d724 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (Action_1_Invoke_mB86FC1B303E77C41ED0E94FC3592A9CF8DA571D5_gshared+964) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.410 27165 27165 Error CRASH #35 pc 0000000001109e08 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (OnSuccessListenerConverterWrapper_1_onSuccess_mCF900383032E325589EA0D0019696901AAB10315_gshared+192) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.410 27165 27165 Error CRASH #36 pc 00000000004e902c /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (RuntimeInvoker_TrueVoid_t22962CB4C05B1D89B55A6E1139F0E87A90987017_RuntimeObject(void (*)(), MethodInfo const*, void*, void**)+76) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.410 27165 27165 Error CRASH #37 pc 000000000081253c /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**)+376) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.410 27165 27165 Error CRASH #38 pc 000000000081e5ec /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (il2cpp::vm::InvokeConvertThis(MethodInfo const*, void*, void**, Il2CppException**)+136) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.410 27165 27165 Error CRASH #39 pc 000000000081e024 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (il2cpp::vm::Runtime::InvokeConvertArgs(MethodInfo const*, void*, Il2CppObject**, int, Il2CppException**)+964) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.410 27165 27165 Error CRASH #40 pc 000000000081dc48 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (il2cpp::vm::Runtime::InvokeArray(MethodInfo const*, void*, Il2CppArray*, Il2CppException**)+164) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.410 27165 27165 Error CRASH #41 pc 00000000007a0bf4 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (il2cpp::icalls::mscorlib::System::Reflection::MonoMethod::InternalInvoke(Il2CppReflectionMethod*, Il2CppObject*, Il2CppArray*, Il2CppException**)+888) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.413 27165 27165 Error CRASH #42 pc 0000000000de81a8 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (MonoMethod_InternalInvoke_mB9735487F3062332EFB3EC603138E72E6C8A7789+56) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.413 27165 27165 Error CRASH #43 pc 0000000000de8484 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (MonoMethod_Invoke_mD791F247764DAE0188BA06FD1DA51525E8F2F394+716) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.413 27165 27165 Error CRASH #44 pc 000000000060ece4 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (VirtFuncInvoker5<Il2CppObject*, Il2CppObject*, int, Binder_t4D5CB06963501D32847C057B57157D6DC49CA759*, ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A*, CultureInfo_t345AC6924134F039ED9A11F3E03F8E91B6A3225F*>::Invoke(unsigned int, Il2CppObject*, Il2CppObject*, int, Binder_t4D5CB06963501D32847C057B57157D6DC49CA759*, ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A*, CultureInfo_t345AC6924134F039ED9A11F3E03F8E91B6A3225F*)+264) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.413 27165 27165 Error CRASH #45 pc 0000000000ddb140 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (MethodBase_Invoke_m471794D56262D9DB5B5A324883030AB16BD39674+84) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.417 27165 27165 Error CRASH #46 pc 00000000016654d8 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (AndroidJavaProxy_Invoke_m2A4BA59C6A517E0B692478676AA0A0A77980848E+1608) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.417 27165 27165 Error CRASH #47 pc 000000000073f224 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (VirtFuncInvoker2<AndroidJavaObject_t31F4DD4D4523A77B8AF16FE422B7426248E3093D*, String_t*, ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A*>::Invoke(unsigned int, Il2CppObject*, String_t*, ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A*)+240) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.422 27165 27165 Error CRASH #48 pc 0000000001667bc8 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (AndroidJavaProxy_Invoke_m27ACB084BB434FFEA8A1FB687CCB332F4EB80B9B+1000) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.422 27165 27165 Error CRASH #49 pc 000000000073f71c /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (VirtFuncInvoker2<AndroidJavaObject_t31F4DD4D4523A77B8AF16FE422B7426248E3093D*, String_t*, AndroidJavaObjectU5BU5D_t7C44610B692603ADE504A389C4362A53613B5379*>::Invoke(unsigned int, Il2CppObject*, String_t*, AndroidJavaObjectU5BU5D_t7C44610B692603ADE504A389C4362A53613B5379*)+240) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.422 27165 27165 Error CRASH #50 pc 000000000166b950 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (_AndroidJNIHelper_InvokeJavaProxyMethod_mF3275AFDFED43C42616A997FC582F1F90888AB87+1188) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.422 27165 27165 Error CRASH #51 pc 0000000000517a0c /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (RuntimeInvoker_FalseIntPtr_t_RuntimeObject_IntPtr_t_IntPtr_t(void (*)(), MethodInfo const*, void*, void**)+100) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.422 27165 27165 Error CRASH #52 pc 000000000081253c /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**)+376) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.422 27165 27165 Error CRASH #53 pc 0000000000772ab8 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libil2cpp.so (il2cpp_runtime_invoke+132) (BuildId: 31209e4603ca6edbf56452498240ca7273dbbc6b)
2020/11/23 18:36:53.422 27165 27165 Error CRASH #54 pc 00000000002d6290 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libunity.so (BuildId: 9813e3430b6c0af74f584f5dee48fc1204786872)
2020/11/23 18:36:53.422 27165 27165 Error CRASH #55 pc 00000000002e26b4 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libunity.so (BuildId: 9813e3430b6c0af74f584f5dee48fc1204786872)
2020/11/23 18:36:53.423 27165 27165 Error CRASH #56 pc 000000000016207c /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/lib/arm64/libunity.so (BuildId: 9813e3430b6c0af74f584f5dee48fc1204786872)
2020/11/23 18:36:53.423 27165 27165 Error CRASH #57 pc 0000000000048190 /data/app/games.poly.jail.huawei-xD6PD0ifH--o4wEGeg7Gyw==/oat/arm64/base.odex
2020/11/23 18:36:53.558 27165 27237 Error CRASH other thread is trapped; signum = 11
My Findings until now;
- Not for all images cause an exception but most of them cause the same exception.
- Crashes are the same for other functions on Resources such as LoadAll and FindObjectsOfTypeAll etc.
- Crash does not appear if I never called the 3rd party library.
If anyone has an idea, please share with me.
Thanks,
Here is the code example;
public void Start()
{
store = StoreData.LoadStore(storeDataPath);
productPanel = transform.Find("ProductsPanel");
categoryPanel = transform.Find("CategoryPanel");
loadingPanel = transform.Find("LoadingPanel");
lp = loadingPanel.GetComponent<LoadingPanel>();
lp.Show();
// Render will be done after query completed.
IapManager.Instance.QueryProducts(this, store);
}
public void OnProductsQuerySuccess()
{
Debug.Log("Products Query is completed, UI is rendering...");
lp.Hide();
LoadUi();
}
private void LoadUi()
{
var categoryIndex = PlayerPrefs.GetInt("categoryIndex", -1);
selectedCategoryIndex = store.defaultCatIndex;
var cPanel = categoryPanel.GetComponent<CategoryPanel>();
cPanel.RenderUi(store, selectedCategoryIndex);
// Load Store Products Panel
var pPanel = productPanel.GetComponent<ProductsPanel>();
pPanel.RenderUi(store.categories[selectedCategoryIndex]);
}
To be sure, I give products information from JSON directly, I don't use remote product information. If I call LoadUI() directly in Start() it works. If I call a callback from the listener, it crashes.
IapManager.Instance.QueryProducts(this, store);
This part calls,
var builder = ConfigurationBuilder.Instance(HuaweiPurchasingModule.Instance());
UnityPurchasing.Initialize(this, builder);
After the callback triggered by UnityPurchase, I called my listener to trigger MyStoreSceneManager.
public void OnInitialized(IStoreController controller, IExtensionProvider extensions) {
iapListener.OnProductsQuerySuccess();
return;
}