Ionic 3 & sentry-cordova : sourcemap mapping problems

Hi, I’m using sentry-cordova SDK (0.11.0) to track errors of my android app developed with ionic 3, but sentry can’t map the android sourcecode/sourcemap although the artifacts exist under the right release version.

I’ve this system/project configuration

cli packages: (/Users/xxxxx/.nvm/versions/node/v8.11.1/lib/node_modules)
    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0
global packages:
    cordova (Cordova CLI) : 8.0.0
local packages:
    @ionic/app-scripts : 3.1.9
    Cordova Platforms  : android 7.1.0
    Ionic Framework    : ionic-angular 3.9.2
System:
    Android SDK Tools : 26.1.1
    Node              : v8.11.1
    npm               : 5.6.0
    OS                : macOS High Sierra
    Xcode             : Xcode 9.3 Build version 9E145
Environment Variables:
    ANDROID_HOME : /Users/xxxxx/Library/Android/sdk
Misc:
    backend : pro

I followed the sentry/ionic guide on https://docs.sentry.io/clients/cordova/ionic/ and I can submit and track error on the sentry service.

Here, there are 2 problems:

  1. version problem - on the building phase, the sdk is able to push automatically the code (and sourcemap) to sentry, but on a new auto-generated release version. Then, when I send error to sentry, it uses the app version (specified on config.xml, package.json, etc.) and it can’t map code properly with the previously auto-generated number version.
    For more details about it, follow this issue: https://github.com/getsentry/sentry-cordova/issues/61

  2. prefix problem? - then I tried to manually push artifacts using sentry-cli, with different --url-prefix configuration (/, nothing, etc.)
    2 - Web Case) Method 2 works (I can see the mapping on sentry) only when I test app with ionic serve from the browser, pushing artifacts on this way:
    $ sentry-cli releases -o xxxxx -p xxxxx files x.y.z upload www/build/FILE.EXT '~/FILE.EXT' (for every source)
    $ sentry-cli releases -o xxxxx -p xxxxx files x.y.z upload-sourcemaps www/build (once for all sourcemap)
    2 - Android Case) Method 2 doesn’t work (I can’t see the mapping on sentry) when I build the android app with ionic cordova build android ..., testing on smartphone with the generated apk (-debug), pushing artifacts on this way:
    $ sentry-cli releases -o xxxxx -p xxxxx files x.y.z upload platforms/android/app/src/main/assets/www/build/FILE.EXT '~/FILE.EXT' (for every source)
    $ sentry-cli releases -o xxxxx -p xxxxx files x.y.z upload-sourcemaps platforms/android/app/src/main/assets/www/build (once for all sourcemap)

What am I missing?

(Sorry for bad english :stuck_out_tongue: )

Thanks

Hey, thanks for the detailed writeup.
I replied on Github since someone else is having the same problem.

1 Like