Getting exception

40 views
Skip to first unread message

yingwen

unread,
Jun 22, 2010, 5:02:14 PM6/22/10
to Automatic Application Licensing
Hi Dave, thanks for the AAL. It is a great idea.

I was just started to try it but got this exception. My phone has
internet access. It is a dev phone though. Any idea?

06-22 13:58:09.279: ERROR/LicenseManagerImpl(4607): Error Validating
Purchase
com.keyes.license.LicenseException:
com.keyes.license.LicenseException: 400 - HTTP Response: Bad Request
at
com.keyes.license.LicenseManagerImpl.executeRawHttpQuery(LicenseManagerImpl.java:
202)
at
com.keyes.license.LicenseManagerImpl.validatePurchaseAgainstAppStore(LicenseManagerImpl.java:
279)
at com.keyes.license.LicenseManagerImpl.access
$1000(LicenseManagerImpl.java:77)
at com.keyes.license.LicenseManagerImpl
$ValidateWithMarketAsyncTask.doInBackground(LicenseManagerImpl.java:
813)
at com.keyes.license.LicenseManagerImpl
$ValidateWithMarketAsyncTask.doInBackground(LicenseManagerImpl.java:
759)
at android.os.AsyncTask$2.call(AsyncTask.java:185)
at java.util.concurrent.FutureTask
$Sync.innerRun(FutureTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1068)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:561)
at java.lang.Thread.run(Thread.java:1096)
Caused by: com.keyes.license.LicenseException: 400 - HTTP
Response: Bad Request
at
com.keyes.license.LicenseManagerImpl.executeRawHttpQuery(LicenseManagerImpl.java:
176)
... 10 more

The code is

LicenseManager lLicMgr = new LicenseManager();
lLicMgr.setValidationPolicy(2 /* max failures */,
LicenseManager.FAILURE_BEHAVIOR_INVITE |
LicenseManager.FAILURE_BEHAVIOR_NAG,
15000 /* time to display nag */);
lLicMgr.checkLicense(this /* reference to your activity */,
true, new CheckLicenseCallback() {...} /* a simple callback*/ );

David Keyes

unread,
Jun 22, 2010, 5:07:08 PM6/22/10
to automatic-appli...@googlegroups.com
This could likely be the result of you having a dev phone.  If the app is "copy protected", dev phones can't download.  The general rule of thumb is that if the phone that you are testing AAL on can "see" and purchase the app in the market using the Android market app on your phone, then AAL should work. 

Dave

yingwen

unread,
Jun 22, 2010, 5:19:25 PM6/22/10
to Automatic Application Licensing
Thanks for the quick response. I am actually running the AAL from my
own app. The app is not copy-protected on the market even it is a paid
app so my dev phone can see my app on the market. However I don't
think it should matter because I didn't purchase my own app but
installed it from the USB connection. So I can only explain it as my
dev phone is not authorized to access https://android.clients.google.com/market/api/ApiRequest.
Not quite sure though.

-yingwen

Eddie

unread,
Jul 16, 2010, 4:26:29 AM7/16/10
to Automatic Application Licensing
I'm also getting this same exception.

Yingwen -- did you resolve this issue?

Any ideas on why this is happening?

Thanks,

Eddie

On Jun 22, 2:19 pm, yingwen <yingwent...@gmail.com> wrote:
> Thanks for the quick response. I am actually running the AAL from my
> own app. The app is not copy-protected on the market even it is a paid
> app so my dev phone can see my app on the market. However I don't
> think it should matter because I didn't purchase my own app but
> installed it from the USB connection. So I can only explain it as my
> dev phone is not authorized to accesshttps://android.clients.google.com/market/api/ApiRequest.

Cyku Media

unread,
Jul 16, 2010, 4:06:56 PM7/16/10
to Automatic Application Licensing

I getting a similar issue, with 400 - HTTP Response: Bad Response.
This only happens when the app has not been purchased, if it has been
purchased everything runs porperly.

logcat:

I/ActivityManager( 1106): Displayed activity
net.andirc.erismarketfixpaid/.ErisMarketFix: 1716 ms (total 144337 ms)
D/dalvikvm( 1605): GC_FOR_MALLOC freed 4017 objects / 302464 bytes in
57ms
E/x ( 1605): Error Validating Purchase
E/x ( 1605): com.keyes.license.LicenseException:
com.keyes.license.LicenseException: 400 - HTTP Response: Bad Request
E/x ( 1605): at x.a(Unknown Source)
E/x ( 1605): at x.b(Unknown Source)
E/x ( 1605): at x.a(Unknown Source)
E/x ( 1605): at h.a(Unknown Source)
E/x ( 1605): at h.doInBackground(Unknown Source)
E/x ( 1605): at android.os.AsyncTask$2.call(AsyncTask.java:185)
E/x ( 1605): at java.util.concurrent.FutureTask
$Sync.innerRun(FutureTask.java:305)
E/x ( 1605): at
java.util.concurrent.FutureTask.run(FutureTask.java:137)
E/x ( 1605): at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1068)
E/x ( 1605): at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:561)
E/x ( 1605): at java.lang.Thread.run(Thread.java:1096)
E/x ( 1605): Caused by: com.keyes.license.LicenseException: 400
- HTTP Response: Bad Request
E/x ( 1605): ... 11 more


# cat com.keyes.license.prefs.xml <-- from Device generating Error
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<boolean name="com.keyes.license.welcome" value="true" />
</map>


and this is from a device that was able to do the purchase:
# cat com.keyes.license.prefs.xml
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<string name="com.keyes.license">B6A4E44DD1D60BC4C5AC9IA8DD477578</
string>
<long name="com.keyes.license.timeout" value="1279309304037" />
<int name="com.keyes.license.failureCount" value="0" />
<long name="com.keyes.license.lastLicenseCheckTime"
value="1279309303963" />
<boolean name="com.keyes.license.welcome" value="true" />
</map>


Reply all
Reply to author
Forward
0 new messages