Triple-T / gradle-play-publisher

GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.
MIT License
4.13k stars 341 forks source link

Clarify error message on incorrect APK numbers for uploadReleasePrivateApk #671

Closed tomaszrykala closed 5 years ago

tomaszrykala commented 5 years ago

Describe the bug

With

play { 
   artifactDir = file("build/outputs/apk/release/") 
}

in build.gradle

the ./gradlew uploadReleasePrivateApk task reports

Warning: no APKs found in '/Users/tomaszr/android/git/my_project/app/build/outputs/apk/release/' yet.

However when I run ls Users/tomaszr/android/git/my_project/app/build/outputs/apk/release/ I see the apk. There are actually three inside.

How To Reproduce

Versions

Tasks executed

uploadReleasePrivateApk

Expected behavior

The apk to be found. it's clearly in the folder, but the script fails to locate it. If the plugin struggles with multiple apks, the messaging should be improved.

Additional context (if a crash, provide stack trace)

Add any other context about the problem here. If this bug is a crash, run the task with --stacktrace to get the full context.

tomaszrykala commented 5 years ago

I can see that if I leave one APK in the dir, the plugin passes the APK check. Therefore it would be beneficial to have a artifactFile var where we can specify the exact APK, much like we can specify the folder with artifactDir. The messaging could also be improved when more than one APKs are found.

I can work on that feature - artifactFile and improved error messaging, if required.

SUPERCILEX commented 5 years ago

Oh whoops, the uploadReleasePrivateApk only supports a single APK. I'll update the message.

As for your second request, I don't want to advertise this "feature", but I made it so artifactDir actually accepts files too in GPP v2.4. See the reasoning for that here.