简体   繁体   中英

Android Studio. NoClassDefFound Error for GooglePlayServiceUtil

Newbie to android and android studio.. Trying to use Google Play Services for implementing GCM. Was following how to set up play-services

and Demo GCM Client

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. But all of them are "ecclipse" related. How solve this in 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. 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.

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