Search Unity

ICS Orientation issue (Ice Cream Sandwish)

Discussion in 'Android' started by nah0y, Dec 20, 2011.

  1. nah0y

    nah0y

    Joined:
    Apr 4, 2011
    Posts:
    74
    Hello community!

    We have just found a really really annoying bug with Unity 3.4.2f3 and any device running Ice Cream Sandwish (basically GalaxyNexus or Nexus S).

    To reproduce it, it's VERY simple :
    You just create an empty project, with an empty scene, and set the orientation to landscape.
    When the application is running on the phone, just lock the screen (with the physical button on the device). And BOOM! the application dies! (look at the logs).
    So when you unlock the screen, you're not on the game anymore...

    The bug happens ONLY with ICS devices AND orientation set to landscape. Also ONLY when someone lock the screen, not if you press Home for example. Only with the lock !

    Is any Unity engineer working with Android can confirm this issue? If yes, do you think we could have a fix with a 3.4.2f4 for example? We're absolutely ready to test new Unity version and confirm the bug is over :D

    Thanks!
     
    Last edited: Dec 20, 2011
  2. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    Try changing the android:configChanges in the AndriodManifest.xml so that it includes at least "screenSize", possibly also "screenLayout".

    You can add your new manifest under Assets/Plugins/Android, and you can use Temp/StagingArea/AndroidManifest.xml (only available after you've built the project once) as a template for it.
     
  3. nah0y

    nah0y

    Joined:
    Apr 4, 2011
    Posts:
    74
    Hi erique!

    Seems like you were right! It seems to be a problem starting Android 3.2 with the "screenSize" attribute being introduced in API level 13 (3.2).
    So that just fix the problem if we do that in our custom AndroidManifest!

    But still a bug that must be fixed with Unity basic AndroidManifest right ?
     
  4. Tseng

    Tseng

    Joined:
    Nov 29, 2010
    Posts:
    1,217
    You should send a bug report from within Unity3D, so that the responsible people (i.e QA) gets it.

    Just go to the Help > Report a Bug and describe it there. Its better than doing it in the forum.
     
  5. nah0y

    nah0y

    Joined:
    Apr 4, 2011
    Posts:
    74
    Yes that has been done already, but I also posted here and had an awesome answer from erique, so it was not useless :)
     
  6. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    Absolutely - we've just fixed it internally the other day. The next release will not have this problem.
     
  7. nah0y

    nah0y

    Joined:
    Apr 4, 2011
    Posts:
    74
    Great news :)
     
  8. SirKline

    SirKline

    Joined:
    Nov 23, 2010
    Posts:
    14
    is it possible to change the default manifest? or is it deeply hidden in some compiled sources?
     
  9. lpe_nelphy

    lpe_nelphy

    Joined:
    Nov 1, 2011
    Posts:
    8
    Hello SirKline, Two way to use custom manifest on android

    1. use the /assets/plugins/Android folder as erique say above

    2. use custom android project build in eclipse or with ant. Build this project is not difficult. (the best method for us)
    * create an empty android project
    * find in unity install folder the unity player jar "classes.jar" and add to the build path
    * change your launcher Activity to extends DiotaUnityActivity
    * build apk with unity, unzip this apk and copy folder libs and asset in your custom project
    * compile and launch with eclipse or ant

    With method 2 you can create complete android project with custom manifest, activity... When you want update unity data, build apk with unity, unzip apk and replace asset folder in your custom project.
     
  10. spadesmaster

    spadesmaster

    Joined:
    Dec 29, 2010
    Posts:
    11
    I can confirm this is still an issue in Unity 3.5 (at least with Samsung Nexus Prime ICS 4.0), seems fine on our other test devices. Disabling autorotation stopped the crash on startup.
     
  11. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    We have been unable to reproduce this on Galaxy Nexus. Maybe you are using a plugin that replaces the default manifest? If not could you please file a bug with a small repro case attached?