So I had to create an app to send and receive messages but the send action crashed whenever I clicked on send even though the permission was granted. I had requested runtime permissions and allowed them, still, faced a crash that the process doesn't have the requested permission to send SMS. I checked the granted permissions from :
The order of my request for permissions was
RECEIVE_SMS
SEND_SMS
I reverted the order of request and it works fine. This was tested with a completely new app(uninstall-> install -> test). The answer may seem weird but just give it a shot.
(If it works in the shown way in a certain order, then Android might have a bug!!)
Here is a sample of code that grants permission in the MainActivity class on the Android Project and the CORRECT order.
Answer Supported By: Partha Sarathi Murmu