Google services added Force close application with log cat error

后端 未结 7 1718
無奈伤痛
無奈伤痛 2021-01-06 12:23

I have been developing a simple app for load a map view. I have followed the API. https://developers.google.com/maps/documentation/android/start#add_a_map

BUT

7条回答
  •  长情又很酷
    2021-01-06 12:32

    I added this below xml code in "AndroidManifest.xml"

    
    ...
    
    

    The crash error was disappeared. But when I call...

    int iErrorCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
    

    "iErrorCode" is 2. 2 means like this

    public static final int SERVICE_VERSION_UPDATE_REQUIRED The installed version of Google Play services is out of date. The calling activity should pass this error code to getErrorDialog(int, Activity, int) to get a localized error dialog that will resolve the error when shown. Constant Value: 2 (0x00000002) Details...

    And also LogCat said...

    W/GooglePlayServicesUtil(4728): Google Play services out of date. Requires 4030500 but found 3266136

    Where is version code "4030500"??

    [SDK]\extras\google\google_play_services\libproject\google-play-services_lib\res\values

    You can see "version.xml". Open it!

     
        4030500
    
    

    Peekaboo~~! :) This is why we got this errorCode(2) when update new SDK and use new "google-play-services-lib".

    Okay! Got it! Let's check my Google Play Version on my device.

    enter image description here

    The version on my phone is "4.4.21" There is no problem I think. What is this "3266136"? Where were this from? I cannot understand this.

    If I figure this out, I will update this long answer.

    Good luck! Everybody! :)

    Updated 1: I downloaded apk 4.4.22 and installed on my phone. But, LogCat still show me "3266136". This is really odd thing. I think Google-Team have to fix it ASAP!!

    4.4.22 Download here...

    Updated 2: After all, I decided to down-grade "google-play-services_lib" and "android-support-v4.jar" to previous version. I will be wait for them. :)

提交回复
热议问题