Why does Google Messages (SMS/MMS) app lose phone number? I've been using Google Messages since it released a year or two ago on the same phone.
Suddenly, three days ago the app popped up a message and said, &quot;Your phone number isn't available in the settings for this app.  Do you want to add it?&quot;
I added the number (see snapshots below for how to get to settings in Google Messages).
App Forgets Phone Number
However, (even though I've added the number) each time I turn my phone off (for example, at the end of each day) the data seems to be lost because when I turn my phone on again and Google Messages app starts again then the number shows as UNKNOWN again.
Doesn't Know Who I Am
When the app starts and doesn't have the phone number filled out, it sends the messages I send to myself also.
Is this setting a new feature?
What are some reasons this might be occurring?
Getting To The Settings In Google Messages


Select Advanced...


Phone Number UNKNOWN
You can see (at the bottom) the phone number is unknown.




MMS Messages Are Affected
This affects my MMS messages (specifically when I'm in a group message).
The thing that happens is that the phone doesn't know my number so when I send a message to the group it believes there is another receiver and that receiver has my phone number so I receive my own message.
Phone Settings
My phone settings have not changed and when I look under the main phone settings I can see that my phone number is correct.  Also, if I type in the phone number then the group messages work fine but I have to remember to do that every day.
Try the following process:


Uninstall the app.
restart the phone.
obtain the app from Google Play
Install the app again


Update

Today, after turning my phone on (after uninstalling and installing Messages yesterday), Google Messages asked me for my phone number.



I'm assuming this is because I re-installed the app yesterday.

However, it did not show this message yesterday after restarting.

I remember seeing this message long ago when the problem started and I believe that time I chose Don't Ask Again.  This time I'm leaving that option unselected to see if it helps solve the problem.

I added my number and clicked OK and it seemed to save the number to the app the same way as when I manually add it.  Let's see if retains the data now??

Update 2

I turned my phone off and allowed it to restart.

I get the following message but only when I start Google Messages and then click a Group Message (MMS).  I will see this little warning at the bottom of the group.  It shows up as :


  Messages needs your phone number - FIX


If you click the FIX message then it proceeds to the other screen where you can enter your number.  If you don't click that message in about 3 seconds it disappears.  

If I add the phone number and say don't ask again then it saves my number while the phone is on but doesn't save the data permanently.

If I add the phone number and allow it to ask again then it saves my number while the phone is on but still doesn't save the number permanently.




UPDATE 3

Device Displays Phone Number

My phone number shows up perfectly fine on my device under: 

Settings =&gt; About phone =&gt; Status =&gt; My phone number


So, I figured I should test the Android API call and see if that works on my phone.

Retrieve Phone Number Via Android API 

I added some code to retrieve my phone's number using the Android API.
I added the code to another program I had previously created and added the command to the menu and ran the code and it successfully retrieved my phone number.

If I Can Write That Code, Google Messages Devs Should Be Able To Also

I've blotted out my phone number but you can see the first two digits and that the app is able to retrieve the phone number so Google Messages should be able to do that automatically too.

Here's the basic code I used to do that:

// 1. use TelephonyManager API
TelephonyManager tMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

// 2. insure that the app has the correct permissions to allow it to read phone number
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_SMS) != PackageManager.PERMISSION_GRANTED &amp;&amp; ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_NUMBERS) != PackageManager.PERMISSION_GRANTED &amp;&amp; ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
    // 3. handle perms failure here.
}
// 4. get the phone number
String mPhoneNumber = tMgr.getLine1Number();
// 5. display the phone number in the main text control (outText)
outText.setText(mPhoneNumber);






Update 4

I added a few more API calls to get more information about my phone:



I figured maybe this only occurs on GSM devices or something (versus CDMA)??
I wanted to show that the SIM card is in a good state.
I was curious about the MMS agent that is being used.

NOTE: The "Device Software Version" is actually the telephony driver and not the Android API level.  This phone is running Nougat API level 25.

Here are the extra calls I made to the API (they're all TelephonyManager calls):

tMgr.getMmsUserAgent()
tMgr.getDeviceSoftwareVersion()
tMgr.getPhoneType() // GSM, CDMA, SIP or NONE
tMgr.getSimState() // numerous states (see docs*)


*docs