bugsnag / bugsnag-android-gradle-plugin

Gradle plugin for BugSnag which uploads ProGuard, DexGuard and NDK mapping files, and sends build notifications
https://docs.bugsnag.com/build-integrations/gradle/
MIT License
70 stars 38 forks source link

./gradlew uploadBugsnag${variantOutputName}SourceMaps fails #374

Closed ch4ndu closed 3 years ago

ch4ndu commented 3 years ago

Describe the bug

SourceMaps command fails with this message:

Bugsnag: source map upload failed. Exit code=1, msg= ERROR Invalid argument provided. Unknown option: --overwrite

./gradlew :example:uploadBugsnagJavaExample-x86-releaseMapping command works fine in my project and uploads JVM mapping to the console successfully Bugsnag gradle version - 5.7.4

Steps to reproduce

  1. integrate bugsnag following these steps for RN project
  2. run ./gradlew :example:uploadBugsnagJavaExample-x86-releaseSourceMaps
mattdyoung commented 3 years ago

@ch4ndu Thanks for raising this. We'll look into fixing in a future release.

I believe this would only happen if you set overwrite = true in the bugsnag gradle plugin config. It shouldn't be necessary to do that for React Native projects as the default is to overwrite source maps for React Native projects: https://docs.bugsnag.com/build-integrations/js/source-maps-react-native/#option-reference

So to resolve this for now simply remove the overwrite = true option from your app module's build.gradle file.

But this is unclear from the bugsnag gradle plugin documentation and shouldn't fail like this.

mattdyoung commented 3 years ago

This is fixed by upgrading to bugsnag-source-maps v2.2.0.