I'm encountering the strange behaviour that my UI (canvas with some buttons) is looking differently after the second launch on mobile. Restart of the phone does not help. This does not happen in play mode. This does not happen in play mode and only einstalling the app results again in the correct view. (installation is done via transfer of apk to phone and installing it). There are no errors in the console and everything works on the first start. The version used is 2021.1.15
In the editor the screen resolution is set to the same as the phone, the canvas scaler script is deactivated, there is no script that scales or adds elements dynamic or from a save file. All elements are places via the inspector.
The numbers on the button are the position and size
GetComponentInChildren<Text>().text = transform.position.ToString() + GetComponent<RectTransform>().sizeDelta.ToString();
The button itself is default button added over the menu with no layout at all, values adjusted over the inspector. The original scene had more objects in the scene itself which where not affected by the second launch, only the UI gets messed up. The button has still the same reported size on the second launch but the position is way smaller.
Now if I add the canvas scaler, set it to scale with screen size and enter the same values as my phone uses, I'm getting a slightly different behaviour. The first launch is still exactly the same, on the second launch the buttons are still similar to the first launch but all the numbers are still from the second screenshot. While the UI displays all element, they are not as sharp as on the fist launch.
Why would the canvas think the phone has a resolution of 1493x720 on the second launch instead of the correct 2240x1080?
Here are the numbers between the two launches.