Giter Club home page Giter Club logo

android-play-publisher-api's People

Contributors

dingram avatar josealcerreca avatar kosev avatar mahee96 avatar mg6maciej avatar nilllisterri avatar nlativy avatar robisaks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-play-publisher-api's Issues

"Remote end closed connection without response" exception occurs when upload aab by resumable method

    @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))

Cannot upload the same APK version for two different archs

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

Track names in request path and request body must match.

From the last 24 hours I've been getting this error. The code was working fine before:

Mar 13, 2020 10:48:54 AM BasicUploadApk main

  | 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;
        }
    }

AttributeError: 'module' object has no attribute 'SignedJwtAssertionCredentials'

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'

GoogleJsonResponseException : 404 Not found for all the sample calls

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)

com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden

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."
}

Is there any info available about how to upload images for different screensizes?

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?

basic_upload_apks.py always returns googleapiclient.errors.UnknownFileType

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.

alpha/beta track

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

"Error generating the Rosy backend request"

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"
} ],
}

Can't upload deobfuscation files

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?

Release Note

Anything we can do for adding release note in this.

Google Play Developer API: “startTimeMillis” is updated when it should not

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

The purchase token was not found.

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)

How can I get sales country with this API?

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

Exception with android gradle tools 1.1.2

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                      

Got 403 updating old alpha apk to new beta apk

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.

404 error: No application was found for the given package

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.

Trying to use edits.images

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."
}

UnacceptableMimeTypeError for expansion files

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

Type of errors that can be encoutered

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.

Can't seem to have newlines in recentChanges

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"

python samples placement of secret files

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?

InAppProducts Update returns 500 Internal Server Error

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?

the java sample BasicUploaderApk not working when is run from GUI.

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

Api bug feedback!!!

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")....

httplib.ResponseNotReady

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:

log.

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

Additional Sample Request

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.
^_^

Gradle

What about publishing with gradle command?

Needs Java EE SDK instead of normal SDK

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?

it showing error in list apk page

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'

Release notes are not listed in app release

Hi, i am using 'google-api-services-androidpublisher' library in version 'v3-rev13-1.23.0'.
I found the problem with submiting of release notes.

I use this code for submit of release notes.
image

It generates this request.
image

Commit of this edit is successful.
Problem is that release notes are not present in Google Play.
image

The credentials have been revoked or expired, please re-run the application to re-authorize

Hi,

Yesterday my code works perfectly, and today (without change anything) I get the following error:

  • The credentials have been revoked or expired, please re-run the application to re-authorize

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)

ApkBinary.getSha1() returns different sha1 hash

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?

Create InAppProducts returns 500 error

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()

Java - GoogleJsonResponseException: 401 Unauthorized

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.