Error - The import com.google.android.gms.ads cannot be resolved

南楼画角 提交于 2019-12-11 02:51:14

问题


I follow instruction from Google developpers but i have a problem. I want display publicity ( with AdMob ) and Google Play Game services on my application.

I display publicity with success and it's work ( I use google play services lib ). But when I want to add the BaseGameUtils library to use Google Play Game Services, I have an error.

My import which work previously doesn't works after the new library import.

The import com.google.android.gms.ads cannot be resolved

I don't remove google play services lib so why the error appears ?

Thanks


回答1:


Go to your java build path, under project tab add your lib and then under order & export tab tick your lib, apply settings. At last just clean the project and lib, it should work properly...




回答2:


  • First solution: Right click error and select the Fix project setup like below image.

  • Select google-play-service.jar right path and click ok

  • Second solution: Delete android-support-v4.jar file under libs folder after restart eclipse.



回答3:


Make sure that your library is in your build path. I had the same problem with another lib.




回答4:


I solved this error by downloading the latest version (15 as of today) of the Google Play Services. Then import it again as a library in your project.



来源:https://stackoverflow.com/questions/23713754/error-the-import-com-google-android-gms-ads-cannot-be-resolved

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