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

Upgraded project to React Native 0.56. Sentry build fails on Android "actual and formal argument lists differ in length" #490

Closed
2 of 5 tasks
peacechen opened this issue Oct 11, 2018 · 7 comments
Assignees

Comments

@peacechen
Copy link

peacechen commented Oct 11, 2018

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

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

v9.3.0
5.5.1
/Users/me
└── (empty)

Config:

Sentry.config('https://...@sentry.io/...' ).install()

I have following issue:

Building for Android returns this error:

Error:(53, 9) error: constructor RNSentryPackage in class RNSentryPackage cannot be applied to given types;
required: no arguments
found: MainApplication
reason: actual and formal argument lists differ in length

Steps to reproduce:
Upgrade project to React Native 0.56.1

MainApplication.java contains

        new RNNotificationsPackage(MainApplication.this),

Actual result:
Build error

Expected result:
Successful build

@peacechen
Copy link
Author

The RNSentryPackage class doesn't have a constructor:
https://github.com/getsentry/react-native-sentry/blob/master/android/src/main/java/io/sentry/RNSentryPackage.java#L14

Somehow either the updated versions of RN 0.56, Gradle 4.6, or Android SDK 28.x have removed default constructors. Not sure exactly what it is, but something involving constructors has changed.

@HazAT
Copy link
Member

HazAT commented Oct 18, 2018

This is actually a bug, I will release a new version tomorrow with a fix for this.

@HazAT HazAT self-assigned this Oct 18, 2018
@HazAT
Copy link
Member

HazAT commented Oct 19, 2018

@peacechen Can you try to upgrade to 0.39.1 and see if the error is gone?

@peacechen
Copy link
Author

Yes it's working great. Thanks @HazAT

@HazAT HazAT closed this as completed Oct 22, 2018
@cihati
Copy link

cihati commented Nov 14, 2018

@HazAT I am still having this issue:

> Task :app:compileDebugJavaWithJavac FAILED
/Users/cihat/fatlama/mobile/android/app/src/main/java/com/fat_lama/MainApplication.java:58: error: constructor RNSentryPackage in class RNSentryPackage cannot be applied to given types;
            new RNSentryPackage(MainApplication.this),
            ^
  required: no arguments
  found: MainApplication
  reason: actual and formal argument lists differ in length
Note: /Users/cihat/fatlama/mobile/android/app/src/main/java/com/fat_lama/MainApplication.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

I'm using React Native 0.57.5 and react-native-sentry 0.39.1

any ideas?

@peacechen
Copy link
Author

@cihati

Remove the argument and simply call

new RNSentryPackage() 

@cihati
Copy link

cihati commented Nov 14, 2018

Yes, this did solve the issue -- thanks @peacechen and @HazAT =)

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

3 participants