Recently I bought a new phone(Xiaomi Mi A2) and very weird thing happens when I try to test my apps on it. Admob test id keeps changing. I copy the id from the logs as always("Use AdRequest.Builder.addTestDevice("XXXXXXXX") to get test ads on this device"). I add it to the AdRequest.Builder. I run the app and at first everything works fine I get test ads, but then the next day the admob id changes and I get real ones. Today I got 3 different ids (happened each time I restarted Android Studio). This never happens with my other phone.
I don't know if its related but sometime my device is recognized as Xiaomi Mi A2 and sometimes it just shows null(XXXX). I can't get any logs when its null but I can install the app normally. Restarting Android Studio helps with that.
What could possibly cause this? Is this a problem with Android Studio or my phone?
EDIT: I think I found the reason. My new device has Android 8.1 and apparently ANDROID_ID is different for every app and can change if the signing key is different https://developer.android.com/about/versions/oreo/android-8.0-changes