0

I am integrating Bugsnag into a React Native project. I want to ensure that any stack trace correctly references the right area of the code because due to needing to use a release app to get a stack trace, the source mappings are minified and therefore the method names and line numbers will not match my codebase. I have been following this page to set it up but when following the step to add the line: apply plugin: 'com.bugsnag.android.gradle' as the last line of app\android\build.gradle I get the following error when synching with Android Studio:

Error: Could not find method getPackageApplication() for arguments [] on object of type com.android.build.gradle.internal.api.ApplicationVariantImpl.

Until that point I was able to successfully integrate Bugsnag into my React Native project and link it to my Bugsnag account to see stack traces when my app crashes.

user1849060
  • 621
  • 3
  • 10
  • 20

1 Answers1

1

I was able to resolve this after talking to Bugsnag's support team. I was using Gradle 2.3.3 due to issues upgrading in the past. I tried to update and resolved my upgrading issues and no longer get this issue. However the Bugsnag entry within build.gradle was not recognised unless I placed the line I had an issue with at the top of the file rather than the bottom, as the instructions say.

user1849060
  • 621
  • 3
  • 10
  • 20