API Google Play для разработчиков (Обновление списка магазинов) - PullRequest
0 голосов
/ 12 ноября 2018

эй, я разрабатываю приложение, которое обновляет список моих приложений в магазине Google Play консоли

я получаю ошибку в этой строке

  Insert editRequest = edits.insert(ApplicationConfig.PACKAGE_NAME, null /** no content */);
        AppEdit edit = editRequest.execute();

это ошибка

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Splitter.splitToList(Ljava/lang/CharSequence;)Ljava/util/List;
at com.google.api.client.http.UriTemplate.expand(UriTemplate.java:305)
at com.google.api.client.http.UriTemplate.expand(UriTemplate.java:262)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequestUrl(AbstractGoogleClientRequest.java:266)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest(AbstractGoogleClientRequest.java:301)
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.UpdateListing.main(UpdateListing.java:64)

это мой код

 public static void main(String[] args) {
    try {
        Preconditions.checkArgument(!Strings.isNullOrEmpty(ApplicationConfig.PACKAGE_NAME),
                "ApplicationConfig.PACKAGE_NAME cannot be null or empty!");

        // Create the API service.
        AndroidPublisher service = AndroidPublisherHelper.init(
                ApplicationConfig.APPLICATION_NAME, ApplicationConfig.SERVICE_ACCOUNT_EMAIL);
        final Edits edits = service.edits();

        // Create an edit to update listing for application.
        Insert editRequest = edits.insert(ApplicationConfig.PACKAGE_NAME, null /** no content */);
        AppEdit edit = editRequest.execute();
        final String editId = edit.getId();
        log.info(String.format("Created edit with id: %s", editId));

        // Update listing for US version of the application.
        final Listing newHRListing = new Listing();
        newHRListing.setTitle(US_LISTING_TITLE)
                .setFullDescription(US_LISTING_FULL_DESCRIPTION)
                .setShortDescription(US_LISTING_SHORT_DESCRITPION);


        Update updateUSListingsRequest = edits
                .listings()
                .update(ApplicationConfig.PACKAGE_NAME,
                        editId,
                        Locale.getDefault().toString(),
                        newHRListing);
        Listing updatedUsListing = updateUSListingsRequest.execute();
        log.info(String.format("Created new US app listing with title: %s",
                updatedUsListing.getTitle()));

        // Create and update listing for UK version of the application.


        // Commit changes for edit.
        Commit commitRequest = edits.commit(ApplicationConfig.PACKAGE_NAME, editId);
        AppEdit appEdit = commitRequest.execute();
        log.info(String.format("App edit with id %s has been comitted", appEdit.getId()));

    } catch (IOException | GeneralSecurityException ex) {
        log.error("Exception was thrown while updating listing", ex);
    }
}
...