NoClassDefFoundError after AndroidStudio upgrade t

2019-02-19 01:08发布

with previous versions of Android Studio working properly with Release Candidate 4 (December 4th) or newer:

FATAL EXCEPTION: main

 java.lang.NoClassDefFoundError: com.google.android.gms.location.LocationClient

it seems to me that it is related to update 'com.android.tools.build:gradle:1.0.0 '

This looks similar: https://github.com/robolectric/robolectric/issues/1136

Edit

working : compile 'com.google.android.gms:play-services:6.1.+'

2条回答
【Aperson】
2楼-- · 2019-02-19 01:57

Try with this :

dependencies 
{
    classpath 'com.android.tools.build:gradle:1.0.0+'
    classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.9.+'
}

And also do

    buildTypes 
   {
        release 
       {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-    rules.txt'
        }
    }
查看更多
做自己的国王
3楼-- · 2019-02-19 02:03

This has nothing to do with gradle. It's an update for Google Play Services. The LocationClient class has been replaced with the new FusedLocationProviderApi.

Check this answer: Android play services 6.5: LocationClient is missing

查看更多
登录 后发表回答