Created
May 8, 2016 18:06
-
-
Save arturaz/d2bd3f1af8cb6861717d3d1f7bd0289e to your computer and use it in GitHub Desktop.
Error while trying to update IAPs on google play
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def update | |
(pkgName: PkgName, diff: IAPDiffResult) | |
(implicit log: Logger, service: AndroidPublisher) = | |
{ | |
val iaps = service.inappproducts() | |
def doUpdates() = { | |
log.logln(s"Updating IAPs (${diff.changes.size})") | |
diff.changes.foreach { diff => | |
val iap = diff.local | |
try { | |
iaps | |
.patch(pkgName.s, iap.sku.s, iap.toGoogle(pkgName)) | |
.setAutoConvertMissingPrices(true) | |
.tap(_.logDebugString) | |
.execute() | |
} | |
catch { | |
case t: Throwable => throw new Exception(s"While inserting $iap", t) | |
} | |
} | |
log.logln(s"Updating IAPs done") | |
} | |
def doInserts() = { | |
log.logln(s"Inserting new IAPs (${diff.inserts.size})") | |
diff.inserts.foreach { iap => | |
try { | |
iaps.insert(pkgName.s, iap.toGoogle(pkgName)). | |
setAutoConvertMissingPrices(true).execute() | |
} | |
catch { | |
case t: Throwable => throw new Exception(s"While inserting $iap", t) | |
} | |
} | |
log.logln(s"Inserting new IAPs done.") | |
} | |
doUpdates() | |
doInserts() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fetching IAPs for PkgName(com.tinylabproductions.test) | |
{"defaultLanguage":"en-US","defaultPrice":{"currency":"EUR","priceMicros":"500000"},"listings":{"en-US":{"description":" ","title":"test"}},"packageName":"com.tinylabproductions.test","purchaseType":"managedUser","sku":"test","status":"active"} | |
Fetched IAPs for PkgName(com.tinylabproductions.test) | |
Updating IAPs (1) | |
PATCH https://www.googleapis.com/androidpublisher/v2/applications/com.tinylabproductions.test/inappproducts/test?autoConvertMissingPrices=true | |
Headers: | |
accept-encoding -> [gzip] | |
user-agent -> [TinyLabProductions-GooglePlayUploader/1.0 Google-API-Java-Client] | |
Content: | |
{"defaultLanguage":"en-US","defaultPrice":{"currency":"EUR","priceMicros":"1000000"},"listings":{"en-US":{"description":" ","title":"test"}},"packageName":"com.tinylabproductions.test","sku":"test"} | |
Exception in thread "main" java.lang.Exception: While inserting IAP(SKU(test),€ 1.0,IAPListing(Title(test),Description( ))) | |
at com.tinylabproductions.google_play_uploader.actions.IAPs$$anonfun$doUpdates$1$1.apply(IAPs.scala:61) | |
at com.tinylabproductions.google_play_uploader.actions.IAPs$$anonfun$doUpdates$1$1.apply(IAPs.scala:59) | |
at scala.collection.Iterator$class.foreach(Iterator.scala:893) | |
at scala.collection.AbstractIterator.foreach(Iterator.scala:1336) | |
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72) | |
at scala.collection.AbstractIterable.foreach(Iterable.scala:54) | |
at com.tinylabproductions.google_play_uploader.actions.IAPs$.doUpdates$1(IAPs.scala:59) | |
at com.tinylabproductions.google_play_uploader.actions.IAPs$.update(IAPs.scala:89) | |
at com.tinylabproductions.google_play_uploader.actions.IAPs$.update2(IAPs.scala:116) | |
at com.tinylabproductions.google_play_uploader.Main$.main(Main.scala:76) | |
at com.tinylabproductions.google_play_uploader.Main.main(Main.scala) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
at java.lang.reflect.Method.invoke(Method.java:483) | |
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144) | |
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 500 Internal Server Error | |
{ | |
"code" : 500, | |
"errors" : [ { | |
"domain" : "global", | |
"message" : "Internal Error", | |
"reason" : "internalError" | |
} ], | |
"message" : "Internal Error" | |
} | |
at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:145) | |
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113) | |
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40) | |
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321) | |
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1056) | |
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419) | |
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352) | |
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469) | |
at com.tinylabproductions.google_play_uploader.actions.IAPs$$anonfun$doUpdates$1$1.apply(IAPs.scala:66) | |
... 15 more | |
Process finished with exit code 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment