2

Recently, I've been dealing with the problem of symbolicating errors that end up in Crashlytics. To achieve that, I wanted to use source maps and metro-symbolicate. Generally, when building the application locally, the source map file is correctly created, and I can read it using metro-symbolicate. However, after building the application through Bitrise, the source maps become unreadable.

The first aspect I took into account is the discrepancy between the output files generated when building the application locally versus building it through Bitrise. I'm not exactly sure how the process of creating source maps works, but I assume that even the same source code built in two different environments can result in different source maps. Therefore, I tried exporting the source maps from Bitrise as artifacts during the application build. At this point, I will present only one step related to building the Android application. If anyone notices that more information is needed, please let me know.

Release-GooglePlay-Internal:
    steps:
    - set-java-version@1: {}
    - install-missing-android-tools:
        inputs:
        - ndk_revision: '21'
    - android-build@1.0:
        inputs:
        - project_location: "$BITRISE_SOURCE_DIR/android"
        - build_type: aab
        - variant: "$VARIANT"
    - sign-apk: {}
    - google-play-deploy:
        inputs:
        - service_account_json_key_path: "$BITRISEIO_GOOGLE_API_APPNAME_NEW_URL"
        - apk_path: "$BITRISE_SIGNED_AAB_PATH|$BITRISE_AAB_PATH"
        - app_path: "$BITRISE_SIGNED_AAB_PATH"
        - user_fraction: '0.5'
        - mapping_file: ''
        - package_name: "$PACKAGE_NAME"
    - deploy-to-bitrise-io@2:
        inputs:
        - deploy_path: "$BITRISE_SOURCE_DIR/android/app/build/generated/assets/react/fr/release/index.android.bundle"
        title: Bitrise Deploy Bundle
    - deploy-to-bitrise-io@2:
        inputs:
        - pipeline_intermediate_files: "$BITRISE_SOURCE_DIR/android/app/build/intermediates/sourcemaps/react/fr/release/index.android.bundle.packager.map:BITRISE_PLAY_STORE_SOURCEMAP_PATH"
        - deploy_path: "$BITRISE_SOURCE_DIR/android/app/build/intermediates/sourcemaps/react/fr/release/index.android.bundle.packager.map"
        title: Bitrise Deploy Sourcemaps
    after_run: []

Having obtained the stack trace from Firebase and exported source maps, I used metro-symbolicate. The first problem encountered was:

TypeError: Line must be greater than or equal to 1, got 0

It seems that the method is not directly handling the stack trace from Firebase. Nevertheless, I decided to leave only the first five lines, which should point to specific locations in the code. In that case, the result looks like this:

null:null:null
null:null:null
null:null:null
null:null:null
null:null:null

What could be the reason? Some kind of minification or transformation issues? The stack trace is showing "null:null:null" for every stack frame. Is something strip away essential information needed for symbolication?

If any information is needed, please tell.

Best regards!

React Native Version 0.69.7

wonderlul
  • 21
  • 3

1 Answers1

0

Generally we receive TypeError: Line must be greater than or equal to 1, got 0 error when symbolication does not understand some piece of log.

Try removing lines one by one from end of the log. You will get proper result once that piece of log is removed.

Yuvraj Patil
  • 7,944
  • 5
  • 56
  • 56
  • I know, that's not the main issue as I explained later. Maybe I should leave that part to be honest because it's not really relevant. – wonderlul Jul 23 '23 at 10:36