Skip to content

RNSentry.captureEnvelope got 3 arguments, expected 4 #2505

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

Closed
5 of 11 tasks
pdavid0 opened this issue Sep 29, 2022 · 15 comments
Closed
5 of 11 tasks

RNSentry.captureEnvelope got 3 arguments, expected 4 #2505

pdavid0 opened this issue Sep 29, 2022 · 15 comments

Comments

@pdavid0
Copy link

pdavid0 commented Sep 29, 2022

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

SDK version: 4.5.0

react-native version: 0.69.4

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

If you are using sentry.io, please post a link to your issue so we can take a look:

https://sentry.io/organizations/inspectify/issues/3629448282/?project=5740339&query=is%3Aunresolved&statsPeriod=1h

Configuration:

const routingInstrumentation = new Sentry.Native.ReactNavigationInstrumentation();
Sentry.init({
  dsn: SENTRY_DSN,
  enableInExpoDevelopment: SENTRY_ENABLE_IN_DEV,
  debug: SENTRY_DEBUG,
  environment: process.env.NODE_ENV,
  tracesSampleRate: 0.2,
  integrations: [
    new Sentry.Native.ReactNativeTracing({
      routingInstrumentation,
    }),
  ],
});


I have following issue:

Upgrading to version 5.0.0-alpha.4 or 4.5.0 makes the app crash

Steps to reproduce:

  • Install Sentry
  • Make the App Crash

Actual result:

FATAL EXCEPTION: mqt_native_modules
Process: com.company.myapp, PID: 13737
com.facebook.react.bridge.NativeArgumentsParseException: RNSentry.captureEnvelope got 3 arguments, expected 4
       at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:349)
       at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
       at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
       at android.os.Looper.loop(Looper.java:223)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
       at java.lang.Thread.run(Thread.java:923)

Expected result:

  • Sentry does not crash
@krystofwoldrich
Copy link
Member

krystofwoldrich commented Sep 29, 2022

Hi, we made a change in our native layer (#2463) and this error happens, when the native layer is not rebuild after the upgrade.

Clean build should solve this. Let me know if it helped.

@pdavid0
Copy link
Author

pdavid0 commented Sep 29, 2022

@krystofwoldrich thanks, it seems to work in debug mode, but the error first came through a CI build, which should be clean by default.

@pdavid0
Copy link
Author

pdavid0 commented Sep 29, 2022

Spoke too soon, a clean build with version 5.0.0-alpha.4 still crashes in debug.

@pdavid0
Copy link
Author

pdavid0 commented Sep 29, 2022

downgrading to alpha.3 and cleaning the build works.

cd android && ./gradlew clean && cd ..
yarn react-native run-android

@krystofwoldrich
Copy link
Member

I have suspicion that when you upgrade the native java code doesn't get recompiled. That would explained why downgrading to alpha.3 works, because it uses the older native code.

@krystofwoldrich
Copy link
Member

If the problem persist could you share a repo or send sample which doesn't build, so I can try to reproduce it?

@pdavid0
Copy link
Author

pdavid0 commented Sep 29, 2022

If the problem persist could you share a repo or send sample which doesn't build, so I can try to reproduce it?

Will do!

If I can't make it work by tomorrow .. it will probably have to wait until Monday.

I've looked at the code it downloads locally for alpha.4

// build.gradle
dependencies {
    implementation 'com.facebook.react:react-native:+'
    api 'io.sentry:sentry-android:6.4.2'
}
    // RNSentryModule.java
    @ReactMethod
    public void captureEnvelope(ReadableArray rawBytes, ReadableMap options, Promise promise) {

So im not sure where's the issue

@marandaneto marandaneto moved this from Needs Discussion to Needs More Information in [DEPRECATED] Mobile SDKs Sep 30, 2022
@marandaneto
Copy link
Contributor

@pdavid0 likely a cache issue, clean node_modules and clean caches, we have tests running on CI so I don't think this is a bug at all.

@krystofwoldrich
Copy link
Member

#2505 (comment) the code here is correct, but based on the error your app is not running it.

@pdavid0
Copy link
Author

pdavid0 commented Oct 3, 2022

Closing as I couldn't reproduce in a clean App ...

Thanks for the support

@pdavid0 pdavid0 closed this as completed Oct 3, 2022
Repository owner moved this from Needs More Information to Done in [DEPRECATED] Mobile SDKs Oct 3, 2022
@CursedMun
Copy link

4.6.0 have this issue on app launch

@krystofwoldrich
Copy link
Member

4.6.0 have this issue on app launch

Hi, make sure you do a clean build since this is caused by using a cached native layer build from previous versions.

@CursedMun
Copy link

CursedMun commented Oct 6, 2022

4.6.0 have this issue on app launch

Hi, make sure you do a clean build since this is caused by using a cached native layer build from previous versions.

This happened on production build eas build --profile production --platform android is there any argument to run a clean build?

@krystofwoldrich
Copy link
Member

You can try --clear-cache, docs, but I personally don't use expo so, I don't know.

I clean the build using Android Studio and Xcode.

@JeremyBradshaw7
Copy link

JeremyBradshaw7 commented Mar 28, 2024

I'm having this also. Cleaning doesn't seem to help. Not using expo though. Crashing on startup on android 14.

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

No branches or pull requests

5 participants