Menu
Who Do Is
  • Home
  • What
  • How
  • Is
  • Can
  • Are
  • Does
  • Do
  • Why
  • Who
  • Where
  • Which
  • Which
  • Should
  • Will
  • When
  • What’s
  • Did
Who Do Is

[ANSWERED] How to upload Android Release APK file into Huawei AppGallery with Connect API?

Posted on November 14, 2022

Solution 1 :

Your question is:

How do I upload a newer version of a Release APK into AppGallery
correctly?

First, you have already downloaded APK with the URL. Please make sure the Updating App File Information invoked within 5 minutes. Because the uploaded file is only available for 5 minutes before calling the Updating App File Information API.

Second, please perform the following steps to upload the newer version:

  1. Step One: Obtaining the File Upload URL: This API is used to obtain the upload URLs of files including images, videos, and APK, RPK, and PDF files when developers need to upload these files.

  2. Step Two: Uploading Files:This API is used to upload files from a client or server to the file server.

  3. Step Three: Updating App File Information: This API is used to update app file information after images, videos, and APK and RPK files are uploaded.

  4. Step Four: Submitting an App for Release: This API is used to submit a request for app approval. Before calling this API, ensure that the app information is complete and the app software package has been uploaded.

You can check whether the above two parts have solved your problem.

Problem :

I’ve got a project set up at Huawei AppGallery and want to make a Gradle plugin that uploads a new version of a Release APK file into the project without submitting it for approval, using Huawei Connect API (just upload a new version, not publish actual update to the users). Right now there is an older version of the android apk at HuaweiAppGallery.

This is what I’ve got so far. With huaweiService instance it just calls endpoints of Connect API:

    // get access token
    val token = huaweiService.getToken(
        clientId = clientId,
        clientSecret = clientSecret
    )

    // get app id
    val appInfo = huaweiService.getAppID(
        clientId = clientId,
        token = token,
        packageName = variant.applicationId
    )
    
    val uploadUrl = huaweiService.getUploadApkUrl(
        clientId = clientId,
        token = token,
        appId = appInfo.value
    )

    // upload apk file
    val fileInfoListResult = huaweiService.uploadApkFile(
        uploadUrl = uploadUrl.uploadUrl,
        authCode = uploadUrl.authCode,
        apkFile = apkFile
    )

    // update app info
    val fileInfoRequestList = mapFileInfo(fileInfoListResult, apkFileName)
    val appId = appInfo.value
    huaweiService.updateAppFileInformation(
        clientId = clientId,
        token = token,
        appId = appId,
        fileInfoRequestList = fileInfoRequestList
    )

The issues I’ve run into are:

  1. APK file upload request actually succeeds, uploadApkFile returns a download url inside a result (I can even download APK with this url), but this APK file is not appearing inside Huawei AppGallery, where all APK versions of the app appear when I load them manually. So I can’t submit it for release approval.

  2. updateAppFileInformation method executed after uploading APK fails with error:

    [cds]add apk failed, additional msg is [package name already exists]
    

Why is it telling me that package name already exists? I know that it does, there is an older version of my app already uploaded, which I just want to update.
Ho do I upload a newer version of a Release APK into AppGallery correctly so that I could take it and submit for release manually after that?

READ  [ANSWERED] android - Kotlin setOnClickListener syntax using lambda
Powered by Inline Related Posts

Comments

Comment posted by yabee-dabee

Thank you for your response. As for the second part of your answer, I’m doing exactly what you wrote, except for the step 4. I don’t want to submit the app for release with plugin, I just want to upload it so that I could manually submit it later from the Console. But the step 3 fails for me: I call Update App File Info request within 5 minutes after successful upload, but it fails with the error saying

Comment posted by zhangxaochen

@yabee-dabee Allright. Please check whether the package name is used by other applications and whether the transferred appid corresponds to the package name.

Comment posted by Fernando Prieto Moyano

Is there any solution to this @yabee-dabee and @shirley? I’ve got the same issue and everything seems to be correct in my setup.

Comment posted by this

@FernandoPrieto Will

Comment posted by plugin

I’ve wrote a Gradle

Recent Posts

  • How can I play with my cat without toys?
  • What is a bag pipe band called?
  • Are Honda Civics actually fast?
  • Are Yankee candles toxic?
  • How do I pair my Michael Kors smartwatch with my Android?

Recent Comments

No comments to show.

Archives

  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuántas
  • ¿Cuánto
  • ¿Que
  • ¿Quién
  • 90” and 108” so you may have to round up to the nearest size.
  • and delete any Spotify folders from it. Once this is done
  • Android
  • Are
  • At
  • Bei
  • blink
  • C'est
  • Can
  • carbs
  • Comment
  • Did
  • Do
  • Does
  • During
  • For
  • Has
  • How
  • In
  • Is
  • Ist
  • Kann
  • Können
  • nouveau
  • On
  • or 108 inches.2020-08-03
  • Où
  • owning
  • Pourquoi
  • Puis-je
  • Quand
  • Quante
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • spiritual
  • tap the downward-facing arrow on the top left. A downward-facing arrow will appear underneath each song in the album; they'll turn green as the download completes.2020-07-28
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welcher
  • Welches
  • Welke
  • Wer
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Whose
  • Why
  • Wie
  • Will
  • Wo
  • Woher
  • you will receive two curtains each with the same measurements of width 66"" (168cm) x drop 54""(137cm).
  • you'll see a green downward-facing arrow next to each song.2021-02-26
©2023 Who Do Is | Powered by SuperbThemes & WordPress