oliviergauthier / gradle-appcenter-plugin

This gradle plugin allow you to upload each build variant of your android application to separate AppCenter Apps.
MIT License
84 stars 44 forks source link

Upload fails for app name with white spaces #29

Closed emartynov closed 4 years ago

emartynov commented 4 years ago

Something strange is happening.

If I have app at appcenter "Android - App" - it fails to upload:

 Task has not declared any outputs despite executing actions.
--> POST https://api.appcenter.ms/v0.1/apps/Company/Android%20-%20App/release_uploads (0-byte body)
<-- 403 Forbidden https://api.appcenter.ms/v0.1/apps/Company/Android%20-%20App/release_uploads (665ms, unknown-length body)

Upload works as soon as I rename it to "Android-App":

--> POST https://api.appcenter.ms/v0.1/apps/Company/Android-App/release_uploads (0-byte body)
<-- 201 Created https://api.appcenter.ms/v0.1/apps/Company/Android-App/release_uploads (1163ms, 253-byte body)
-

I've tried to compare what is going on the fastlane side. Since iOS friends don't have such issue. Unfortunately, my ruby is not fluent to understand the difference https://github.com/microsoft/fastlane-plugin-appcenter/blob/master/lib/fastlane/plugin/appcenter/helper/appcenter_helper.rb#L508

It looks like they don't do url encoding. Am I right? Can it work?

oliviergauthier commented 4 years ago

Actually it's AppCenter that removes whitespace of application name in URL. That's why in the readme file i explain how to retrieve the AppName to use from the URL

Note : ownerName and appName can be found from AppCenter application url (https://appcenter.ms/users/{ownerName}/apps/{appName})

But maybe it not clear enought or maybe i can remove whitespace in the plugin too

Regards

Olivier

emartynov commented 4 years ago

Hilarious!

Now you said this I tried and it works. If I also pay attention to the app url I see that whitespaces are removed. I also went to iOS fastlane file and they also knew about this trick.

Thank you!

emartynov commented 4 years ago

You might or warn about whitespaces or remove them. You might also update the documentation to force people copy paste part from url. Closing for now.

Thank you again!