cianru / huawei-appgallery-publish-gradle-plugin

Huawei AppGallery Publish Gradle Plugin allows you to publish the android release build file (*.apk or *.aab) to the Huawei AppGallery store
Apache License 2.0
113 stars 20 forks source link

Bug: Can't publish apk #33

Closed juliocbcotta closed 2 years ago

juliocbcotta commented 3 years ago

I just tried the release 1.3.0 and the sample project here...

 ./gradlew assembleDemoRelease
 ./gradlew publishHuaweiAppGalleryDemoRelease

Build file /Users/julio.buenocotta/git/huawei-publish-gradle-plugin/sample-groovy/build/outputs/apk/demo/release has wrong file extension that doesn't match with announced buildFormat(APK) plugin extension param.

juliocbcotta commented 3 years ago

@cosic are you there ?

cosic commented 3 years ago

@BugsBunnyBR Hi! Yes, I'm here. I'm going to figure out it next weekend.

cosic commented 3 years ago

I found a couple issues which blocked me https://github.com/gradle/gradle/issues/16777 and https://github.com/gradle/gradle/issues/16775. I'm trying to figure it out.

juliocbcotta commented 3 years ago

For the first issue... have you tried this workaround https://github.com/gradle/gradle/issues/16777#issuecomment-817303964 ? It is odd, someone commented that is was fixed in gradle 7.1.1... and ktlint was able to workaround it as well... maybe looking at the code or their changelog would help ?

cosic commented 3 years ago

@BugsBunnyBR Sorry for long reaction. But seems I fixed this issue. Could you check 1.3.1-SNAPSHOT version or into snapshot-1.3.1 branch?

juliocbcotta commented 3 years ago

Hey, thanks, I will test it today or tomorrow

juliocbcotta commented 3 years ago

we tested in our CI with the command ./gradlew clean assembleVeepeeAllRelease :app:publishHuaweiAppGalleryVeepeeAllRelease

and got this error

Execution failed for task ':app:publishHuaweiAppGalleryVeepeeAllRelease'.
> java.io.FileNotFoundException: null (No such file or directory). Application build file is not found. Please run `assemble` or `bundle` task to build the application file before current task.

Any ideas ?

cosic commented 3 years ago

@BugsBunnyBR Hi! Could you check again 1.3.1-SNAPSHOT version please?

juliocbcotta commented 3 years ago

hey, we tried again, this is the result

Execution failed for task ':app:publishHuaweiAppGalleryVeepeeAllRelease'.
> java.io.FileNotFoundException: null (No such file or directory). Application build file is not found. Please run `assemble` or `bundle` task to build the application file before current task.

I could this these logs

Huawei AppGallery Publishing API: Generate Config
Huawei AppGallery Publishing API: Build File Directory: /builds/veepee/offerdiscovery/products/front-mobile/android/android-vente-privee/app/build/outputs/apk/veepeeAll/release
cosic commented 2 years ago

@BugsBunnyBR Is /builds/veepee/offerdiscovery/products/front-mobile/android/android-vente-privee/app/build/outputs/apk/veepeeAll/release correct folder path for build apk file? Does it contain any apk file?

juliocbcotta commented 2 years ago

it should be the right folder, sadly we are not keeping the apk as an artefact there...

cosic commented 2 years ago

@BugsBunnyBR If you are using non-standard file path than variable buildFile can help you to set the direct path to the apk file.

huaweiPublish {
    instances {
        release {
           buildFile = "$projectDir/build/output/apk/release/app-release.apk"
            ...
        }
    }
}
juliocbcotta commented 2 years ago

It seems that compiling the app in a different command resulted in the upload task to work! This works

./gradlew clean assembleRelease
./gradlew :app:publishHuaweiAppGalleryRelease

This doesn't work

./gradlew clean assembleRelease :app:publishHuaweiAppGalleryRelease
cosic commented 2 years ago

@BugsBunnyBR Yes i got the same feedback here (issue#26) but haven't tackled the issue yet. Do you have any idea why?

cosic commented 2 years ago

Fixed at v1.3.1