Skip to content Skip to sidebar Skip to footer

Licensechecker Checkaccess Leaks Serviceconnection

I am receiving this exception in LogCat every time I press the Back button in my app: Activity has leaked ServiceConnection com.android.vending.licensing.LicenseChecker@471cc039

Solution 1:

I just got the same problem, and with your update and zapl's comment I figured up that the problem is the emulator you are using.

This Emulators don't have the Google Play APIs, and the LVL can't bind to the service, leaving a connection open, at the end LVL can't close it with the onDestroy call.

Just create a new AVD using Google APIs instead of Android x.x and try your code there, if you don´t find the Google APIs in the Target pulldown when creating the new AVD download it with the Android SDK Manager.

Solution 2:

I have also met the same problem later I got to know that i havn't added that android permission com.android.vending.CHECK_LICENSE . After correcting this my was problem is now solved. Try adding this line your android manifest

<uses-permissionandroid:name="com.android.vending.CHECK_LICENSE" />

Solution 3:

Just put

mChecker.onDestroy();

on your onDestroymethod of the activity that declares and uses the mChecker.

While Google's code in LicenceChecker looks like this:

  public synchronized void onDestroy() {
        cleanupService();
        mHandler.getLooper().quit();
    }

Solution 4:

I don't know about google's LicenceChecker, but you should call StopService() before exit the Activity otherwise the service is still running and leaks memory.

Post a Comment for "Licensechecker Checkaccess Leaks Serviceconnection"