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

Sentry for android unable to show the code where the error occurs #372

Closed
1 task done
sahil290791 opened this issue Mar 7, 2018 · 7 comments
Closed
1 task done

Comments

@sahil290791
Copy link

sahil290791 commented Mar 7, 2018

OS:

  • [x ] MacOS

Platform:

  • Android

Output of node -v && npm -v && npm ls --prod --depth=0

node: v8.9.3
npm: 5.5.1

I have following issue:
The sourcemaps get automatically uploaded during the build process for iOS and android as given in the sentry documentation.

When I do a release build for iOS from xcode, it uploads two files:

// in case of iOS
main.jsbundle
main.jsbundle.map

In case of android also I have this line in app/build.gradle:

apply from: "../../node_modules/react-native-sentry/sentry.gradle"

the above code takes care of uploading sourcemaps during build process.

It uploads two files:

// in case of android
index.android.bundle
index.android.bundle.map

It also shows this in android:

Source code was not found for app:///index.android.bundle Collapse
{
  "url": "app:///index.android.bundle"
}

However I can see that the file is present in sentry > releases.

Actual result:

But when I receive any error in android, it shows up like this in sentry:
screen shot 2018-03-07 at 11 11 59 am

Is it happening because of some mismatch in the bundle used by app and bundle uploaded with a different name by react-native-sentry.

I am able to trace the line and see the code in sentry for iOS:
screen shot 2018-03-07 at 11 12 51 am

Expected result:
To be able to see the code where the error occurs in sentry.

@sahil290791
Copy link
Author

It was happening due to environment variables that I had exported day before related to sentry which was overriding the config.

@riyazMuhammad
Copy link

Hey @sahil290791, Can you please share what had gone wrong?
I have come across the same thing! Please!

@sahil290791
Copy link
Author

@riyazMuhammad sentry.properties was picking up my previously defined env variables which was causing a mismatch and hence the error was happening. I had just opened a new terminal tab and then again started the app generation process and everything worked fine after that.

@riyazMuhammad
Copy link

Thank you @sahil290791.

@sahil290791
Copy link
Author

sahil290791 commented Dec 24, 2018

I am seeing the above error again. I have checked all the linking steps they are correct.
This is happening for both android and iOS.

Sentry upload happens through this:

apply from: "../../node_modules/react-native-sentry/sentry.gradle"

I see this command twice in console while building apk:

(Run with --stacktrace to get the full stack trace of this deprecation warning.)
[node_modules/@sentry/cli/bin/sentry-cli, --log-level, debug, react-native, gradle, --bundle, /Users/sahil/Documents/nativeapp/android/app/build/intermediates/assets/debug/index.android.bundle, --sourcemap, /Users/sahil/Documents/nativeapp/android/app/build/intermediates/assets/debug/index.android.bundle.map, --release, com.example.app-3.8.8.alpha, --dist, 1]
[node_modules/@sentry/cli/bin/sentry-cli, --log-level, debug, react-native, gradle, --bundle, /Users/sahil/Documents/nativeapp/android/app/build/intermediates/assets/release/index.android.bundle, --sourcemap, /Users/sahil/Documents/nativeapp/android/app/build/intermediates/assets/release/index.android.bundle.map, --release, com.example.app-3.8.8.alpha, --dist, 1]

screenshot 2018-12-24 at 11 03 00 am

screenshot 2018-12-24 at 11 02 17 am

screenshot 2018-12-24 at 11 31 47 am

screenshot 2018-12-24 at 11 01 55 am

I have seen all the existing issues related to index.android.bundle but they didn't help. I am using:

  • react-native 0.55.4
  • react-native-sentry: 0.35.1

I have private sentry server so will not be able to share the URL.

Is there any other way to infer release version and dist from sourcemap to find the actual issue?

@sahil290791 sahil290791 reopened this Dec 24, 2018
@sahil290791
Copy link
Author

@HazAT can u show me a sample release name for ios/android project, in my case its like: com.example.com-<version_number> and dist is lets say 91.

And in Releases page I can see release as just <version_no> there is no package name mentioned:
screenshot 2018-12-30 at 8 22 46 am

If I open the releases page for a specific release:
screenshot 2018-12-30 at 8 23 01 am

But when the error gets reported I see the release as com.example.com-<version_number>.

Is this the reason I keep seeing the error that Source code was not found? It used to work few months back but that too randomly. Now it doesn't decode the errors at all.

What should I do to make it work. Is there any way for me to backtrack the release name and dist that gets set in the sourcemap file to see if there is any issue?

@HazAT
Copy link
Member

HazAT commented Sep 4, 2019

I am closing all old issues, please if this is still a problem feel free to revive it.
Also, consider moving to our new SDK @sentry/react-native if it still happens there please open a new issue.

@HazAT HazAT closed this as completed Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants