Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Invalid Source Maps after deployment of React Native app through Bitrise resulting in null:null:null #3866

Open
wonderlul opened this issue Jun 21, 2023 · 0 comments

Comments

@wonderlul
Copy link

Hello Everyone!

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?

It is also worth emphasizing that I don't fully know where to seek help. If this is not the right place, please indicate where I could find assistance.

If any information is needed, please tell.

Best regards!

React Native Version
0.69.7

Output of npx react-native info
System:
OS: macOS 13.4
CPU: (8) arm64 Apple M1
Memory: 78.63 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.14.0 - ~/.nvm/versions/node/v18.14.0/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 9.3.1 - ~/.nvm/versions/node/v18.14.0/bin/npm
Watchman: 2023.05.22.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /Users/wonderlul/.rvm/gems/ruby-2.7.5/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK:
API Levels: 30, 31, 33
Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0, 33.0.0
System Images: android-30 | Google APIs ARM 64 v8a, android-31 | Google APIs ARM 64 v8a, android-31 | Google APIs Intel x86 Atom_64, android-33-ext5 | Google Play ARM 64 v8a, android-33 | Google APIs ARM 64 v8a
Android NDK: 22.1.7171670
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9619390
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 11.0.15 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.2.0
react-native: 0.69.7 => 0.71.10
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant