googlesamples / android-play-publisher-api Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Is there any plans to update this code ?
Most of it won't run due to changes in oath2client
@retry(stop_max_attempt_number=3, wait_random_min=10000, wait_random_max=30000)
def upload_app(self, edit_id, package_name, app_type, app_size, package_path):
self.log.info("start to upload app: {}".format(package_path))
if app_type == AppType.android_application.name:
response = self.service.edits().apks().upload(editId=edit_id,
packageName=package_name,
media_body=package_path).execute()
elif app_type == AppType.android_bundle.name:
if app_size >= 100:
installation_warning = True
else:
installation_warning = False
chunk_size = math.ceil(app_size * 1024 * 1024 * 1.02 / 10)
aab_media_body = MediaFileUpload(package_path, mimetype="application/octet-stream",
chunksize=chunk_size, resumable=True)
request = self.service.edits().bundles().upload(editId=edit_id,
packageName=package_name,
ackBundleInstallationWarning=installation_warning,
media_body=aab_media_body)
response = None
try:
while response is None:
status, response = request.next_chunk(num_retries=3)
self.log.info("resumable_uri: %s" % request.resumable_uri)
if status:
self.log.info("uploaded %d%%. [%s / %s]" % (int(status.progress() * 100),
status.resumable_progress, status.total_size))
except HttpError as e:
if e.resp.status in [404]:
raise RetryError(e)
elif e.resp.status in [500, 502, 503, 504]:
request.next_chunk(num_retries=5)
else:
self.log.error(e.error_details)
except Exception:
self.log.error(common.format_exc_plus())
else:
response = {'versionCode': None}
self.log.info("upload app result: {}".format(response))
return response```
I've already tried to set timeout as 600s, still failed.
http_auth = credentials.authorize(httplib2.Http(timeout=600))
I have foo-35.0a2.multi.android-i386.apk and foo-35.0a2.multi.android-arm.apk
edit_request = service.edits().insert(body={}, packageName=package_name)
result = edit_request.execute()
edit_id = result['id']
for apk_file in apk_files:
try:
apk_response = service.edits().apks().upload(
editId=edit_id,
packageName=package_name,
media_body=apk_file).execute()
track_response = service.edits().tracks().update(
editId=edit_id,
track=TRACK,
packageName=package_name,
body={u'versionCodes': [apk_response['versionCode']]}).execute()
listing_response = service.edits().apklistings().update(
editId=edit_id, packageName=package_name, language='en-US',
apkVersionCode=apk_response['versionCode'],
body={'recentChanges': 'Apk recent changes in en-US'}).execute()
except client.AccessTokenRefreshError:
print ('The credentials have been revoked or expired, please re-run the '
'application to re-authorize')
commit_request = service.edits().commit(
editId=edit_id, packageName=package_name).execute()
print 'Edit "%s" has been committed' % (commit_request['id'])
Only the last file shows on the website.
The page https://developers.google.com/android-publisher/edits/workflow suggests that it is possible
Am I missing any parameter while execution ?
Error Logs
{
"code" : 400,
"errors" : [ {
"domain" : "androidpublisher",
"message" : "Only releases with status draft may be created on draft app.",
"reason" : "rolloutNotPermittedOnDraftApp"
} ],
"message" : "Only releases with status draft may be created on draft app."
}
From the last 24 hours I've been getting this error. The code was working fine before:
| INFO: Created edit with id: 11886469901726234722
| Mar 13, 2020 10:49:09 AM BasicUploadApk main
| INFO: Version code 11180 has been uploaded
| Mar 13, 2020 10:49:09 AM BasicUploadApk main
| INFO: Version code 12180 has been uploaded
| Mar 13, 2020 10:49:10 AM BasicUploadApk main
| SEVERE: BasicUploadApk: Exception was thrown while uploading apk to internal track (for apkFilePath=../wallet/build/app/outputs/apk/qa/release/app-qa-armeabi-v7a-release.apk)
| com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
| {
| "code" : 400,
| "errors" : [ {
| "domain" : "global",
| "message" : "Track names in request path and request body must match.",
| "reason" : "badRequest"
| } ],
| "message" : "Track names in request path and request body must match.",
| "status" : "INVALID_ARGUMENT"
| }
| at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:150)
| 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:1092)
| 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 BasicUploadApk.main(BasicUploadApk.java:100)
|
| Exception in thread "main" com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
| {
| "code" : 400,
| "errors" : [ {
| "domain" : "global",
| "message" : "Track names in request path and request body must match.",
| "reason" : "badRequest"
| } ],
| "message" : "Track names in request path and request body must match.",
| "status" : "INVALID_ARGUMENT"
| }
| at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:150)
| 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:1092)
| 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 BasicUploadApk.main(BasicUploadApk.java:100)
Here is my main method:
public static void main(String[] args) throws IOException, GeneralSecurityException {
String applicationName = args[0];
String packageName = args[1];
String serviceAccountEmail = args[2];
String apkFilePath32 = args[3];
String apkFilePath64 = args[4];
try {
Preconditions.checkArgument(!Strings.isNullOrEmpty(packageName),
"ApplicationConfig.PACKAGE_NAME cannot be null or empty!");
// Create the API service.
AndroidPublisher service = AndroidPublisherHelper.init(
applicationName, serviceAccountEmail);
final Edits edits = service.edits();
// Create a new edit to make changes to your listing.
Insert editRequest = edits
.insert(packageName,
null /** no content */);
AppEdit edit = editRequest.execute();
final String editId = edit.getId();
log.info(String.format("Created edit with id: %s", editId));
// Upload new apk to developer console
final AbstractInputStreamContent apkFile32 =
new FileContent(AndroidPublisherHelper.MIME_TYPE_APK, new File(apkFilePath32));
final AbstractInputStreamContent apkFile64 =
new FileContent(AndroidPublisherHelper.MIME_TYPE_APK, new File(apkFilePath64));
Upload uploadRequest32 = edits
.apks()
.upload(packageName,
editId,
apkFile32);
Upload uploadRequest64 = edits
.apks()
.upload(packageName,
editId,
apkFile64);
Apk apk32 = uploadRequest32.execute();
Apk apk64 = uploadRequest64.execute();
log.info(String.format("Version code %d has been uploaded",
apk32.getVersionCode()));
log.info(String.format("Version code %d has been uploaded",
apk64.getVersionCode()));
// Assign apk to alpha track.
List<Long> apkVersionCodes = new ArrayList<>();
apkVersionCodes.add(Long.valueOf(apk32.getVersionCode()));
apkVersionCodes.add(Long.valueOf(apk64.getVersionCode()));
Update updateTrackRequest = edits
.tracks()
.update(packageName,
editId,
TRACK_INTERNAL,
new Track().setReleases(
Collections.singletonList(
new TrackRelease()
.setVersionCodes(apkVersionCodes)
.setStatus("completed")
.setReleaseNotes(Collections.singletonList(
new LocalizedText()
.setLanguage("en-US")
.setText("Automated apk deploy"))))));
Track updatedTrack = updateTrackRequest.execute();
log.info(String.format("Track %s has been updated.", updatedTrack.getTrack()));
// Commit changes for edit.
Commit commitRequest = edits.commit(packageName, editId);
AppEdit appEdit = commitRequest.execute();
log.info(String.format("App edit with id %s has been committed", appEdit.getId()));
} catch (IOException | GeneralSecurityException ex) {
log.error("BasicUploadApk: Exception was thrown while uploading apk to internal track (for apkFilePath=" + apkFilePath32 + ")", ex);
throw ex;
}
}
Hi
This example is very good for updating play store listings.
https://github.com/googlesamples/android-play-publisher-api/blob/master/v2/python/update_listings.py
Can you provide a sample code for updating screenshots using python ?
Also, can you point out where I can find API docs for exploring the google play API python calls ?
It used to build fine but recently it started giving following exceptions both for list_apks.py and upload_apk.py at following lines:
...
credentials = client.SignedJwtAssertionCredentials(
SERVICE_ACCOUNT_EMAIL,
key,
scope='https://www.googleapis.com/auth/androidpublisher')
http = httplib2.Http()
http = credentials.authorize(http)
Here is the exceptions:
Determining latest version for my.package.name...
error 25-Feb-2016 06:30:52 Traceback (most recent call last):
error 25-Feb-2016 06:30:52 File "list_apks.py", line 80, in <module>
error 25-Feb-2016 06:30:52 main()
error 25-Feb-2016 06:30:52 File "list_apks.py", line 46, in main
error 25-Feb-2016 06:30:52 credentials = client.SignedJwtAssertionCredentials(
error 25-Feb-2016 06:30:52 AttributeError: 'module' object has no attribute 'SignedJwtAssertionCredentials'
build 25-Feb-2016 06:30:52 Found latest APK version:
build 25-Feb-2016 06:30:52 Generated new APK version: 1
25-Feb-2016 06:33:30 Uploading APK...
25-Feb-2016 06:33:30 Traceback (most recent call last):
25-Feb-2016 06:33:30 File "upload_apk.py", line 115, in <module>
25-Feb-2016 06:33:30 main(sys.argv)
25-Feb-2016 06:33:30 File "upload_apk.py", line 62, in main
25-Feb-2016 06:33:30 credentials = client.SignedJwtAssertionCredentials(
25-Feb-2016 06:33:30 AttributeError: 'module' object has no attribute 'SignedJwtAssertionCredentials'
when i upload the apk to library, i cannot publish the apk to alpha track by set versionCode , it response : versionCode=xxx apk cannot be found.
how can i do it?
I keep getting this exception. I have updated the ApplicationConfig with proper package names and apk file.
SEVERE: Exception was thrown while updating listing
com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found
{
"code" : 404,
"errors" : [ {
"domain" : "global",
"location" : "packageName",
"locationType" : "parameter",
"message" : "No application was found for the given package name.",
"reason" : "applicationNotFound"
} ],
"message" : "No application was found for the given package name."
}
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:312)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1049)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
at com.google.play.developerapi.samples.ListApks.main(ListApks.java:55)
I'm trying to run the java sample code,but I got the error.I have updated ApplicationConfig.java.I don't know why.Could anyone give me a hand? Thanks.
{
"code" : 403,
"errors" : [ {
"domain" : "androidpublisher",
"message" : "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console.",
"reason" : "projectNotLinked"
} ],
"message" : "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
}
My main use for this api would be to mass upload screenshots for all locales for phone, 7 inch and 10 inch tablet. I see in the javadoc for AndroidPublisher.Edits.Images.Upload
you can upload images, but the imageType
field is not documented anywhere, and I don't see any other options to specify image size.
So, how can I upload different images for phone, 7 inch and 10 inch tablet?
Example in android-play-publisher-api/v2/python/basic_list_apks_service_account.py
The sample basic_upload_apks.py when run like this:
python basic_upload_apks.py com.company.appname appname.apk
always returns
"googleapiclient.errors.UnknownFileType: appname.apk"
I believe this is because createMethod()
in discovery.py raises an exception if the guessed MIME type is None -- which it seems it always would be.
I've tried using your examples to upload an apk to alpha/beta, but it doesn't work.
The error is : "Version 394032714 of this app can not be downloaded by any devices as they will all receive APKs with higher version codes." (the apk I'm uploading has versioncode 468900709).
From what I understand, if I have an alpha and a beta active, in order to update the beta I don't only need to upload and publish it. I need to:
Upload new draft
Deactivate old beta
Deactivate old alpha
Publish draft
Hello all,
I have been successful in uploading APKs via the publish API, but today for some reason I received an error. I can't figure out what is causing it, any ideas?:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Invalid value for: **** Error generating the Rosy backend request.\nField 'hash_verified' is unknown at 'media'.\nCheck your .api configuration and templates (Hint: If this is a parameter, restrict the parameter values in the .api file.)\n",
"reason" : "invalid"
} ],
}
I'm trying to upload the deobfuscation for an apk. But i always get some errors about the deobfuscationFileType. I can't find proper documentation about what i should enter there as well.
I tried the following:
edits.Deobfuscationfiles().upload(appPackage, customAppEdit.id, apk.versionCode, "proguard").execute()
Which leads in:
{ "code" : 500, "message" : null }
If i provide the mime type (which you define as "Accepted Media MIME types" in your documentation):
edits.Deobfuscationfiles().upload(appPackage, customAppEdit.id, apk.versionCode, "application/octet-stream").execute()
Then it leads in:
{ "code" : 400, "errors" : [ { "domain" : "global", "location" : "deobfuscationFileType", "locationType" : "parameter", "message" : "Invalid string value: 'application/octet-stream'. Allowed values: [proguard]", "reason" : "invalidParameter" } ], "message" : "Invalid string value: 'application/octet-stream'. Allowed values: [proguard]" }
I tried many other combinations as well but nothing works...
How can I use the api to upload the deobfuscation file?
Anything we can do for adding release note in this.
I am developing an application with in-app subscriptions. On our servers, I check the validity of each subscription through the Google Play Developer API.
As stated in the docs, a request to the Purchases.subscriptions endpoint, returns something like that:
{
"kind": "androidpublisher#subscriptionPurchase",
"startTimeMillis": long,
"expiryTimeMillis": long,
"autoRenewing": boolean
}
However, I am finding some strange behavior with it. When a user cancels a subscription through Google Play app, the "startTimeMillis" field is updated to the time of cancellation.
According to the documentation, "startTimeMillis" is "Time at which the subscription was granted", so I expected that this value should not change. Could anybody explain me why it is updated after a cancellation?
I have another important question that I can not test yet... Could someone, who has spent several months working with subscriptions, tell me if this "startTimeMillis" is updated too when the subscription is automatically renewed? I expect too that this should not change but... now, I am not sure about this.
Thank you
P.S: Same issue on StackOverflow
I keep getting this exception.
I make sure the purchaseToken is valid
严重: Exception was thrown while updating listing
com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found
{
"code" : 404,
"errors" : [ {
"domain" : "global",
"location" : "token",
"locationType" : "parameter",
"message" : "The purchase token was not found.",
"reason" : "purchaseTokenNotFound"
} ],
"message" : "The purchase token was not found."
}
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:1)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:312)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1049)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
at com.google.play.developerapi.samples.CheckIabPurchased.main(CheckIabPurchased.java:82)
Hello I am Mr.Choi from south korea.
I'm supposed to get list of sales country to using publish api.
How can I get sales country with this API?
and I tried to get countryTargeting in tracks.
But getCountryTargetings method always returned null.
Why did the method return null, and What does countryTargeting means?
Thanks
For now, service.edits().apks().list
only returns the versionCode
and the sha1
. It should also return the VersionName
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.2'
classpath 'com.google.apis:google-api-services-androidpublisher:v2-rev16-1.19.1'
}
}
Error:(1, 0) Expecting a stack map frame
Exception Details:
Location:
com/android/build/gradle/internal/TaskManager.getExtension()Lcom/android/build/gradle/BaseExtension; @5: aconst_null
Reason:
Error exists in the bytecode
Bytecode:
0x0000000: 2ab4 005e b001 b0
Upload apk with version 11590 to alpha track.
Set TRACK = 'beta'
Run script
+ ./basic_upload_apks.py ru.bla.bla app-release.apk
Version code 11591 has been uploaded
Track beta is set for version code(s) [11591]
Traceback (most recent call last):
File "./basic_upload_apks_release.py", line 84, in <module>
main(sys.argv)
File "./basic_upload_apks_release.py", line 75, in main
editId=edit_id, packageName=package_name).execute()
File "oauth2client/_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "googleapiclient/http.py", line 838, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.com/androidpublisher/v2/applications/ru.bla.bla/edits/11417089745524793338:commit?alt=json returned "Version 11590 of this app can not be downloaded by any devices as they will all receive APKs with higher version codes.">
Go to the developer console, promote old alpha apk 11590 to beta, run script again and got success.
Also manual uploading 11591 to the beta tab without promoting alpha 11590 to beta is also successful.
Hi,
Is there a way to get installations count, downloads count... from package name ?
Thanks
From the code I get 404 error : "message" : "No application was found for the given package name.",
However when I run CLI command "fastlane supply init" (for package name : com.falcolni) I get the artifacts (images + titles + descrption) downloaded.
Add example for uploading aab file to playstore.
I am trying to use Edits.Images, according to the docs, it needs an "editsId". We do we get this id?
For example:
ImagesListResponse imagesListResponse = edits.images().list(ApplicationConfig.PACKAGE_NAME, "test", "en-US", "featureGraphic").execute();
System.out.println("Image info ################");
System.out.println(imagesListResponse.getImages().get(0));
Returns:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found
{
"code" : 404,
"errors" : [ {
"domain" : "androidpublisher",
"message" : "Edit not found for this application.",
"reason" : "editNotFound"
} ],
"message" : "Edit not found for this application."
}
Specifying a zip file as expansion file results in:
File "build/bdist.macosx-10.10-intel/egg/googleapiclient/discovery.py", line 706, in method
googleapiclient.errors.UnacceptableMimeTypeError: application/zip
AS I AM USING THIS SCRIPT FOR UPLOADING MANY APK AT A TIME ,SO IF ANY ERROR occurred IN UPLOADING ANY OF THE APK THE WHOLE PROCESS STOPPED.SO TO AVOID THIS WHAT ARE THE ALL POSSIBLE ERROR THAT I NEED TO HANDEL (IN TRY-EXCEPT) SO THAT IF ANY ERROR OCCURRED IN ANY ONE OF THE APK ,IT WILL NOT STOP THE WHOLE PROCCESS.
why it is taking redirect_uri as "redirect_uri=http://localhost:56567/Callback" i am giving http://www.XXXX.com but stiill it is taking local URL
I sent this payload to https://www.googleapis.com/androidpublisher/v2/applications//edits//apks//listings/en-US
{"language": "en-US", "recentChanges": "Testing the automated upload mechanism\nTesting a second line of release notes\n"}
and it sent back
"language": "en-US"
"recentChanges": "Testing the automated upload mechanismnTesting a second line of release notesn"
I tried various combinations of slashes and literal newlines and nothing seemed to create a newline in the response. The release notes I have edited on the web console come back properly with
"recentChanges": "Line1\nLine2"
When executing python samples from a different directory, e.g.
python ci/basic_list_apks.py com.example.myapp
client_secrets.json
is expected to be in the same directly as python script (i.e. ci/
), but androidpublisher.dat
is expected to be in the working directory.
Is there a way to control this, so androidpublisher.dat
is looked up in the directory, where all other files are?
If it is, I would be happy to see a code sample
While developing in Java with AndroidPublisher I'm trying to update an InAppProduct object.
first of all I get the object using:
AndroidPublisher.Inappproducts.Get get = inappproducts.get(packageName, skuName);
InAppProduct inAppProduct = get.execute();
then i manipulate it according to my logic
and try to update the object using:
AndroidPublisher.Inappproducts.Update update = inappproducts.update(packageName,skuName,inAppProduct);
update.execute();
and I receive the following error message:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 500 Internal Server Error
{
"code" : 500,
"message" : null
}
any ideas why is this happening? and how can I solve it?
Hello
I successfully run the java samples in eclipse environment. However when I tried to run from a basic GUI the BasicUploadApk sample did not worked and seems to be blocking in authentication request.
My question is if the BasicUploadApk sample is working only in console environment and not in GUI environment?
Best Regards,
Aurelian
I use android publisher api to retrieve reviews and got some problems as below I hope you can fix it up:
If I use setTranslationLanguage
method i got the review 's reviewerLanguage : comments[].userComment.reviewerLanguage
field is wrong. but if I do not use that method language field is absolute right. I think this is a bug please fix it!!
AndroidPublisher.Reviews.List builder = reviews.list(packageName).setTranslationLanguage("en_US")....
I've tried uploading the APK file .
But I failed to upload a file .
When I try to oauth2 authentication requests , I guess filtering on outbound firewall policy .
What is the port that you use ?
Error message is as follows:
Traceback (most recent call last):
File "basic_list_apks.py", line 62, in
main(sys.argv)
File "basic_list_apks.py", line 39, in main
scope='https://www.googleapis.com/auth/androidpublisher')
File "C:\Dev\Python27\lib\site-packages\googleapiclient\sample_tools.py", line
89, in init
credentials = tools.run_flow(flow, storage, flags)
File "C:\Dev\Python27\lib\site-packages\oauth2client\util.py", line 132, in po
sitional_wrapper
return wrapped(args, *kwargs)
File "C:\Dev\Python27\lib\site-packages\oauth2client\tools.py", line 220, in r
un_flow
credential = flow.step2_exchange(code, http=http)
File "C:\Dev\Python27\lib\site-packages\oauth2client\util.py", line 132, in po
sitional_wrapper
return wrapped(args, *kwargs)
File "C:\Dev\Python27\lib\site-packages\oauth2client\client.py", line 1838, in
step2_exchange
headers=headers)
File "C:\Dev\Python27\lib\site-packages\httplib2__init.py", line 1593, in r
equest
(response, content) = self.request(conn, authority, uri, request_uri, metho
d, body, headers, redirections, cachekey)
File "C:\Dev\Python27\lib\site-packages\httplib2__init.py", line 1335, in _
request
(response, content) = self.conn_request(conn, request_uri, method, body, he
aders)
File "C:\Dev\Python27\lib\site-packages\httplib2__init.py", line 1291, in _
conn_request
response = conn.getresponse()
File "C:\Dev\Python27\lib\httplib.py", line 1018, in getresponse
raise ResponseNotReady()
httplib.ResponseNotReady
I cannot find any guidance on uploading an expansion file using the api.
Apk uploading is covered very well, but I've yet to find an example on the use of edits.expansionfiles.upload() anywhere on the internet.
I've got a .net solution for uploading expansion files working, but I get an odd generic error back from the server when I execute the upload function. That is not the case for uploading an apk file. So I've got most of it working, but am at a loss for progress without any guidance on how to do the expansion file usage of this api.
Thank you.
^_^
What about publishing with gradle command?
I keep getting errors about javax.servlet.** missing. Seems to be that the normal Java SE SDK doesn't have these, but the EE SDK is needed. Maybe note this somewhere?
Traceback (most recent call last):
File "basic_list_apks.py", line 62, in
main(sys.argv)
File "basic_list_apks.py", line 53, in main
for apk in apks_result['apks']:
KeyError: 'apks'
It would be nice to upgrade the examples to work with both Python2 and Python3. The docs says it works with both versions of python, but the examples do not.
Hi,
Yesterday my code works perfectly, and today (without change anything) I get the following error:
I used Service Account JSON file (generated via Google Console). This code is server side, so I can't used the Web Browser Auth system.
My code below:
SCOPES = ['https://www.googleapis.com/auth/androidpublisher'] credentials = service_account.Credentials.from_service_account_file(self.ACCOUNT_CONFIG_JSON, scopes=SCOPES) self.service = googleapiclient.discovery.build('androidpublisher', 'v3', credentials=credentials)
I have uploaded an app to my play account with google app signing. https://support.google.com/googleplay/android-developer/answer/7384423?hl=en
I want to read out the sha1 key of the keystore, which is created by google itself. I am using the following sample: https://github.com/googlesamples/android-play-publisher-api/blob/master/v2/java/src/com/google/play/developerapi/samples/ListApks.java
The sha1 key that I get is different than my upload key and signing key. What sha1 hash is that, which is returned by AndroidPublisher?
Refereed the upload apk java and python files for uploading the internal test track apks. But In comment, there's no mention related to internal test track release.
Is this possible to release internal test track API?
Hi
I've tried to create an InApp product, but publisher-api return only:
{ "code" : 500, "message" : null }
Here is my code:
val token = new TokenResponse()
token.setAccessToken("<put_valid_token>")
token.setExpiresInSeconds(3600L)
val creds = new Credential(BearerToken.queryParameterAccessMethod()).setFromTokenResponse(token)
val service = new AndroidPublisher.Builder(
GoogleNetHttpTransport.newTrustedTransport(), JacksonFactory.getDefaultInstance, creds).setApplicationName("test")
.build()
val listing = new InAppProductListing()
listing.setTitle("Title")
listing.setDescription("Desc")
val price = new Price
price.setCurrency("USD")
price.setPriceMicros("199000000")
val contentInApp = new InAppProduct()
contentInApp.setDefaultLanguage("en-US")
contentInApp.setStatus("active")
contentInApp.setListings(Map(
"en-US" -> listing
).asJava)
contentInApp.setPurchaseType("managedUser")
contentInApp.setSku("b2b876c34f3145a6a7d41a0a76969929")
contentInApp.setDefaultPrice(price)
val result2 = service.inappproducts().insert("net.playq.dmitry.inapptest", contentInApp).execute()
Hi,
I am getting 401 Unauthorized exception while trying to run the java sample code with Service account.
Below is the error stack:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 401 Unauthorized
at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146)
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:1065)
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.google.play.developerapi.samples.ListApks.main(ListApks.java:55)
The service account was created and has been marked as the owner of the application.
Appreciate any kind of help here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.