简体   繁体   English

Android Studio。 GooglePlayServiceUtil的NoClassDefFound错误

[英]Android Studio. NoClassDefFound Error for GooglePlayServiceUtil

Newbie to android and android studio.. Trying to use Google Play Services for implementing GCM. android和android studio的新手。尝试使用Google Play服务实现GCM。 Was following how to set up play-services 正在遵循如何设置播放服务

and Demo GCM Client 演示GCM客户

But got 但是得到了

01-01 21:01:25.094  11590-11590/com.abc.ads E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com/google/android/gms/common/GooglePlayServicesUtil
        at com.abc.ads.DummyActivity.checkPlayServices(DummyActivity.java:101).

There are answers for this same issue in SO itself. SO本身也有针对同一问题的答案。 But all of them are "ecclipse" related. 但是所有这些都与“日食”有关。 How solve this in Android Studio? 如何在Android Studio中解决此问题?

Upgrade to Android Studio 0.4.0 or later, or clean and rebuild your project if you want to stay on 0.3.2. 升级到Android Studio 0.4.0或更高版本,或者如果要保留在0.3.2。上,请清理并重建项目。 There's a bug in the 0.6 versions of the Gradle plugin ( https://code.google.com/p/android/issues/detail?id=63366 ) that can cause newly-added dependencies to not get linked into your APK unless you clean your project after doing so. Gradle插件0.6版本( https://code.google.com/p/android/issues/detail?id=63366 )中存在一个错误,该错误可能导致新添加的依赖项无法链接到您的APK中,除非您这样做后请清理您的项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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