Why BoxCollider2D is smaller in built application than while testing in editor?

In UnityEditor everything is OK. BoxCollider2D has expected size.
But when I try to build *.apk file and run application on my Android device - collider has size much smaller than I set.

BoxCollider2D is attached to object which has RectTransform.
I try to resize collider on ‘Awake()’

void Awake()
{
    _collider = GetComponent<BoxCollider2D>();
    _collider.size = GetComponent<RectTransform>().rect.size;
}

(the same on ‘Start()’)

Why BoxCollider2D is smaller in built application?
Do anyone knows how to resize it properly?
Is it Unity defect?

p.s. Android device is ‘Sony Xperia XA Ultra’
Unity 2018.2.1f1 (x64)

Good day.

Is this BoxCollider in an object inside a Canvas?

How is the canvas configured? is Scaling with screen size? maybe pixel constant? Depending on how you have it, if the screen dimensions change, all its rect transfomrs will also change, but collider will stilkl have the same size, so it “seems” collider changed size, but is not, its the object that changed.

Bye.

Thanks @tormentoarmagedoom

You gave me right direction.
_
Solution: Change canvas settings

‘Render Mode’ to ‘Screen Space - Overlay’

&

‘UI Scale Mode’ to ‘Scale with screen size’.

_
No any other combinations work.

Now I need to make some recalculation in my project because some animations are broken, but at least now collider is resized as I need.

Thanks.

[123901-main-canvas-screenspace.png|123901]

Thanks @tormentoarmagedoom

You gave me right direction.
_
Solution: Change canvas settings

‘Render Mode’ to ‘Screen Space - Overlay’

&

‘UI Scale Mode’ to ‘Scale with screen size’.

_
No any other combinations work.

Now I need to make some recalculation in my project because some animations are broken, but at least now collider is resized as I need.

Thanks.