Quantcast
Channel: Questions in topic: "crash"
Viewing all articles
Browse latest Browse all 2383

is this a bug of unity?it cause crash on some android device.

$
0
0
on some android device, when i click the game icon.there is a white screen with title, when the screen not disapear, touch screen and move on screen crazy. it will crash, call stack like this: #00 pc 003eaa28 /mnt/asec/com.test.demo-1/lib/libunity.so #00 lr 003eaa28 /mnt/asec/com.test.demo-1/lib/libunity.so java: com.unity3d.player.UnityPlayer.nativeInjectEvent(Native Method) com.unity3d.player.UnityPlayer.nativeInjectEvent(Native Method) com.unity3d.player.UnityPlayer.nativeInjectEvent(Native Method) com.unity3d.player.UnityPlayer.a(Unknown Source) com.unity3d.player.UnityPlayer$13.a(Unknown Source) com.unity3d.player.UnityPlayer$c.run(Unknown Source) com.unity3d.player.UnityPlayer.executeGLThreadJobs(Unknown Source) com.unity3d.player.UnityPlayer$b.run(Unknown Source) if i use different version of unity, the crash address 003eaa28 is different. we have notice that the nativeInjectEvent is used to process input event, i guess this input event is too early to inject to UnityEngine, so we have found a solution to fix this crash temporarily. in our activity class which is specified in the manifest, we override all input functions and disable all event injecting until we enable input by our codes in c#. this code should be like this: @Override public boolean dispatchKeyEvent(KeyEvent event) { if (!bEnableInput) { return true; } return super.dispatchKeyEvent(event); } @Override public boolean onKeyUp(int keyCode, KeyEvent event) { if (!bEnableInput){return true;} return mUnityPlayer.injectEvent(event); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (!bEnableInput){return true;} return mUnityPlayer.injectEvent(event); } @Override public boolean onTouchEvent(MotionEvent event) { if (!bEnableInput){return true;} return mUnityPlayer.injectEvent(event); } @Override public boolean onGenericMotionEvent(MotionEvent event) { if (!bEnableInput){return true;} return mUnityPlayer.injectEvent(event); } and then ,when the unity have initialized. when can set bEnableInput to true in C# script by AndroidJavaClass. if this is a bug of unity, I strongly advise you to fix this problem. this bug is still exists in unity 4.6.6 p4, but it is not exists in unity 5.x

Viewing all articles
Browse latest Browse all 2383


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>