title: Sending message from wearos app to phone: onMessageRecieved not called after update targetSdk
body: <p>After change phone app targetSdk from 29 to 30 ,<code>MessageClient.OnMessageReceivedListener</code> <code>onMessageReceived</code> not receive message from wearos app.
  if I set targetSdk to 29, it's works.</p>
  <p>here is my test code :
  wearos app part</p>
  <pre class="lang-kotlin prettyprint-override"><code>import android.app.Activity
  import android.os.Bundle
  import android.util.Log
  import com.google.android.gms.wearable.Wearable
  import com.hltek.hzdatalayerdemo.databinding.ActivityMainBinding
  import kotlinx.coroutines.CoroutineScope
  import kotlinx.coroutines.Dispatchers
  import kotlinx.coroutines.Job
  import java.util.concurrent.CancellationException
  
  import kotlinx.coroutines.launch
  import kotlinx.coroutines.tasks.await
  import java.util.*
  
  /**
   * wearos app
   */
  class MainActivity : Activity() {
  
      private var TAG = &quot;MainActivity&quot;
      private lateinit var binding: ActivityMainBinding
      private val job = Job()
      private val scopeIO = CoroutineScope(job + Dispatchers.IO)
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
  
          binding = ActivityMainBinding.inflate(layoutInflater)
          setContentView(binding.root)
  
          binding.btnSend.setOnClickListener {
              scopeIO.launch {
                  var str = Date().time.toString() + &quot;_ time&quot;
                  sendLiveCountData(str)
              }
          }
  
      }
  
      //send message to phone
      private suspend fun sendLiveCountData(str:String){
          var ctxt = this
          val LIVE_COUNT_PATH = &quot;/live_count&quot;
          try {
              var nodes = Wearable.getNodeClient(ctxt).connectedNodes.await()
              for (n in nodes) {
                  if(n.isNearby) {
                      println(&quot;&gt;&gt;&gt; send to nearby node node: ${n.displayName}&quot;)
  
                      Wearable.getMessageClient(this)
                          .sendMessage(n.id, LIVE_COUNT_PATH, str.toByteArray()).await()
                  }
              }
          } catch (cancellationException: CancellationException) {
              Log.d(TAG, &quot;&gt;&gt;&gt; sendLiveCountData cancellationException:.${cancellationException.localizedMessage}&quot;)
              // Request was cancelled normally
          } catch (throwable: Throwable) {
              Log.d(TAG, &quot;&gt;&gt;&gt; sendLiveCountData failed:.${throwable.localizedMessage}&quot;)
          }
      }
  }
  </code></pre>
  <p>phone part:</p>
  <pre class="lang-kotlin prettyprint-override"><code>import androidx.appcompat.app.AppCompatActivity
  import android.os.Bundle
  import android.widget.Toast
  import com.google.android.gms.wearable.*
  import java.nio.charset.StandardCharsets
  
  
  // on the phone
  class MainActivity : AppCompatActivity(), MessageClient.OnMessageReceivedListener
     {
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
          Wearable.getMessageClient(this).addListener(this)
      }
  
      override fun onPause() {
          super.onPause()
          Wearable.getMessageClient(this).removeListener(this)
      }
  
  
      override fun onResume() {
          super.onResume()
          Wearable.getMessageClient(this).addListener(this)
  
      }
  
      override fun onMessageReceived(p0: MessageEvent) {
          try {
              if(p0.path == &quot;live_count&quot;){
                  println(&quot;&gt;&gt;&gt; live_count message&quot;)
              }
              val s1 = String(p0.data, StandardCharsets.UTF_8)
              Toast.makeText(this, s1, Toast.LENGTH_SHORT).show()
              println(&quot;&gt;&gt;&gt;&gt; onMessageReceived event received:$s1&quot;)
          } catch (e: Exception) {
              println(
                  &quot;&gt;&gt;&gt; Handled in sending message back to the sending node&quot;
              )
              e.printStackTrace()
          }
      }
  }
  </code></pre>
  <p>All code:
  <a href="https://github.com/haozes/HZDataLayerDemo" rel="nofollow noreferrer">https://github.com/haozes/HZDataLayerDemo</a></p>
  <p>I checked a lot of google documents, but it didn’t show that play-services-wearable is related to the targetSdk. It’s very strange. Now I can’t upgrade the targetSdk.
  I tested it on Galaxy watch 4 and Samsung F52 phones (android11).</p>
  <p>anyone get the same problem?</p>