2

I am moving my App Engine Connected Android Project from Eclipse to Android Studio. It all worked on Eclipse of course. But Gradle isn't finding my gcm files. I pulled the appropriate dependency as

compile "com.google.android.gms:play-services:3.1.+"

But my imports are still not found

import com.google.android.gcm.GCMBaseIntentService;
import com.google.android.gcm.GCMRegistrar;

Is there a new way of doing Notifications, is that why my code is not working?

Katedral Pillon
  • 14,534
  • 25
  • 99
  • 199

2 Answers2

0

Check my answer here which may help you to solve this issue.

https://stackoverflow.com/a/29765398/3364266

Community
  • 1
  • 1
Samir Bhatt
  • 3,041
  • 2
  • 25
  • 39
0

To begin with, the C2DM package you are trying to import (which includes GCMBaseIntentService and GCMRegistrar) has been deprecated and you must now use the GoogleCloudMessaging API (now under Google Play Services).

Do take note that C2DM will be shut down completely on July 30, 2015.

Having said that, the answer to your question is that you can reference the gcm.jar file you used in Eclipse. The gradle dependency you put ("compile com.google.android.gms:play-services:3.1.+") will only work if you use the newer GoogleCloudMessaging API. If you'd like to keep your old implementation (at your own risk), please read ianhanniballake's answer here.

Community
  • 1
  • 1
Koh
  • 1,570
  • 1
  • 8
  • 6