Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Exception with google play services (Google Places API Android) with 10.2.0

I am using google play services of google places api. When I updated google play services 10.0.1 to 10.2.0 in build.gradle file then I got below exception at line :-

mGoogleApiClient = new GoogleApiClient.Builder(getActivity())
            .enableAutoManage(getActivity(), this)
            .addApi(Places.GEO_DATA_API)
            .build();

And with version 10.0.1 it is also not working.

Exception :-

java.lang.NoSuchFieldError: No static field GOOGLE_PLAY_SERVICES_VERSION_CODE of type I in class Lcom/google/android/gms/common/zzc; or its superclasses (declaration of 'com.google.android.gms.common.zzc' appears in /data/app/com.xyz.app-1/base.apk)
    at com.google.android.gms.common.GoogleApiAvailability.<clinit>(Unknown Source)
    at com.google.android.gms.common.api.GoogleApiClient$Builder.<init>(Unknown Source)
    at com.techmobia.fourmoles.ui.bookteetime.BookTimeFragment.onCreate(BookTeeTimeFragment.java:102)
    at android.support.v4.app.Fragment.performCreate(Fragment.java:2177)
    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1244)
    at android.support.v4.app.FragmentTransition.addToFirstInLastOut(FragmentTransition.java:1080)
    at android.support.v4.app.FragmentTransition.calculateFragments(FragmentTransition.java:971)
    at android.support.v4.app.FragmentTransition.startTransitions(FragmentTransition.java:95)
    at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2143)
    at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2098)
    at android.support.v4.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:1979)
    at android.support.v4.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:626)
    at android.support.v4.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:166)
    at android.support.v4.view.ViewPager.populate(ViewPager.java:1268)
    at android.support.v4.view.ViewPager.populate(ViewPager.java:1116)
    at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1642)
    at android.view.View.measure(View.java:18809)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5954)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
    at android.view.View.measure(View.java:18809)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5954)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at android.view.View.measure(View.java:18809)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5954)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
    at android.view.View.measure(View.java:18809)
    at android.support.v4.widget.DrawerLayout.onMeasure(DrawerLayout.java:1081)
    at android.view.View.measure(View.java:18809)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5954)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139)
    at android.view.View.measure(View.java:18809)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5954)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
    at android.view.View.measure(View.java:18809)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5954)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at android.view.View.measure(View.java:18809)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5954)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
    at android.view.View.measure(View.java:18809)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5954)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at com.android.internal.policy.PhoneWindow$DecorView.onMe
like image 847
Bhuvnesh Avatar asked Oct 18 '22 16:10

Bhuvnesh


1 Answers

I resolved issue after clean and build project.

like image 72
Bhuvnesh Avatar answered Oct 21 '22 08:10

Bhuvnesh