Java.lang.NoClassDefFoundError: Unsuccessful permission: Lcom / google / android / gms / common / GooglePlayServicesUtil

I am trying to run a Google cloud messaging sample that follows a tutorial from the official site https://developer.android.com/google/gcm/client.html . However, the sample suddenly falls and generates an error as follows:

Error Generated by Logcat

After tracing, I found an error in this code block:

     /**
     * Check the device to make sure it has the Google Play Services APK. If
     * it doesn't, display a dialog that allows users to download the APK from
     * the Google Play Store or enable it in the device system settings.
     */
    private boolean checkPlayServices() {
        int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
        if (resultCode != ConnectionResult.SUCCESS) {
            if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
                GooglePlayServicesUtil.getErrorDialog(resultCode, this,
                        PLAY_SERVICES_RESOLUTION_REQUEST).show();
            } else {
                Log.i(TAG, "This device is not supported.");
                finish();
            }
            return false;
        }
        return true;
    }

I also followed the google play service setup guide https://developer.android.com/google/play-services/setup.html and I did the following:

  • Copy google-play-services_lib into the Eclipse workspace.
  • Link to "google-play-services_lib" in the sample project.

Referencing "google-play-services_lib"

, . !!!: (

P.S: , LG G3 Galaxy S4.

+4
3

, , . .

enter image description here

  1. "google-play-services.jar" "google-play-services_lib/libs" ( 2, , ) , :

enter image description here

enter image description here

  1. , "google-play-services.jar" " " Java:

enter image description here

, , , Google, : D

+1

, Google Play Services, , .

, minSDK TargetSDK API.

:

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

To check Google Play Services, you will need to work on a physical device with Google Play services installed.

-1
source

Source: https://habr.com/ru/post/1589248/


All Articles