A release with artifacts was created with gradle assembleRelease.
When the app crashes and create an issue a new release, with the same name as the existing one, is created and linked to the issue.
Why is a new release created with the same name instead of linking to the existing one?
Hey, so it looks like that the native part for Android isn’t working.
You can see this because the last section of the event (SDK) says raven-js instead of sentry-react-native.
So there must be something wrong with the linking process of the native part, did you call react-native link react-native-sentry?
Make sure Sentry gets called in your java code, debug it and check the log output you should see something about Sentry.
As our project structure is different I can not simply run react-native link react-native-sentry.
How would I add the necessary configuration by hand?
Is this documented somewhere?
Got it working. My application implements ReactApplication and I added RNSentryPackage to the react instance in my activity:
reactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("index.android.bundle")
.setJSMainModulePath("index.android")
.addPackages(Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNSentryPackage(App.getInstance())
))
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();
The issue no resolves to the correct release in sentry. The only problem now is that when the issue is sent from the app, distribution is set to 0 and the artifact in the created release has the correct distribution of 34017002.
Can I configure the RNSentryPackage in some way so that the correct distribution is used?
So this call has to be in Javascript, we haven’t exposed any Java API.
You either need to set a variable somewhere in your build process so it can be fetched in JS
or
use another react-native plugin which is able to retrieve the dist you set in Java at runtime.
Usually, this wouldn’t be necessary because our scripts handle this if you use it with a “clean” react-native app, but since I don’t know how much you diverged from the standard build process it’s hard to say.
I do not think that my case is totally uncommon though. I know about more companies that are trying out react by using it in one activity in an existing app. It would be nice if it was clear how to integrate sentry in a case like this.