0

When I started developing my Android Wear companion app I was unaware that the package name had to be exactly the same in order to connect. So instead of naming it com.example.myapp, I named it com.example.wear. I subsequently found out that both package names must be the same, so I changed the companion's package name to com.example.myapp.

But I am still having trouble to get them to connect. I also noticed that when I try to uninstall the app using the command adb -s emulator-5554 com.example.myapp, the uninstall fails, but when I use the old package name (com.example.wear) it succeeds. So the application ID never actually changed.

I found in Module Settings, under the 'Flavors' tag, there is a field for Application ID. The name here was still the old package name, so I changed it to the new one as well, yet the problem still persists. I have already done a decent amount of work, and I would rather not start over from an older build. Has anyone else ran into this problem? Is there a solution?

EDIT: I have also tried setting applicationId 'com.example.myapp' under android { defaultConfig { } } in the the build.gradle file. Nothing has changed.

Bryan
  • 14,756
  • 10
  • 70
  • 125
  • 1
    Have you updated your Manifest file with the new package name? I am not sure what you exactly did when you said you changed the companion's package name to ****; did you mean you made the change in the manfiest or you did the package change on the filesystem/directory structure? – Ali Naddaf Oct 23 '15 at 19:45
  • @AliNaddaf Yes, I did both. I right clicked on the package name, selected Refactor > Rename... , which gives a warning. In the warning dialog I selected 'Rename package', which to my surprise actually changed the package name in the Manifest file as well. – Bryan Oct 23 '15 at 20:00
  • 1
    Can you do a "gradle clean" and then grep for the old ID to see if there is anywhere else it can be found? – Ali Naddaf Oct 23 '15 at 20:59
  • @AliNaddaf I honestly do not know what fixed it. I came back from the weekend, and now the app is installing as the new ID. Anyway, thank you for your help. – Bryan Oct 28 '15 at 12:19

1 Answers1

0

The emulator is caching this stuff. It need to be cleaned some how may be re-creating the emulator.

Mudasar Rauf
  • 544
  • 7
  • 18