Search Unity

Unity Apps Crashing on Samsung Galaxy S4

Discussion in 'Editor & General Support' started by LightSky, May 24, 2013.

  1. LightSky

    LightSky

    Joined:
    Aug 12, 2012
    Posts:
    45
    I just bought a new Samsung Galaxy S4 and it will crash right after the Splash Screen.
    I have tried to run most of my projects on it and none will work. Also I tried to run Angry Bots and several other Unity made demos. None of which worked. Unity is fully updated and I have all the settings on the phone configured like I normally would and cannot figure out what the problems is.
    Is anyone else out there having any success with the same phones? Or have any suggestions?
     
  2. FussenKuh

    FussenKuh

    Joined:
    Jul 4, 2012
    Posts:
    10
    I am having similar problems... But no solution. I've been working on a game that I've tested across a dozen 'old' devices including a Nexus 7 and several galaxy s3 phones. The game works flawlessly. However, when I load it on my friend's s4, it crashes as soon as he attempts to touch the screen. Thus far, I've been able to trace the problem to a camera.Screentoworldpoint call. If I comment out that call, the game doesn't crash. If I make that call, the game immediately explodes and returns back to the android home screen.

    Most of the development has been done using Unity 3.5.7. However, after encountering the issue I upgraded to 4.1.3. I'm still seeing the same issue
     
    Last edited: May 26, 2013
  3. shaderbytes

    shaderbytes

    Joined:
    Nov 11, 2010
    Posts:
    900
    My brother has a S4 and downloaded my game I just put on Google Play and it had no problems? here is the url its free so no worries :

    https://t.co/Xyu5vH8Pln

    I used Unity 3.5.7 and Android basic to develop.
     
  4. FussenKuh

    FussenKuh

    Joined:
    Jul 4, 2012
    Posts:
    10
    Just gave your game a try on my Nexus 7. (I don't have my friend's s4 to test with). Are you using screentoworldpoint to determine which flipper to flip? My friend can run another prototype of mine that uses touch input but not screentoworldpoint without issue. It's quite frustrating to not have a s4 at my disposal to properly debug this issue ;-)

    By the way, great work on your game! It runs rather well. The only issue I have with it is that the ball moves too fast for my liking. But, perhaps that's just a sign that my pinball skills just aren't as good as they once were.
     
  5. shaderbytes

    shaderbytes

    Joined:
    Nov 11, 2010
    Posts:
    900
    Im using touch input position - which is already in screen space so no need for any conversions I just validate the x value against Screen.width/2.

    Strange problem you are having indeed. I know I do use WorldToScreenPoint in some code that runs in the editor for my UI Framework and this has no issues. At runtime I know I use WorldToViewportPoint for doing clipping on scrolling lists. Hope some more people with a S4 can verify this problem you are having at runtime on the device.

    Anyway thanks for commenting on the game - dont want to derail the thread , just wanted to point to a Unity Game that I personally know works on the S4.
     
  6. FussenKuh

    FussenKuh

    Joined:
    Jul 4, 2012
    Posts:
    10
    In case anyone has an S4 (or any other more 'modern' phone/tablet) and wants to help debug the problem, here's a Dropbox link to a test app that might show the issue: ( I've not had a chance to test this test app on an S4 yet )

    [ URL Removed ] - Problem resolved so I've removed the test app from my Dropbox space

    The test app is simply a test scene that I baked into the game I'm developing. As such, you'll notice that when you install it, the app is called Bouncing Bombs and has a set of permissions to allow for online leaderboards, google play in-app purchases, etc. All those things are a bunch of no-ops since the test scene is just a few generic buttons and checkboxes. Oh, and the scene doesn't have the Android back button mapped to anything, so, you can only exit the scene by hitting the Home button.

    As for the test, itself:
    • There are 5 buttons that can be pressed. When a button is pressed, the big button in the middle of the scene should update to state which button has been pushed
    • There is a dark box in the middle of the scene. If you touch drag from that box, you should see a Screen Pos label update with screen position
    • If you enable any of the checkboxes and repeat the touch drag from the dark box, you should see more position values being updated/displayed

    Ideally, all of the check boxes should be able to be enabled and you should be able to drag and see all the various positions updating. My speculation is that the app will work without issue with NO checkboxes checked. However, if you enable the ScreenToWorld checkbox and attempt to touch/drag from the dark box, I'm guessing that the app is going to crash; at least that's the behavior that's being reported to me when my friend attempts to run my full game.

    I have no idea what will happen if any of the other checkboxes are enabled since I don't have a S4 to test against. I would be grateful to anyone with an S4 that's willing to give the test app a try
     
    Last edited: May 28, 2013
  7. FussenKuh

    FussenKuh

    Joined:
    Jul 4, 2012
    Posts:
    10
    For anyone watching this thread, I figured I ought to keep updating my findings. Got some feedback from my friend about the .apk file I posed here. The test program does NOT crash when he attempts to run it. He can toggle any combination of check boxes and the program runs without issue.

    The confusing hunt continues...
     
  8. FussenKuh

    FussenKuh

    Joined:
    Jul 4, 2012
    Posts:
    10
    The thrilling conclusion!

    Ok, so not really thrilling, but, I figured I ought to wrap up my S4 story in the hopes that it might help others. Unfortunately, the conclusion is a bit murky. As noted in an earlier post, I had tracked my crash down to a camera.Screentoworldpoint call I was making. However, when making that same call in a simple test app, I ran into no issues (as one might expect). This data caused me to rethink (and redo) my touch input scheme; it was overly complex to begin with, so, it's probably good that I took the time to redo it anyway. Once re-implemented, my S4 crash disappeared.

    I believe that the root cause of the problem actually had to do with a variable I was using to hold my screen position that I was writing/referencing in an unsafe way. My guess is that the crash I was seeing was simply caused by a race condition that showed itself when the .apk was deployed on a phone/tablet with beefy hardware.
     
  9. shaderbytes

    shaderbytes

    Joined:
    Nov 11, 2010
    Posts:
    900
    Glad you have sorted out your problem ;)
     
  10. LightSky

    LightSky

    Joined:
    Aug 12, 2012
    Posts:
    45
    Turns out that I am able to run my app on the Galaxy S4 if I run it once (it will crash) and then run it again and it will work. It has a chance to crash each run. Once run it will only crash when going back to my main menu.
    Ex:
    Splash -> Crash going to main menu
    Splash -> Main Menu -> Game -> Crash going to main menu

    The error I am getting every time from Logcat on a crash is:
    Splash Screen -> Main Menu
    E/QcrilMsgTunnelSocket(27235): IOExceptionjava.io.IOException: No such file or directoryReason: No such file or directory
    Link to whole Logcat: https://dl.dropboxusercontent.com/u/69196539/MainMenuCrash.rtf

    From Game Scene -> Main Menu
    E/QcrilMsgTunnelSocket(30897): IOExceptionjava.io.IOException: No such file or directoryReason: No such file or directory
    Link to whole Logcat: https://dl.dropboxusercontent.com/u/69196539/GameSceneError.rtf

    I am only receiving this error when I run it with the S4. I have received this error in Unity 4.0.1 and then updated to the latest version, which I am still receiving the error, also my SDK is updated . I am not referencing any external files outside of the project and only using what is inside of my assets (all of which are textures). Anyone who has insight or experience with such an error such as this would be incredibly appreciated.
     
  11. FussenKuh

    FussenKuh

    Joined:
    Jul 4, 2012
    Posts:
    10
    I don't claim to know anything about what the QCRIL is, but, Googling with a little guessing makes me think it might stand for QualComm Radio Interface Layer. i.e. the O/S layer that allows the O/S to talk to the phone's radio hardware. Looking through your MainMenuCrash.rtf, it's riddled from beginning to end with those QCril exceptions. After a few of those exceptions, it prints out a "Couldn't find 'qmux_radio/rild_oem0' socket; retrying after timeout" message. Then it eventually repeats the exceptions and more "timeout" messages.

    Is your app attempting to use the network in any way? Could something in your Main Menu screen logic be attempting to access the network and failing horribly? Could the failure have something to do with Jellybean 4.2.2? To my knowledge, not many phones/tablets besides the Nexus 4, 7, 10 and Galaxy S4 run 4.2.2 yet. Perhaps's there's some sort of Android permissions issue between pre-4.2.2 and 4.2.2?

    In addition to the exception you specifically called out, the MainMenuCrash.rtf file contains quite a few more exceptions. Lucky for me, I've not had to delve into logcat files in the past, so, I have no idea how 'normal' any of the other exceptions are. But, typically, exceptions aren't a sign of things going as expected. Perhaps your issue is really tied to one of the other exceptions?

    In case you can't tell, I'm kinda grasping at straws here ;-) Perhaps some of these thoughts might trigger a more clear idea in someone else's mind...
     
  12. LightSky

    LightSky

    Joined:
    Aug 12, 2012
    Posts:
    45
    Thanks for the input.
    However my application runs fine on 4.2.2 devices and seems to only be breaking on the Galaxy S4 so far. (We've tested on every device we have) The application does in fact use the network however I have tested it while it was disabled/removed and still has the same problem. I am more of picking at straws atm and am wondering if it is somehow a Unity incompatibility issue with the newer devices since my application is not the only one that it is breaking on. As previously stated I have tried it on Angry Bots and several other Unity apps and they break the same way.
     
  13. LightSky

    LightSky

    Joined:
    Aug 12, 2012
    Posts:
    45
  14. rotg

    rotg

    Joined:
    Feb 27, 2013
    Posts:
    3
    Having the same problem with my new S4. If someone could shed some light on this I would be really happy!
     
  15. LightSky

    LightSky

    Joined:
    Aug 12, 2012
    Posts:
    45
    Well it is nice to know i'm not the only one that is having issues with this. If anyone has found a solution to this, it would be very much appreciated.
     
  16. devin8

    devin8

    Joined:
    Jul 15, 2012
    Posts:
    19
    I never tested my app on S4 but I am getting complaints from users that it's not working on their S4.
    The game starts, logo shows up and then goes back to home screen. The link is in my signature.
     
  17. LightSky

    LightSky

    Joined:
    Aug 12, 2012
    Posts:
    45
    This is the exact same thing that is happening with mine. I'm still trying to figure out if there is an incompatibility with this phone and Unity.
     
  18. rotg

    rotg

    Joined:
    Feb 27, 2013
    Posts:
    3
    Ok so i have traced the issue with my game down to a null pointer in the awake method of one of my scripts. Strangely, no exception was thrown. But, now the same crash as before happens when i connect to a server immediately after the connection has been established. So in conclusion, i'm still none the wiser...
     
  19. the_djul

    the_djul

    Joined:
    Sep 1, 2012
    Posts:
    3
    I have a similar problem with my game, a user reported a crash just after the access to the first scene, while it runs fine on a nexus 7 (android 4.2.2 as well). Could someone run the game on a galaxy S4 and send me a bug report or a logcat file in private message?

    Here is a link to my game
     
  20. LightSky

    LightSky

    Joined:
    Aug 12, 2012
    Posts:
    45
    After searching through all my code for a long time I finally found an object that was returning a null pointer in my first scene. After fixing that issue it now works on the S4 very smoothly without any glitches. Weird that it crashed for just this phone an no others. Nonetheless, if you are having an issue and it is returning some weird errors on the S4, go look for a null pointer or similar errors.
    Weird part was it wasn't appearing in the log cats saying "null pointer" or in the Unity debug log.
     
  21. MooMoo-Games

    MooMoo-Games

    Joined:
    Jan 10, 2013
    Posts:
    10
    Only S4 crashes in using null pointer?

    I have the same crash problem in Galaxy S4, but no problem in all other android phones.

    Does Android OS in S4 have more strict error checkup?
     
  22. LightSky

    LightSky

    Joined:
    Aug 12, 2012
    Posts:
    45
    Correct. Never had this issue until we had got our hands on an S4.
    No idea, I just know that as soon as I fixed the null pointer it immediately worked and hasn't had any issues yet. This is a better question for a Unity Developer, my guess is yes since that that was the problem.
     
  23. ldaughtry

    ldaughtry

    Joined:
    Oct 30, 2012
    Posts:
    38
    Hey all,

    Figured I'd report too. We had the same problem. S4's quietly failing when all our other devices work fine.

    It was a combination of a race condition we hadn't caught on other hardware along with the S4 giving no log output at all whatsoever when it tried to iterate on a null List. Just dropped out of existence.

    After A LOT of log debugging we found where it was and put some brute force failsafes in place and the problem appears to be fixed.

    So, it will null ref and not tell you where. You may have to do some tedious log debugging to find the problem.
     
  24. the_djul

    the_djul

    Joined:
    Sep 1, 2012
    Posts:
    3
    Can someone test the game and send me the logs of the crash please?
     
  25. BeardOfFury

    BeardOfFury

    Joined:
    Sep 4, 2012
    Posts:
    18
    Hey guys I just had these silent crash issues with the Galaxy S4 as well and thought I'd post my findings.

    We had it happen at try catch blocks during initialisation. So we had to replace those try catches with some more complicated error handling but it seems to have done the trick. So maybe check there and put some Debug.Log statements before and after the blocks.

    It also explains why it crashes silently because the exception for us was caught and never printed, but the S4 decided it would crash anyway.

    Anyho goodluck!
     
  26. Runnerman12

    Runnerman12

    Joined:
    Jul 20, 2012
    Posts:
    33
    User is having issue with our game as well on S4, but others are doing fine that have S4s. Not sure what the problem is, but doing a search and finding this thread is not a good feeling. Seems like others are also having issues. Using Unity 3.5.7 with no issues.
     
  27. ForrestU

    ForrestU

    Joined:
    Apr 22, 2013
    Posts:
    4
    Same issue here...it works fine on Nexus7, GalaxyTab2, GalaxyS2, GalaxyS3....it crashes on Nexus4 and GalaxyS4 . I use the network.
     
    Last edited: Aug 19, 2013
  28. ForrestU

    ForrestU

    Joined:
    Apr 22, 2013
    Posts:
    4
    Found the issue finally :-?
    For me it was image post processing components attached to the MainCamera. (Noise, Bloom or DOF..any of these)
    Tried an empty scene with just the camera and made some experiment. ( 100 % tested )
    The very strange thing is that those components are all DISABLED, but it's not enough. Apps work ONLY if I remove them.

    Btw as stated before, this issue shows only on the devices previously listed and in Unity 4.2 or 4.1.3

    To Unity Support:
    Are you reading this?Can you confirm that?

    Hope this helps someone...


    EDIT: reimporting latest image effects pack also fixes the issue
     
    Last edited: Aug 20, 2013
  29. TomasSala-Falconeer

    TomasSala-Falconeer

    Joined:
    Jul 29, 2013
    Posts:
    50
    I'm having a similar issue,, just got the s4 today, got excited and ran a build (with very poor perfomance, even less than my archos tablet.. and way less than my old note II) so decided to run all the updates including a firmware update. and suddenly it crashed after splash screen..

    Just removed all references to the bloom shader and now it runs again,, So can confirm that post effects are probably a no-go..
    same effect in opengl 3.0. CTD after splash. Without bloom 3.0 will run, but the skinned meshes will flip into an infinite twich, and flatline freeze your entire phone (guessing 3.0 is not ready for the big-leagues yet)

    Still performance is really sub-par.. seeing as the 3Dmark score for the s4 is nearly double.. Perhaps something is throwing a repeating error or something that destroys the performance (its bout 23 fps, where note II did 34-40 fps, and archos does 27-30 fps)

    anyhoe, will experiment, can't believe this beast doesn't outperform a low cost tablet by a factor)
     
  30. jesusluvsyooh

    jesusluvsyooh

    Joined:
    Jan 10, 2012
    Posts:
    377
    Hi, im getting the same issue with some players using samsung galaxy s4.
    Unity is up to date and Android SDK hasn't been updated in a month
    (updating that may fix the issue for new devices such as the s4?)

    I use Unity Free so no special camera effects such as blooms. Also doesnt use any fancy touch or camera features suggested by others.
    My game is getting a complete makeover from scratch anyway so I'm hoping this fixes the issue, along with updating the SDK.
    I'l try reply to let you know if i fixed/didnt fix the issue! ^_^

    Disillusions - Manga Horror
    flamefalcon.co.uk
     
  31. Straafe

    Straafe

    Joined:
    Oct 15, 2012
    Posts:
    73
    Also having odd problems on the S4. Have had multiple people say it simply crashes after running for ~20seconds. One guys using an S4 said it crashed so bad it actually rebooted his phone.. this is all on a release version that works perfectly on the Nexus7, S2, S3 and random lower end phones like the HTC vivid and Pantech Burst
     
  32. artaka

    artaka

    Joined:
    Feb 19, 2013
    Posts:
    128
    I'm having the same exact issue many months after this thread was started. The strange thing is that the build works on one Galaxy S4 but not on another. So I decided to tested it on yet another ( third ) S4. Strangely, it worked. The crash however persists on the second phone and it happens right as it's switching from one scene to another. I will try the solutions posted in this thread and will post any further findings.
     
  33. artaka

    artaka

    Joined:
    Feb 19, 2013
    Posts:
    128
    Happy to report that the bug was fixed by simply updating the version of Android. The one crashing was 4.2.2. That got updated it to 4.4.2 and the issue is gone.
     
  34. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    354
    Hi all, I'm also having issue with S4. Game crashes after Splash Screen and I don't really know how to handle exceptions. Not that good at programming, so how should I proceed?
     
  35. DanTaylor

    DanTaylor

    Joined:
    Jul 6, 2013
    Posts:
    119
    Thanks, MuppetMuppet!
    I was having the same issue with G4 and Droid Maxx.
    Removing all references to Screen Effects fixed it.
    Yay!
    :)