You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I spent a few hours chasing this bug by trial and error. It turns out to be an edge case and can be worked around. Couldn't find any related results in search engines. Hope it can help someone who sees similar error.
Describe the bug
bugsnag-android-gradle-plugin crashes (in BugsnagInstallJniLibsTask) when a react-native project:
has externalNativeBuild defined AND
has another plugin that injects tasks.whenTaskAdded into gradle script. In my case, the react-native-config.
Error message is quite confusing:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/jiulongw/tmp/AwesomeProject/node_modules/@bugsnag/react-native/android/build.gradle' line: 16
* What went wrong:
A problem occurred evaluating project ':bugsnag_react-native'.
> Failed to apply plugin 'com.android.internal.library'.
> Project#afterEvaluate(Action) on project ':bugsnag_react-native' cannot be executed in the current context.
From stack trace it seems to be related to JNI tasks:
at com.bugsnag.android.gradle.BugsnagInstallJniLibsTask$Companion.resolveBugsnagArtifacts$bugsnag_android_gradle_plugin(BugsnagInstallJniLibsTask.kt:70)
at com.bugsnag.android.gradle.BugsnagPlugin$registerNdkLibInstallTask$ndkSetupTask$1.invoke(BugsnagPlugin.kt:131)
at com.bugsnag.android.gradle.BugsnagPlugin$registerNdkLibInstallTask$ndkSetupTask$1.invoke(BugsnagPlugin.kt:60)
For me, the work around is to simply remove the entire tasks.whenTaskAdded block in react-native-config's dotenv.gradle plugin which I don't need anyway...
Hope gradle expert and find the root cause and fix the problem.
Steps to reproduce
I have create a repo bugsnag-plugin-issue-repro which is a clean project created by npx react-native init, installed bugsnag plugin by npx @bugsnag/react-native-cli init. This is the commit that triggers the crash.
I spent a few hours chasing this bug by trial and error. It turns out to be an edge case and can be worked around. Couldn't find any related results in search engines. Hope it can help someone who sees similar error.
Describe the bug
bugsnag-android-gradle-plugin crashes (in
BugsnagInstallJniLibsTask
) when a react-native project:externalNativeBuild
defined ANDtasks.whenTaskAdded
into gradle script. In my case, the react-native-config.Error message is quite confusing:
From stack trace it seems to be related to JNI tasks:
For me, the work around is to simply remove the entire
tasks.whenTaskAdded
block inreact-native-config
'sdotenv.gradle
plugin which I don't need anyway...Hope gradle expert and find the root cause and fix the problem.
Steps to reproduce
I have create a repo bugsnag-plugin-issue-repro which is a clean project created by
npx react-native init
, installed bugsnag plugin bynpx @bugsnag/react-native-cli init
. This is the commit that triggers the crash.npm install
cd android && ./gradlew assemble
Environment
The text was updated successfully, but these errors were encountered: