Google Play Services update

后端 未结 6 801
情深已故
情深已故 2020-11-27 16:09

Yesterday API 19 came out so I upgraded SDK and other (including Google Play Services) now this method:

private boolean isGooglePlayInstalled(){
    int stat         


        
相关标签:
6条回答
  • 2020-11-27 16:25

    That happened to me yesterday. I just needed to add this in the manifest:

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    
    0 讨论(0)
  • 2020-11-27 16:32

    you have to add the following line in manifest file.
    i hope it will work.

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    
    0 讨论(0)
  • 2020-11-27 16:44

    Package contents comparison

    The "google_play_services_froyo" lib project contains these com.google.android.gms packages:

    • appstate
    • auth
    • common
    • dynamic
    • games
    • gcm
    • internal
    • location
    • maps
    • panorama
    • plus

    On the other hand, the new (rev. 13) "google_play_services" lib project has some additional packages within com.google.android.gms:

    • ads
    • appstate
    • auth
    • common
    • dynamic
    • games
    • gcm
    • internal
    • location
    • maps
    • panorama
    • plus
    • wallet

    Plus, this package is found in the new (rev. 13) "google_play_services": com.google.ads!

    AndroidManifext.xml comparison

    The old (rev. 12) "google_play_services" had:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.google.android.gms"
        android:versionCode="3265130"
        android:versionName="3.2.65 (834000-30)" >
    
        <uses-sdk android:minSdkVersion="8"/>
    
    </manifest> 
    

    The newly introduced "google_play_services_froyo" lib project has:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.google.android.gms"
        android:versionCode="3225130"
        android:versionName="3.2.25 (761454-30)" >
    
        <uses-sdk android:minSdkVersion="8"/>
    
    </manifest>
    

    Conclusion

    The "google_play_services_froyo" is functionally the same as the old (rev. 12) "google_play_services" lib project, so if you just want to keep your app compatible and don't care about the new APIs, just import the "google_play_services_froyo" in your project and you're good to go.

    On the other hand, if you wanted to use the new (rev. 13) "google_play_services" lib project, once you import it, you have to add this to your apps manifest:

    <application
    ...
      <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    </application>
    

    Hope this helped :)

    0 讨论(0)
  • 2020-11-27 16:45

    I faced this error because I referenced the original copy from SDK directory. Make sure that you first copy the library to android workspace and only reference it. In eclipse you can do it by checking "Copy projects into workspace" while importing the project.

    0 讨论(0)
  • 2020-11-27 16:46

    I solved my issue of the same with

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    
    0 讨论(0)
  • This worked for me:

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    

    Place this at the end of your manifest, after your Map API key meta-data tag. Since you check for GPlayServices availability in your onCreate method, such as:

    // Check status of Google Play Services
    int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
    
    // Check Google Play Service Available
    try {
        if (status != ConnectionResult.SUCCESS) {
            GooglePlayServicesUtil.getErrorDialog(status, this, RQS_GooglePlayServices).show();
        }
    } catch (Exception e) {
        Log.e("Error: GooglePlayServiceUtil: ", "" + e);
    }
    

    ...then once you click the dialog box to update GPlayServices, you will be brought to the GPlayStore. Usually, I uninstall from the GPlayStore menu, then the option to update will be available. It should work after that.

    0 讨论(0)
提交回复
热议问题