bugsnag / bugsnag-react-native

Error monitoring and reporting tool for native exceptions and JS errors in React Native apps
https://docs.bugsnag.com/platforms/react-native
MIT License
370 stars 121 forks source link

Android App versionName not updated on new versions #411

Closed GlisboaDev closed 5 years ago

GlisboaDev commented 5 years ago

Description/ Issue

When production users update our app, the android versionName displayed on bugsnag is incorrect, we have the right versionCode, but it doesn't match the right versionName.

Environment

Library versions: "bugsnag-react-native": "^2.23"

bugsnag-react-native@^2.23:
  version "2.23.1"
  resolved "https://registry.yarnpkg.com/bugsnag-react-native/-/bugsnag-react-native-2.23.1.tgz#433d30ea22f54aaff7247de66d79321b863bd632"
  integrity sha512-s059GvKSgTid4A9GOWbc8EkJQYMZZeFm+TEOzjJWcS81DJbudZdpwG8DRjBf+ofVTrW7+8ArwdCXOM0R3W5EEA==

react-native@0.60.5:
  version "0.60.5"
mattdyoung commented 5 years ago

Hi @GlisboaDev

Are you configuring the app version in bugsnag-react-native? https://docs.bugsnag.com/platforms/react-native/react-native/configuration-options/#appversion

Or in the underlying bugsnag-android library? https://docs.bugsnag.com/platforms/android/configuration-options/#setappversion

Or do you have versionName set in your AndroidManifest.xml?

I imagine the out of date versionName is coming from one of those places: https://github.com/bugsnag/bugsnag-android/blob/5387d2591bf46d68dc472e2ae1c1b7edba21904e/bugsnag-android-core/src/main/java/com/bugsnag/android/AppData.java#L148-L163

GlisboaDev commented 5 years ago

No @mattdyoung , we're leaving it for the automatic detection. Currently we have a .properties and set it through gradle at build time.

      ext.appVersion = loadProperties file('app.version.properties')

        versionCode = Integer.parseInt(ext.appVersion['versionCode'])
        versionName = ext.appVersion['versionName']

Looking at the code you linked, the outdated one would either come from the packageInfo or config. Where do we read that config from? I see it's received when initializing this class

mattdyoung commented 5 years ago

Hi @GlisboaDev

I suspect it's being read from your AndroidManifest.xml. Could you confirm whether the outdated versionName shows up there?

mattdyoung commented 5 years ago

@GlisboaDev I'll close this for now as we've had no response for a couple of weeks. If you're still having issues feel free to contact us at support@bugsnag.com.