Apk Expansion Files - Application Licensing - Developer account - NOT_LICENSED response

Posted by mUncescu on Stack Overflow See other posts from Stack Overflow or by mUncescu
Published on 2012-08-13T07:51:38Z Indexed on 2013/10/29 15:54 UTC
Read the original article Hit count: 905

Filed under:
|

I am trying to use the APK Expansion Files extension for Android. I have uploaded the APK to the server along with the extension files. If the application was previously published i get a response from the server saying NOT_LICENSED: The code I use is:

APKExpansionPolicy aep = new APKExpansionPolicy(mContext,
                new AESObfuscator(getSALT(), mContext.getPackageName(), deviceId));
aep.resetPolicy();
LicenseChecker checker = new LicenseChecker(mContext, aep,
                getPublicKey();
checker.checkAccess(new LicenseCheckerCallback() {   
            @Override
            public void allow(int reason) { 
            @Override
            public void dontAllow(int reason) {
                try
                {
                    switch (reason) {
                        case Policy.NOT_LICENSED:
mNotification.onDownloadStateChanged(IDownloaderClient.STATE_FAILED_UNLICENSED);
                            break;
                        case Policy.RETRY:
mNotification.onDownloadStateChanged(IDownloaderClient.STATE_FAILED_FETCHING_URL);
                            break;
                    }
                } finally {
                    setServiceRunning(false);
                }
            }
            @Override
            public void applicationError(int errorCode) {
                try {
mNotification.onDownloadStateChanged(IDownloaderClient.STATE_FAILED_FETCHING_URL);
                } finally {
                    setServiceRunning(false);
                }
            }
        });

So if the application wasn't previously published the Allow method is called. If the application was previously published and now it isn't the dontAllow method is called.

I have tried:

  1. http://developer.android.com/guide/google/play/licensing/setting-up.html#test-response Here it says that if you use a developer or test account on your test device you can set a specific response, I use LICENSED as response and still get NOT_LINCESED.
  2. Resetting the phone, clearing google play store cache, application data.
  3. Changing the versioncode number in different combinations still doesn't work.

Edit: In case someone else was facing this problem I received an mail from the google support team

We are aware that newly created accounts for testing in-app billing and Google licensing server (LVL) return errors, and are working on resolving this problem. Please stay tuned. In the meantime, you can use any accounts created prior to August 1st, 2012, for testing. So it seems to be a problem with their server, if I use the main developer thread everything works fine.

© Stack Overflow or respective owner

Related posts about java

Related posts about android