oliviergauthier / gradle-appcenter-plugin

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

Upload without mapping file (debug) fails with version 1.2 #45

Closed Rolf-Smit closed 4 years ago

Rolf-Smit commented 4 years ago

When uploading a build type to that does not produce a mapping the plugin will crash whenever uploadMappingFiles is enabled, this bug was introduced here:

https://github.com/oliviergauthier/gradle-appcenter-plugin/blame/02f6f19131d576d4fd960af4e00d4f3511c17030/src/main/kotlin/com/betomorrow/gradle/appcenter/AppCenterPlugin.kt#L74

And can be reproduced by running (with: uploadMappingFiles set to true) gradlew app:appCenterUploadDebug --stacktrace

Stacktrace:

Caused by: java.lang.IllegalStateException: Expected file collection to contain exactly one file, however, it contains no files.
        at org.gradle.api.internal.file.AbstractFileCollection.getSingleFile(AbstractFileCollection.java:86)
        at com.betomorrow.gradle.appcenter.AppCenterPlugin$handleVariant$$inlined$let$lambda$1$1$2.invoke(AppCenterPlugin.kt:74)
        at com.betomorrow.gradle.appcenter.AppCenterPlugin$handleVariant$$inlined$let$lambda$1$1$2.invoke(AppCenterPlugin.kt:12)
        at com.betomorrow.gradle.appcenter.tasks.UploadAppCenterTask.upload(UploadAppCenterTask.kt:40)