I make an update including all Cardboard SDK feature into my game https://play.google.com/store/apps/details?id=com.oriongames.spaceshooter
BUT, I found that some Android device (not all, since my Note 2 and editor mode is working perfectly) Crash instantly after the Unity logo.
Here is the repport :
java.lang.Error: FATAL EXCEPTION [UnityMain] Unity version : 5.1.1f1
Device model : samsung SM-T210 Device fingerprint:
samsung/lt02wifixx/lt02wifi:4.1.2/JZO54K/T210XXAMKF:user/release-keys
Caused by: java.lang.Error: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR),
fault addr 6ab6b090 Build fingerprint:
'samsung/lt02wifixx/lt02wifi:4.1.2/JZO54K/T210XXAMKF:user/release-keys'
Revision: '7' pid: 13587, tid: 13600, name: UnityMain >>>
com.oriongames.spaceshooter <<< r0 00000000 r1 00000000 r2 80808080 r3
6ab6b090 r4 6952f800 r5 6ab6a11c r6 5eb20520 r7 6ab6b090 r8 5eb20524
r9 5eb2056c sl 00000328 fp 69530190 ip 6ab5ed60 sp 5eb20500 lr
6a9a1979 pc 400ca174 cpsr 4b34354f
at libc.strlen(strlen:72) at
libvrunity.ion::gfx::GraphicsManager::InitGlInfo()(gfx:136) at
libvrunity.ion::gfx::GraphicsManager::InitFunctions()(gfx:356) at
libvrunity.ion::gfx::GraphicsManager::Init(bool)(gfx:172) at
libvrunity.ion::gfx::GraphicsManager::GraphicsManager()(gfx:6010) at
libvrunity.gvr::VrSessionImpl::InitIonDefaults()(VrSessionImpl:124) at
libvrunity.gvr::CardboardVrSessionFactory::CreateCardboardVrSession(gvr::DisplayMetrics
const&, gvr::VrAppInfo const&, bool, std::function const&,
std::function const&)(CardboardVrSessionFactory:72) at
libvrunity.gvr::CardboardApiImpl::CardboardApiImpl(gvr::DisplayMetrics
const&)(CardboardApiImpl:182) at libvrunity.Start(Start:364) at
Unknown.0000eecc(Unknown Source) at BaseCardboardDevice.Start(Native
Method) at BaseCardboardDevice.Init(<0x00090>:144) at
CardboardAndroidDevice.Init(<0x0001b>:27) at
Cardboard.InitDevice(<0x00073>:115) at Cardboard.Awake(<0x00083>:131)
at Object.runtime_invoke_void__this__(Native Method) at
GameObject.Internal_AddComponentWithType(Native Method) at
GameObject.AddComponent(<0x00024>:36) at
GameObject.AddComponent(<0x0002b>:43) at
Cardboard.get_SDK(<0x000a3>:163) at
CameraManagerVRCardboard.Recenter(<0x00017>:23) at
c__IteratorD.MoveNext(<0x0009f>:159) at
.runtime_invoke_bool__this__(Native Method) at
MonoBehaviour.StartCoroutine(Native Method) at
MonoBehaviour.StartCoroutine(<0x00028>:40) at
CameraManager.changeCameraState(<0x000b3>:179) at
StartMenu.Init(<0x00257>:599) at StartMenu.Start(<0x00043>:67) at
Object.runtime_invoke_void__this__(Native Method) at
libmono.00021bcf(Native Method) at
libmono.mono_runtime_invoke(mono_runtime_invoke:136) at
libunity.002b1e08(Native Method)
The game works again if I simply remove the Cardboard SDK from the game.
I try to changed GPU Skinning and Automatic Graphics API under PlayerPref but nothing works.
Do you have any clue ?
Thanks you !
Related
I'm working collaboratively on an Android app that uses AR Foundation. From one day to another (without making new builds) the app started to crash after the splash screen, every time. I'm working on my Huawei Mate 20 Pro, but my teammates use other Android phones (Samsung, Xiaomi and Motorola) and they continued to develop the app, and it works just fine for them. I pull their commits (which work for them), make no changes, and it keeps crashing on my phone. We are using Firebase so I have the info from Crashlytics, but I can't quiet understand it:
Unity version is 2019.4.8f1 LTS, and the Huawei phone runs on Android 10.
The complete crash log is:
Caused by java.lang.Error
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Version '2019.4.8f1 (60781d942082)', Build type 'Release', Scripting Backend 'mono', CPU 'armeabi-v7a'
Build fingerprint: 'HUAWEI/LYA-L29/HWLYA:10:user/release-keys' Revision: '0' ABI: 'arm'
Timestamp: 2020-08-13 14:12:37-0300 pid: 3571, tid: 3777,
name: UnityMain >>> com.app.name <<<
uid: 10315 signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference r0 00000000 r1 00000000 r2 00000000 r3 00000000 r4 a965d490 r5 bd74a87c r6 80808080 r7 00000000 r8 be98f540 r9 00000000 r10 00000000 r11 b2f15f60 ip b2f4cc90 sp bd74a878 lr b2f1e859 pc 00000000
managed backtrace: #00 (wrapper managed-to-native)
UnityEngine.XR.ARCore.ARCoreSessionSubsystem/NativeApi:UnityARCore_session_update (UnityEngine.ScreenOrientation,UnityEngine.Vector2Int,intptr,UnityEngine.XR.ARSubsystems.Feature) #01
UnityEngine.XR.ARCore.ARCoreSessionSubsystem/ARCoreProvider:Update (UnityEngine.XR.ARSubsystems.XRSessionUpdateParams,UnityEngine.XR.ARSubsystems.Configuration) <0xef> #02
UnityEngine.XR.ARSubsystems.XRSessionSubsystem:Update (UnityEngine.XR.ARSubsystems.XRSessionUpdateParams) <0x1d3> #03
UnityEngine.XR.ARFoundation.ARSession:Update () <0x157> #04
(wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
UPDATE
I've managed to narrow down the crash to the following lines of code, inside the Update of ARSession script:
void Update()
{
if (subsystem?.running == true)
{
m_TrackingMode = subsystem.requestedTrackingMode.ToTrackingMode();
if (subsystem.matchFrameRateEnabled)
{
Application.targetFrameRate = subsystem.frameRate;
QualitySettings.vSyncCount = 0;
}
//subsystem.Update(new XRSessionUpdateParams
//{
// screenOrientation = Screen.orientation,
// screenDimensions = new Vector2Int(Screen.width, Screen.height)
//});
switch (subsystem.trackingState)
{
case TrackingState.None:
case TrackingState.Limited:
state = ARSessionState.SessionInitializing;
break;
case TrackingState.Tracking:
state = ARSessionState.SessionTracking;
break;
}
}
}
With those commented lines, the app starts but the camera won't work. If I uncomment them, it crashes. I know the problem is there because I placed a:
UnityEngine.Handheld.Vibrate();
Before and after, and the phone only vibrates once.
I updated the question's title because the problem is caused by an issue in the update of Google Play Services for AR. I managed to make my app work by manually downloading an older version of Google Play Services for AR, following the instructions here.
You can track the issue I opened in the ARCore Unity SDK repo here
Usually one has to turn it into a Library to embed it into another app. However, now I want to convert it into a Dynamic Feature instead.
I've put this in the Unity project's manifest:
<dist:module
dist:onDemand="true"
dist:title="#string/title_gamejam_as_dynamic_feature">
<dist:fusing dist:include="true" />
</dist:module>
In addition, I've commented out the bundle{} part of its Gradle file. If I didn't comment that out I end up getting the following error:
Could not find method bundle() for arguments [build_9piysgasfu4pgl4v1ppx46cyn$_run_closure3$_closure12#44175a08] on object of type com.android.build.gradle.AppExtension.
I've also made sure that the UnityPlayerActivity there extends my custom AppCompatActivity that uses SplitCompat.install(this) [though it extends Activity].
Right now my problem is that for some reason the Assets in that Unity project aren't registered in the base APK, so the UnityPlayerActivity ends up crashing on launching.
What am I doing wrong?
EDIT: The error stacktrace is below:
01-15 03:48:18.343 15446-15522/? E/mono: The assembly mscorlib.dll was not found or could not be loaded.
01-15 03:48:18.343 15446-15522/? E/mono: It should have been installed in the `/data/app/test.com.ondemandtest-1/base.apk/assets/bin/Data/Managed/mono/4.5/mscorlib.dll' directory.
01-15 03:48:18.343 15446-15446/? E/CRASH: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
01-15 03:48:18.343 15446-15446/? E/CRASH: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-15 03:48:18.343 15446-15446/? E/CRASH: Build type 'Release', Scripting Backend 'mono', CPU 'armeabi-v7a'
01-15 03:48:18.343 15446-15446/? E/CRASH: Build fingerprint: 'Huawei/ALE-L21/hwALE-H:5.0.1/HuaweiALE-L21/C636B150:user/release-keys'
01-15 03:48:18.343 15446-15446/? E/CRASH: Revision: '0'
01-15 03:48:18.343 15446-15446/? E/CRASH: pid: 15446, tid: 15446, name: om.ondemandtest >>> test.com.ondemandtest <<<
01-15 03:48:18.343 15446-15446/? E/CRASH: r0 00000000 r1 ffc2fb10 r2 6f5aec60 r3 00000000
01-15 03:48:18.343 15446-15446/? E/CRASH: r4 ffc2fb10 r5 e22c0250 r6 00000000 r7 6f5aec60
01-15 03:48:18.343 15446-15446/? E/CRASH: r8 ffc2fad4 r9 ab3f7930 sl ffc2fa9f fp ffc2fa50
01-15 03:48:18.343 15446-15446/? E/CRASH: ip e1fafee8 sp ffc2fa40 lr e1fb0040 pc e1fafca8 cpsr 00003c56
01-15 03:48:18.343 15446-15446/? E/CRASH: backtrace:
EDIT 2:
Upon further inspection, I found out that mscorlib.dll isn't in the mono .so file, but the Assets folder. Copying assets/bin/Data/... of the Unity project into the base project (into the exact same path) works... but that just defeats the point of modularity.
Is there any way the Unity project can use the Assets it brings without having to copy it into the Base APK before deploying?
Unity is searching your .dll in the base.apk, which is not what you want since you are using Dynamic Features
I solved it by overiding the getPackageCodePath() of my UnityPlayerActivity to something like this:
override fun getPackageCodePath(): String {
return super.getPackageCodePath().replace("base.apk", "split_unity_module.apk")
}
PS: My module is named unity_module so the name of the .apk is something like split_{{your_module_name}}.apk
I'm building an Android App with Unity 2018.1.0f2 and get some kind of segmentation fault while running it. The exact error is the following:
05-16 20:54:11.834: E/SamsungIME(9413): <AbstractKeyboardView> - onDraw() called
05-16 20:54:12.142: E/ViewRootImpl(17850): sendUserActionEvent() mView == null
05-16 20:54:12.146: E/SKBD KeyboardInfoUtils(9413): getInstance start
05-16 20:54:12.146: E/SKBD KeyboardInfoUtils(9413): sendSIPInformation state:6 isAbstractKeyboardView : true
05-16 20:54:12.151: E/SKBD KeyboardInfoUtils(9413): sending null keyboardInfo as SIP is closed
05-16 20:54:15.401: A/libc(17850): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 17865 (UnityMain)
05-16 20:54:15.401: A/libc(17850): [ 05-16 20:54:15.407 3096: 3096 W/ ]
05-16 20:54:15.401: A/libc(17850): debuggerd: handling request: pid=17850 uid=10350 gid=10350 tid=17865
05-16 20:54:15.633: A/DEBUG(17987): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-16 20:54:15.634: A/DEBUG(17987): Build fingerprint: 'samsung/heroltexx/herolte:7.0/NRD90M/G930FXXS2DRDI:user/release-keys'
05-16 20:54:15.635: A/DEBUG(17987): Revision: '8'
05-16 20:54:15.635: A/DEBUG(17987): ABI: 'arm'
05-16 20:54:15.635: A/DEBUG(17987): pid: 17850, tid: 17865, name: UnityMain >>> de.zoomapp.zoom <<<
05-16 20:54:15.635: A/DEBUG(17987): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
05-16 20:54:15.636: A/DEBUG(17987): r0 00000000 r1 c7ad20b0 r2 cf9ffc24 r3 efc62308
05-16 20:54:15.637: A/DEBUG(17987): r4 c7ad20b0 r5 c7ad20cc r6 ffffffff r7 00000000
05-16 20:54:15.637: A/DEBUG(17987): r8 00000000 r9 ee67ecb4 sl ee67ebc8 fp ee67e5e8
05-16 20:54:15.637: A/DEBUG(17987): ip c7ad20b0 sp ee67e5c8 lr cf9ffc3c pc f2386338 cpsr a00e0030
05-16 20:54:15.651: A/DEBUG(17987): backtrace:
05-16 20:54:15.652: A/DEBUG(17987): #00 pc 00018338 /system/lib/libc.so (strcmp+47)
05-16 20:54:15.652: A/DEBUG(17987): #01 pc 0014bc38 /data/app/de.zoomapp.zoom-1/lib/arm/libunity.so
05-16 20:54:15.652: A/DEBUG(17987): #02 pc 00008484 <anonymous:c7275000>
05-16 20:54:17.518: E/audit(4645): type=1701 audit(1526496857.505:4791): auid=4294967295 uid=10350 gid=10350 ses=4294967295 subj=u:r:untrusted_app:s0:c512,c768 pid=17865 comm="UnityMain" exe="/system/bin/app_process32" sig=11
05-16 20:54:17.562: E/lowmemorykiller(3180): Error writing /proc/17850/oom_score_adj; errno=22
I try to provide each screen in landscape and portrait mode. When the user is in the login screen and clicks the login button, a UnityWebRequest is sent to the server. If the server responds with a positive result, the UI transitions opens a loading screen, in the background multiple UnityWebRequests are sent to retrieve more information about icons and images to show. When loading is done the main menu is shown and in the background the game is already loaded, but paused. This game consists of only showing a bunch of images and is pretty static, which is the reason why I don't describe it in detail here.
The said crash occurs, if the user rotates his phone from portrait to landscape right after clicking login and while the loading screen shows. I could reproduce this error all the time on my Samsung Galaxy S7, but could not make a minimal example in a clean project.
It might be a problem with yielding the web requests maybe? I put log messages all over my code and before the crash I often saw the yield statement of some web request. I have more coroutines loading some images in async. If I comment out all coroutines it runs fine, but I don't know if this is due to the loading running very fast or if coroutines cause the problem.
I then searched on the internet and found to use addr2line tool. It produced for the address 0014bc38:
operator delete[](void*, std::nothrow_t const&)
I can't find the exact problem. I hope maybe someone has a hint how I can search for this.
Thank you guys.
Regards,
Michael
SEG_MAPERR with address of 0x0 is null pointer dereference.
It's valid to delete a null pointer (and should be for the delete[] operator). I suspect that you have some sort of race condition. Put some logs when you delete or free anything (although everything is GC...)
Also, check the official bug tracker and submit a new bug if you can't find something similar. I suspect that it is trying to access a null pointer when the new window parameters are sent to the app.
We have integrated FreeRDP in android application. Some of the devices like Samsung, We are getting SIGSEGV & SIGABRT crashes randomly. These are not reproducible issues and logs are not showing any specific method that causing the issue.
I am posting some logs here. Could you please let me know if anyone has any idea about this?
Crash reason: SIGSEGV
Crash address: 0x0
Process uptime: not available
Thread 195 (crashed)
0 libfreerdp2.so + 0x20ef0
r0 = 0x00000000 r1 = 0x00000000 r2 = 0x00000000 r3 = 0x00000000
r4 = 0x8401c380 r5 = 0xb0800f6d r6 = 0xbb7fc920 r7 = 0x00000078
r8 = 0x09f7b70c r9 = 0x09f7b6e0 r10 = 0x8ed55cc8 r12 = 0xb0842600
fp = 0xbb7fc7ec sp = 0xbb7fc7d8 lr = 0x8ebde450 pc = 0x8ebd8ef0
Found by: given as instruction pointer in context
1 libc.so + 0x47f6b
sp = 0xbb7fc7e4 pc = 0xb0800f6d
Found by: stack scanning
I'm developing the game on Unity 5.6.0f3 and I'm facing the problem with some Android devices. This crash reproduces not on every android device, but on soma of them, like this: LG Optimus L7II, LG Magna, LG Leon, Lenovo A680, Lenovo P780, Lenovo S580, Lenovo A3300, Lenovo S850, Lenovo A2010-a, ZenFone 5 (A502CG), ZenPad C 7.0 (Z170CG), HUAWEI Y3II, HUAWEI Y635-L01.
This crash occurs when my app is in background. This is it:
Caused by java.lang.Error: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR),
fault addr 000000f0
Build fingerprint: 'Huawei/Y635-L01/hwY635:4.4.4/HuaweiY635-
L01/C21B131:user/ota-rel-keys,release-keys'
Revision: '0'
pid: 25582, tid: 25635, name: Thread-2988 >>> com.rmg.farmclicker <<<
r0 00000000 r1 6c0b30bb r2 696e5500 r3 00000055
r4 622fa90d r5 622fabf0 r6 622fa91d r7 00000000
r8 622fa91d r9 00010668 sl 622fa90d fp 62a61b24
ip ffffffe8 sp 62a61880 lr 617d4e0c pc 617d4c50 cpsr 2d353336
at libunity.004d6c50(Unknown Source)
at libunity.000d7064(Unknown Source)
at libunity.000d8510(Unknown Source)
at libunity.00312fe8(Unknown Source)
at libunity.005ed0c4(Unknown Source)
at libdvm.dvmPlatformInvoke(dvmPlatformInvoke:112)
at libdvm.dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)(dvmCallJNIMethod:398)
at libdvm.00029aa0(Unknown Source)
at libdvm.dvmMterpStd(Thread*)(dvmMterpStd:76)
at libdvm.dvmInterpret(Thread*, Method const*, JValue*)(dvmInterpret:184)
at libdvm.dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)(dvmCallMethodV:336)
at libdvm.dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)(dvmCallMethod:20)
at libdvm.00058463(Unknown Source)
at libc.__thread_entry(__thread_entry:44)
at libc.pthread_create(pthread_create:316)
I'm using some native libs on C++ in my app and I thing that problem is in them.
I think that code can be the main problem:
#elif ANDROID
struct timespec res;
clock_gettime(CLOCK_MONOTONIC, &res);
std::chrono::milliseconds uptime = std::chrono::milliseconds(static_cast<unsigned long long>(res.tv_sec) * 1000ULL + static_cast<unsigned long long>(res.tv_nsec)/1000000ULL);
return uptime.count();
So please help if you know something about it, thank you;)