0

I have created flavor builds in the android side of a React Native app. Earlier there was no flavor builds. So I was uploading the source map using CI like this

- run:
          name: Upload sourcemaps to Bugsnag
          command: |
            if [[ $BUGSNAG_KEY ]]; then
              yarn generate-source-maps-android upload \
                --api-key=$BUGSNAG_KEY \
                --app-version=$CIRCLE_BUILD_NUM \
                --minifiedFile=android/app/build/generated/assets/react/release/app.bundle \
                --source-map=android/app/build/generated/sourcemaps/react/release/app.bundle.map \
                --minified-url=app.bundle \
                --upload-sources
            fi

But now the app is now divided into two flavor builds (play and foss) and Bugsnag is available only in play build.

I am getting this error as the source map path needs to be updated.

 [error] Error uploading source maps: Error: Source map file does not exist (android/app/build/generated/sourcemaps/react/release/app.bundle.map)
    at /home/********/repo/node_modules/bugsnag-sourcemaps/lib/options.js:141:17

I need help in determining what will be the updated path of source map in case of multiple flavors in the app? Thanks in advance.

PS: I Have gone through the docs but didn't find anything related to this scenario.

GOVIND DIXIT
  • 1,748
  • 10
  • 27

1 Answers1

0

Solution

After adding flavors the updated paths for minified file and source map for me is

minifiedFile=android/app/build/generated/assets/react/play/release/app.bundle 
source-map=android/app/build/generated/sourcemaps/react/play/release/app.bundle.map 

In general, if you added a build flavor (flavor_name) in your android section. Then your updated paths will be:

minifiedFile=android/app/build/generated/assets/react/{flavor_name}/release/app.bundle 
source-map=android/app/build/generated/sourcemaps/react/{flavor_name}/release/app.bundle.map 

Reference: https://github.com/bugsnag/bugsnag-react-native/issues/473

GOVIND DIXIT
  • 1,748
  • 10
  • 27