0

I'm sure I've just missed something obvious, but I'm at a loss of where to look to solve this. I'm trying to get started with android wear, and am following the tutorial on this page. However I can't find any information about which libraries I need to include or where to get them from. I'm using eclipse and have used the Android SDK manager to download the Android Wear System Image (although I have a G-Watch to test it on) and all the 4.4W stuff, and I've set the project to build against 4.4W but I still get the following error

The import android.support.v4.app.NotificationManagerCompat cannot be resolved
The import android.support.v4.app.NotificationCompat.WearableExtender cannot be resolved

I have the android-support-v4.jar included and android.support.v4.app.NotificationCompat is found OK, but I can't see anywhere in the android wear docs that it says I can get this library and it's driving me nuts. If someone could point me in the right direction that would be great.

Thanks

Ben
  • 1,767
  • 16
  • 32

1 Answers1

5

There is no android.support.v4.app.NotificationManagerCompat in the support library.

There is in the current one. Examining my android-support-v4.jar shows this class. Make sure that you have the latest version of this JAR downloaded to your machine (from the SDK Manager) and in your project (e.g., copied to libs/ from $SDK/extras/android/support/v4/, where $SDK is wherever your Android SDK is installed).

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • thanks, so apparently I created the project before updating the SDK and it copied instead of linked to the file, so now I've copied over the new one it is all, finally, working. Thanks – Ben Jul 04 '14 at 16:12
  • @Ben: Yes, in general, attaching a JAR like this makes a copy. That way, when the JAR gets updated, you don't necessarily break (build time or runtime) because of changes in the JAR. OTOH, you do need to remember to update it from time to time. This is one of the reasons why Android development is moving more towards artifacts in Maven-style repositories, using Maven or Gradle for Android as the build system, to help you better manage dependencies like this. – CommonsWare Jul 04 '14 at 16:58
  • that makes a lot of sense, it's still kinda irritating in this instance, but I will, reluctantly, acknowledge that it is the right thing to do. – Ben Jul 07 '14 at 16:53