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

Source code was not found app:///index.android.bundleeven I've uploaded sourcemap #1385

Closed
abdullahizzuddiin opened this issue Mar 9, 2021 · 8 comments

Comments

@abdullahizzuddiin
Copy link

Environment

How do you use Sentry?
sentry.io

Which SDK and version?

  • react native 0.61.5
  • @sentry/react-native: ^2.2.2

Steps to Reproduce

Initial Configuration

const dsn = Config.SENTRY_DSN;
const debug = __DEV__;
const release = `${DeviceInfo.getBundleId()}@${versionName}@${versionCode}+codepush:${codepushDist}`;
const dist = `${versionName}@${versionCode}+codepush:${codepushDist}`;
const environment = isProductionEnv ? 'production' : 'staging';
const sampleRate = debug ? 1 : 0.5;
const tracesSampleRate = 0.2;
const maxBreadcrumbs = 150; 

    Sentry.init({
        dsn,
        debug,
        release,
        dist,
        environment,
        sampleRate,
        tracesSampleRate,
        maxBreadcrumbs,
    });
  • upload sourcemap
node_modules/@sentry/cli/bin/sentry-cli releases --org my-org --project my-project-slug     files "my.app.staging.debug@1.23.0@155+codepush:1"     upload-sourcemaps     --dist "my.app.staging.debug@1.23.0@155+codepush:1"     --strip-prefix . --bundle android/app/build/generated/assets/react/staging/debug/index.android.bundle --bundle-sourcemap android/app/build/generated/sourcemaps/react/staging/debug/index.android.bundle.map

// I also did this
node_modules/@sentry/cli/bin/sentry-cli releases --org my-org --project my-project-slug     files "my.app.staging.debug@1.23.0@155+codepush:1"     upload-sourcemaps     --dist "my.app.staging.debug@1.23.0@155+codepush:1"     --strip-prefix . android/app/build/generated/sourcemaps/react/staging/debug/index.android.bundle.map
  • trigger random bug.
  • Look at sentry UI and find the issue

Expected Result

I won't see any error as on Actual Result section.

I want to see my stack trace (without minified) and find the real root cause of my buggy app.

Actual Result

  • Issue Section
    image

  • Sourcemap Section
    image

Notes

I also have read these issues:

@jennmueng
Copy link
Member

@abdullahizzuddiin As it says in your screenshot, you cannot have the @ character in the dist field. I would just set dist to 155+codepush:1 in your case.

@abdullahizzuddiin
Copy link
Author

abdullahizzuddiin commented Mar 9, 2021

Thanks for pointing out @jennmueng.

I'll try your suggestion about dist issue

My main concern is the second error message. How to fix this app:///index.android.bundle issue

@abdullahizzuddiin
Copy link
Author

abdullahizzuddiin commented Mar 9, 2021

image
This is what I got. So, I changed it to 155.1 and dist error has disappeared

But, the app:///index.android.bundle error still exist
image

*I took screen capture of different issue on sentry dashboard. Somehow, the first issue that I posted on thread started didn't appeared again on sentry dashboard even though it still happened on our app.

@jennmueng
Copy link
Member

@abdullahizzuddiin Your new error is happening because your sourcemaps are named index.android.bundle and the error occurs in index.js. The filenames have to match for the sourcemaps to work. Are you running in dev mode or something that's causing the JS code not to be loaded from index.android.bundle?

@abdullahizzuddiin
Copy link
Author

Actually, both of error that I uploaded (on thread starter and on previous post) is happened on react-native android debug mode.

And I just realized, my app's sourcemap that usually generated and located on android/app/build/generated/sourcemaps/ is not exist. As I read @sentry/react-native/sentry.gradle, that gradle will delete sourcemap after uploaded to sentry server. Unfortunately, sourcemap's release name that come from sentry.gradle didn't same as release name that I initialize on Sentry.init()

image

can we customize release name used on sentry.gradle ? or can we disable auto delete from that gradle?

@jennmueng
Copy link
Member

@abdullahizzuddiin If you use custom release names, you will have to manually upload sourcemaps: https://docs.sentry.io/platforms/react-native/manual-setup/sourcemaps/

@abdullahizzuddiin
Copy link
Author

Ah, I don't know that. Thanks for pointing it out.

So, how can I disable autoupload then?

Should I omit this command on app/build.gradle apply from: "../../node_modules/@sentry/react-native/sentry.gradle" ? is it safe?

@jennmueng
Copy link
Member

Sorry for the late reply, I thought I had already replied! Yes, you can omit the sentry.gradle build step to stop sourcemaps if you wish to do so.

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

2 participants