Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Wear CapabilityApi cannot find handheld capabilities

I'm attempting to use MessageAPI to communicate back and forth between my handheld app and wearable app. I can't get the communication to work. I can confirm the devices are connected, but when my code executes, it acts like neither app has registered the Capability I am requesting.

  • notifications are successfully sent from handheld to the wear device
  • Wearable.NodeApi.getConnectedNodes(mGoogleApiClient).await() returns a list showing the handheld or wearable is indeed connected
  • Wearable.CapabilityApi.getAllCapabilities(mGoogleApiClient, CapabilityApi.FILTER_ALL).await() returns an empty list :-(
  • values/wear.xml has been set for both apps
  • both apps have the same applicationID set in gradle
  • both successfully connect to the GoogleApiClient
  • both register a listener with Wearable.MessageApi.addListener()

What other possible points of failure are there that I should check? My sample apps work great, and I integrated it into an existing simple project successfully, but when I add the same code to my major project, it doesn't work. I've combed through but can't find any code that could interfere with what I'm doing.

like image 552
Ethan_AI Avatar asked Oct 31 '22 02:10

Ethan_AI


1 Answers

Turned out that a line from the build.gradle file was causing the trouble.

debug { signingConfig null }

Removing this line fixed restored the connection between the Wear and the Handheld apps.

like image 189
Ethan_AI Avatar answered Nov 11 '22 11:11

Ethan_AI