简体   繁体   中英

can't import import com.google.android.gcm.GCMBaseIntentService

guys i have a huge problem here. i have a project that uses gcm but the import can't be resolved. I've tried all other suggestion on this site and others but nothing seems to work. please help I've downloaded the library copied the jar into my /libs folder and added it to build path

but i still got an error on the import

what can be the problem?

first delete google play services from eclipse and clean project

For google play services first install Google play Services

SDK Manager -> Extras -> Google play Services

after installing go to

File->import->your SDK folder path ->extras->extras/google/google_play_services/libproject/google-play-services_lib

Make sure gcm.jar is exist on your adt

/Users/SS/Desktop/Android/adt-bundle-mac-x86_64-20130717/sdk/extras/google/gcm/gcm-client/dist

http://developer.android.com/google/gcm/client.html

The key point is that you must reference the library—simply adding a .jar file to your Eclipse project will not work. You must follow the directions for referencing a library, or your app won't be able to access the library's resources, and it won't run properly. If you're using Android Studio, this is the string to add to the dependency section of your application's build.gradle file:

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

通过“属性”在您的项目中添加GCM.jar。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM