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

大憨熊 提交于 2020-01-05 14:12:54

问题


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?


回答1:


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




回答2:


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.+" }




回答3:


Add GCM.jar in your project from Properties.



来源:https://stackoverflow.com/questions/19678787/cant-import-import-com-google-android-gcm-gcmbaseintentservice

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!