Search Unity

Resolution changes on Android device after build

Discussion in 'Android' started by viking81, Feb 4, 2020.

  1. viking81

    viking81

    Joined:
    Jul 13, 2019
    Posts:
    17
    Hello,
    I have this really weird problem with game build on physical Android device. All works fine in Unity Editor, but after export to android (tablet, landscape mode) game renders with wrong resolution (lower than native):
    tablet has 1920x1200 pix, 16:10 ratio, but game renders with 1440x900 px for some unknown reason (WXGA+ mode?)

    What can possibly cause this strange issue to make real android device to render game at lower resolution while I set Native resolution in player settings in Unity? As said, all works perfectly in Unity Editor, even worked fine during development and deploying to android tablet, didn't notice this bug until after publishing in store.
    • using Unity 2018.4.16 (Plus version),
    • latest version of Unity's & third-party assets; tested with & without IAPs, GooglePlay, etc
    • also using Atlas swapping script for HD/UHD resolution, but this fires when first scene loads - game resolution is wrong from start/splash screen.
    Game is already published (GameServices enabled), and here are some weird facts, I did all possible cross-tests:
    -if I build & run from Unity to android device with wi-fi turned ON, game starts with 1440x900 resolution, 180dpi,
    -if I turn wi-fi OFF on device, and build&run the same project on device, installed game starts with Native resolution: 1920x1200 , 240dpi !
    -simply change the name of package in Unity (even one letter), build&run on device, game starts also with Native resolution: 1920x1200

    What's going on here? :( anyone else experienced similar problem?
    There has to be something I'm missing, and how wi-fi state is connected to device resolution?

    Really appreciate any tips on what I could check and debug in order to fix this strange behaviour!
     
  2. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    By any chance you're using Remote Settings? Maybe some script is changing the resolution for you?
     
  3. viking81

    viking81

    Joined:
    Jul 13, 2019
    Posts:
    17
    No, Remote Settings are not activated at the moment for this project..
    but I found out that during development I used one username (been using for few years), there I have all my Unity's assets and I see now that I have this project (package name) connected to Unity Dashboard with one UPID - might turned Services accidentally earlier..

    But then I subscribed to Unity Plus under different username, and in a Dashboard for that username I have a different UPID for same project name / package name.

    Can this cause all my troubles?
    i want to delete/unlink project name for the first user, but I'm not sure how to do that. There is Archive option, but it says that project will be archived across ALL Unity services. Does this mean it will also affect my project under another username, and possibly published game in production?
     
  4. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Different projects shouldn't be affected.

    This is bizzare, so idk really.
     
  5. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    This sounds like something done by the device itself. In the first place, some devices have options to render in lower resolution than the maximum supported one. However that causes all content to be rendered in that resolution, so based on your experience it does not seem to be the cause. Then there are various apps that allow to set up resolution / fps limitations for different apps. That seems like a likely cause for your issue, since changing the package name makes the app look like a different one, for which those settings are not set. Look for such "optimizer" app on your tablet. One of the first google search results gave me https://www.phonearena.com/news/Sam...lution-and-framerate-of-Android-games_id74680 but there could be alternative apps as well.
    Also this thread https://forum.supercell.com/showthr...tion-Graphics-on-Samsung-Galaxy-Tab-S3-Tablet hints that the device could even do this without a Game Tuner being installed and installing it is the solution (according to the posts in that thread).
     
    Last edited: Feb 4, 2020
    xVergilx likes this.
  6. viking81

    viking81

    Joined:
    Jul 13, 2019
    Posts:
    17
    Hello, hope this thread still alive.

    Thanks for previous answers, here is a follow-up.
    After I changed the package name for my game, I was working with that new project/package for over a month now, here is all facts:
    1. I simply changed one letter in the package to have 'a new game' (lower-to-capital), been testing it locally on Android tablet - everything looked good, game rendered at Native resolution, e.g. 1920x1200 pix, 240 dpi

    2. Next step: I uploaded first bundle APK to Google Play developer acc as Alpha - everything looked great, same native resolution. Tested on one tablet as locally deployed APK, and same time on another android tablet as downloaded as Alpha tester from Google Play store. No problems, nothing wrong for a whole month of testing.

    3. Here is a bizarre thing.. after all been prepared, bugs fixed I simply rolled-out Alpha to Production in Google Play acc. Just as my game was published next day in Production mode and was visible in Google Play Store, I tested it without any changes on those two Android tablets and Game started to render at 1440x900 pix, at 180 dpi!!
    everything repeated as in previous case scenario :eek:

    Every logical conclusion points towards Google Play Developer console. My question is:
    does anybody knows what is happening at Google Play side when an app is released to production mode?
    Why does Google Play Store changes the rules and reduces game resolution (permanently), so everything renders at much lower quality while up to Alpha release all was perfect??

    I understand that I'm definitely missing something here, I just want to know what is that and how to fix it?
    Also, when I navigate to my game in Google Play store there is a warning "This app may not be optimized for your device", can this be the source of my problem? Because I know that my game is designed for any resolution and is definitely runs smoothly (as 60 fps) at larger resolution as 1920pix or even 2500 pix.

    Appreciate any tips! there has to be an explanation and solution to this.
     
    Last edited: Mar 3, 2020
  7. slongshum

    slongshum

    Joined:
    Apr 11, 2017
    Posts:
    1
    Hello! We happen to have exactly the same problem and are struggling to make heads or tails of it.

    viking81, did you manage to find out a solution?
     
  8. viking81

    viking81

    Joined:
    Jul 13, 2019
    Posts:
    17
    Hi there,

    Hi there,
    unfortunately not, despite all attempts to find a solution for this problem.

    For the moment, I 'put it on ice' due to others - more urgent tasks to do. Might come back later to this "resolution problem", I'm watching this thread.
    Hope you'll find an answer!
     
  9. ungbotond

    ungbotond

    Joined:
    Jan 29, 2018
    Posts:
    2
    Hello,

    I faced the same problem and finally found a solution. Some mobile devices use some kind of "auto optimizers" that automatically reduces the resolution of installed games if needed, that's why this issue only appears when the game is published, until that moment the device won't recognise the app as a game so it won't optimize it.

    I'm using a Samsung device and by downloading Samsung's "Game Plugins" app from the Galaxy Store then installing "Game Booster Plus" I was able to override the quality settings so my published game finally appears with the same resolution as during test phase.

    For other kind of devides I don't have an exact solution but I'm sure that the problem is the same.

    I hope this helps for you all
     
    viking81 likes this.
  10. CattleyaArt

    CattleyaArt

    Joined:
    Feb 13, 2017
    Posts:
    17
    Hi there. I have similar issue. When installing test build on device on first run it has native resolution 2340*1080 but on second open of application it has 1560*720. I am using honor mobile phone for test. I tried to run on another xiaomi device and there seems no such problem. I don't see any 'game optimizer' software installed on device
    Does anybody has solution how to deal with this problem ?
     
  11. solid_

    solid_

    Joined:
    Jul 10, 2015
    Posts:
    12
    Hello everyone. Same.
    Even in an empty Unity project with an existing package name on Google Play.
    But if i turn off the network (airplane mode) first time, the second or more launches with native resolution.
    Is Google Play sending some optimization data to the app?

    Some debug looks like for this issue

    First launch
    ViewRootImpl@24adbfd[UnityPlayerActivity]
    Relayout returned:
    old=(0,0,1080,2400)
    new=(0,0,1080,2400)
    req=(1080,2400)0 dur=4 res=0x7 s={true 503353748720} ch=true fn=-1

    Second
    ViewRootImpl@24adbfd[UnityPlayerActivity]
    Relayout returned: old=(0,0,1080,2400)
    new=(0,0,810,1800)
    req=(1080,2400)0 dur=4 res=0x7 s={true 503353748720} ch=true fn=-1
     
    Last edited: Mar 23, 2021
    madbuggerswall likes this.
  12. gh848024692

    gh848024692

    Joined:
    May 26, 2021
    Posts:
    1
    same problem , screen.safeArea is not right too
     
  13. woosh3

    woosh3

    Joined:
    Oct 29, 2020
    Posts:
    6
    Still no solution? I am having the same issue.
     
  14. ayoubnafia

    ayoubnafia

    Joined:
    Mar 8, 2021
    Posts:
    1
    i change the Aspect Ratio Mode to Native Aspect Ratio to fix my problem
     
  15. an_n

    an_n

    Joined:
    Apr 17, 2014
    Posts:
    15
    I have same problem and I have Native Aspect Ratio in the game settings as well, so it didn't help... may be I have to use "Custom"? Every second device now has this problem after release (all of them are Samsung devices), the game is a mess X(
     
  16. Alik_Mv

    Alik_Mv

    Joined:
    Dec 18, 2021
    Posts:
    1
    In my case it was incorrect positioning of the object on the canvas
     

    Attached Files: