sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

Circular dependency between compileReleaseJavaWithJavac and generateSentryProguardUuidRelease

Open abdullRahman95 opened this issue 1 year ago • 25 comments
trafficstars

OS:

  • [ #] Windows

Platform:

  • [ #] Android

SDK:

  • [ #] @sentry/react-native (>= 1.0.0)

SDK version: 5.17.0

react-native version: 0.67.5

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:

[Link to issue]

Configuration:

(@sentry/react-native)

Sentry.init({
  dsn: 'https://[email protected]/...'
  // other options
});

I have the following issue:

When I upgraded "@sentry/react-native" from 5.13.0 to 5.17.0, and was trying to create a release build for android (react-native), I'm getting the following error:

2024-02-29T06:45:09.3477590Z * What went wrong:
2024-02-29T06:45:09.3478140Z Circular dependency between the following tasks:
2024-02-29T06:45:09.3478700Z :app:compileReleaseJavaWithJavac
2024-02-29T06:45:09.3479500Z +--- :app:compileReleaseKotlin
2024-02-29T06:45:09.3480220Z |    +--- :app:dataBindingGenBaseClassesRelease
2024-02-29T06:45:09.3482330Z |    |    \--- :app:mergeReleaseResources
2024-02-29T06:45:09.3483210Z |    |         \--- :app:copyReleaseBundledJs
2024-02-29T06:45:09.3487450Z |    |              \--- :app:mergeReleaseAssets
2024-02-29T06:45:09.3492570Z |    |                   \--- :app:generateSentryDebugMetaPropertiesRelease
2024-02-29T06:45:09.3497810Z |    |                        \--- :app:generateSentryProguardUuidRelease
2024-02-29T06:45:09.3498770Z |    |                             \--- :app:minifyReleaseWithR8
2024-02-29T06:45:09.3499570Z |    |                                  +--- :app:mergeReleaseGeneratedProguardFiles
2024-02-29T06:45:09.3500360Z |    |                                  |    +--- :app:compileReleaseJavaWithJavac (*)
2024-02-29T06:45:09.3501380Z |    |                                  |    +--- :app:compileReleaseKotlin (*)
2024-02-29T06:45:09.3502170Z |    |                                  |    \--- :app:processReleaseResources
2024-02-29T06:45:09.3504020Z |    |                                  |         \--- :app:mergeReleaseResources (*)
2024-02-29T06:45:09.3505840Z |    |                                  +--- :app:mergeReleaseJavaResource
2024-02-29T06:45:09.3506650Z |    |                                  |    \--- :app:compileReleaseKotlin (*)
2024-02-29T06:45:09.3509170Z |    |                                  +--- :app:processReleaseResources (*)
2024-02-29T06:45:09.3509980Z |    |                                  \--- :app:transformReleaseClassesWithAsm
2024-02-29T06:45:09.3511070Z |    |                                       +--- :app:compileReleaseJavaWithJavac (*)
2024-02-29T06:45:09.3511900Z |    |                                       +--- :app:compileReleaseKotlin (*)
2024-02-29T06:45:09.3512800Z |    |                                       \--- :app:processReleaseResources (*)
2024-02-29T06:45:09.3519560Z |    \--- :app:processReleaseResources (*)
2024-02-29T06:45:09.3520290Z +--- :app:dataBindingGenBaseClassesRelease (*)
2024-02-29T06:45:09.3521790Z \--- :app:processReleaseResources (*)

I tried to update sentryGradlePluginVersion in android\build.gradle file to 4.3.1 as specified in the documentation (https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/#android, https://mvnrepository.com/artifact/io.sentry/sentry-android-gradle-plugin) but no luck, could you please help on this?

abdullRahman95 avatar Feb 29 '24 12:02 abdullRahman95

Hi @abdullRahman95, thank you for the message, can you try to upgrade to the latest https://github.com/getsentry/sentry-react-native/releases/tag/5.19.1 with the Sentry Android Plugin 4.3.1 and let us know if the issue still occurs?

krystofwoldrich avatar Feb 29 '24 16:02 krystofwoldrich

Hi @krystofwoldrich Thank you for checking this issue, I have upgraded @sentry/react-native to 5.19.1 with Android Plugin 4.3.1, and same issue still happening with the following error:


FAILURE: Build failed with an exception.

* What went wrong:
Circular dependency between the following tasks:
:app:compileReleaseJavaWithJavac
+--- :app:compileReleaseKotlin
|    +--- :app:dataBindingGenBaseClassesRelease
|    |    \--- :app:mergeReleaseResources
|    |         \--- :app:copyReleaseBundledJs
|    |              \--- :app:mergeReleaseAssets
|    |                   \--- :app:generateSentryDebugMetaPropertiesRelease
|    |                        \--- :app:generateSentryProguardUuidRelease
|    |                             \--- :app:minifyReleaseWithR8
|    |                                  +--- :app:mergeReleaseGeneratedProguardFiles
|    |                                  |    +--- :app:compileReleaseJavaWithJavac (*)
|    |                                  |    +--- :app:compileReleaseKotlin (*)
|    |                                  |    \--- :app:processReleaseResources
|    |                                  |         \--- :app:mergeReleaseResources (*)
|    |                                  +--- :app:mergeReleaseJavaResource
|    |                                  |    \--- :app:compileReleaseKotlin (*)
|    |                                  +--- :app:processReleaseResources (*)
|    |                                  \--- :app:transformReleaseClassesWithAsm
|    |                                       +--- :app:compileReleaseJavaWithJavac (*)
|    |                                       +--- :app:compileReleaseKotlin (*)
|    |                                       \--- :app:processReleaseResources (*)
|    \--- :app:processReleaseResources (*)
+--- :app:dataBindingGenBaseClassesRelease (*)
\--- :app:processReleaseResources (*)

(*) - details omitted (listed previously)


* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 10s

abdullRahman95 avatar Mar 06 '24 15:03 abdullRahman95

I´m having the same error with the sentry-android-gradle-plugin in Flutter

Ch4rl3B avatar Mar 06 '24 16:03 Ch4rl3B

Thank you for the update @Ch4rl3B and @abdullRahman95,

we are currently unable to reproduce this,

would you be able to share a minimal reproducible example?

Can you also share your Sentry Android Gradle Plugin configuration?

krystofwoldrich avatar Mar 07 '24 13:03 krystofwoldrich

@markushi @romtsn Do you have any tips on how to debug this?

krystofwoldrich avatar Mar 07 '24 13:03 krystofwoldrich

I started looking into this and so far couldn't reproduce this issue. @Ch4rl3B @abdullRahman95 could you share some more details about your build environment?

  • AGP version
  • Gradle version
  • Are you using DexGuard?

markushi avatar Mar 18 '24 15:03 markushi

Hi I have the same issue with sentry-android-gradle-plugin. Maybe my context would be helpful

  • com.android.tools.build:gradle:8.3.0
  • io.sentry.android.gradle:4.3.1
  • I'm not using DexGuard
  • Issue happens on both local and Codemagic buid

Karjan1 avatar Mar 24 '24 13:03 Karjan1

@Karjan1 Thank you, we'll keep you posted.

krystofwoldrich avatar Mar 25 '24 10:03 krystofwoldrich

Hey @Karjan1, we just released io.sentry.android.gradle:4.4.0 which contains a fix to a very similar issue. Could you give it a try?

markushi avatar Mar 26 '24 12:03 markushi

No still getting the same error. One thing that I found surprising is flutter build appbundle --release gives that error but flutter build appbundle --debug works fine

Karjan1 avatar Mar 26 '24 19:03 Karjan1

Hi @Karjan1 - We are still facing the same problem with same stack trace with AGP 4.4.0

2024-03-27T05:55:14.1937370Z FAILURE: Build failed with an exception.
2024-03-27T05:55:14.1938000Z 
2024-03-27T05:55:14.1938710Z * What went wrong:
2024-03-27T05:55:14.1939320Z Circular dependency between the following tasks:
2024-03-27T05:55:14.1939980Z :app:compileReleaseJavaWithJavac
2024-03-27T05:55:14.1941120Z +--- :app:compileReleaseKotlin
2024-03-27T05:55:14.1941970Z |    +--- :app:dataBindingGenBaseClassesRelease
2024-03-27T05:55:14.1942750Z |    |    \--- :app:mergeReleaseResources
2024-03-27T05:55:14.1985040Z |    |         \--- :app:copyReleaseBundledJs
2024-03-27T05:55:14.1999580Z |    |              \--- :app:mergeReleaseAssets
2024-03-27T05:55:14.2000520Z |    |                   \--- :app:generateSentryDebugMetaPropertiesRelease
2024-03-27T05:55:14.2000970Z |    |                        \--- :app:generateSentryProguardUuidRelease
2024-03-27T05:55:14.2001380Z |    |                             \--- :app:minifyReleaseWithR8
2024-03-27T05:55:14.2001840Z |    |                                  +--- :app:mergeReleaseGeneratedProguardFiles
2024-03-27T05:55:14.2002300Z |    |                                  |    +--- :app:compileReleaseJavaWithJavac (*)
2024-03-27T05:55:14.2002720Z |    |                                  |    +--- :app:compileReleaseKotlin (*)
2024-03-27T05:55:14.2003130Z |    |                                  |    \--- :app:processReleaseResources
2024-03-27T05:55:14.2003530Z |    |                                  |         \--- :app:mergeReleaseResources (*)
2024-03-27T05:55:14.2004100Z |    |                                  +--- :app:mergeReleaseJavaResource
2024-03-27T05:55:14.2004510Z |    |                                  |    \--- :app:compileReleaseKotlin (*)
2024-03-27T05:55:14.2004950Z |    |                                  +--- :app:processReleaseResources (*)
2024-03-27T05:55:14.2005370Z |    |                                  \--- :app:transformReleaseClassesWithAsm
2024-03-27T05:55:14.2005790Z |    |                                       +--- :app:compileReleaseJavaWithJavac (*)
2024-03-27T05:55:14.2006210Z |    |                                       +--- :app:compileReleaseKotlin (*)
2024-03-27T05:55:14.2006610Z |    |                                       \--- :app:processReleaseResources (*)
2024-03-27T05:55:14.2006920Z |    \--- :app:processReleaseResources (*)
2024-03-27T05:55:14.2007290Z +--- :app:dataBindingGenBaseClassesRelease (*)
2024-03-27T05:55:14.2008740Z \--- :app:processReleaseResources (*)
2024-03-27T05:55:14.2008840Z 
2024-03-27T05:55:14.2010280Z (*) - details omitted (listed previously)

daniel-johns-99 avatar Mar 27 '24 06:03 daniel-johns-99

I gave other versions a try. io.sentry.android.gradle:4.2.0 is the last version that works. Both 4.3.0 and 4.4.0 give the same error

Karjan1 avatar Mar 27 '24 07:03 Karjan1

Quick update: I was finally able to locally reproduce this issue, at least for flutter. But it looks like the same issue we have on RN, namely the mergeReleaseAssets tasks being rewired by Flutter/RN which then causes our Sentry Android Gradle plugin to fail.

Circular dependency between the following tasks:
:app:compileReleaseJavaWithJavac
+--- :app:compileReleaseKotlin
|    \--- :app:processReleaseResources
|         \--- :app:copyFlutterAssetsRelease
|              \--- :app:mergeReleaseAssets
|                   \--- :app:generateSentryDebugMetaPropertiesRelease
|                        \--- :app:generateSentryProguardUuidRelease
|                             \--- :app:minifyReleaseWithR8
|                                  +--- :app:mergeReleaseGeneratedProguardFiles
|                                  |    +--- :app:compileReleaseJavaWithJavac (*)
|                                  |    +--- :app:compileReleaseKotlin (*)
|                                  |    \--- :app:processReleaseResources (*)
|                                  +--- :app:mergeReleaseJavaResource
|                                  |    \--- :app:compileReleaseKotlin (*)
|                                  +--- :app:processReleaseResources (*)
|                                  \--- :app:transformReleaseClassesWithAsm
|                                       +--- :app:compileReleaseJavaWithJavac (*)
|                                       +--- :app:compileReleaseKotlin (*)
|                                       \--- :app:processReleaseResources (*)
\--- :app:processReleaseResources (*)

I'll keep you posted about any updates!

markushi avatar Mar 27 '24 08:03 markushi

@Karjan1 we shipped a fix for this in io.sentry.android.gradle:4.4.1, would you mind giving it a try?

markushi avatar Apr 16 '24 12:04 markushi

Circular dependency between the following tasks: :app:processReleaseResources --- :app:processReleaseResources (*)

How to resolve this

subramani48 avatar May 03 '24 11:05 subramani48

I started looking into this and so far couldn't reproduce this issue. @Ch4rl3B @abdullRahman95 could you share some more details about your build environment?

  • AGP version
  • Gradle version
  • Are you using DexGuard?

Hey, how do you enable dexguardEnabled flag for expo/sentry-react-native?

Lucienzera avatar May 15 '24 08:05 Lucienzera

@markushi I'm facing a similar problem following the documentation, once I reach this point: https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/#enable-sentry-agp and that's applying the plugin

apply plugin: "io.sentry.android.gradle"

I start getting a circular dependency when building a release app

:app:compileStagingReleaseJavaWithJavac
\--- :app:processStagingReleaseResources
     +--- :app:mapStagingReleaseSourceSetPaths
     |    \--- :app:mergeStagingReleaseResources
     |         \--- :app:copyStagingReleaseBundledJs
     |              \--- :app:mergeStagingReleaseAssets
     |                   \--- :app:generateSentryDebugMetaPropertiesStagingRelease
     |                        \--- :app:generateSentryProguardUuidStagingRelease
     |                             \--- :app:minifyStagingReleaseWithR8
     |                                  +--- :app:mergeStagingReleaseGeneratedProguardFiles
     |                                  |    +--- :app:compileStagingReleaseJavaWithJavac (*)
     |                                  |    \--- :app:processStagingReleaseResources (*)
     |                                  +--- :app:processStagingReleaseResources (*)
     |                                  \--- :app:transformStagingReleaseClassesWithAsm
     |                                       +--- :app:compileStagingReleaseJavaWithJavac (*)
     |                                       \--- :app:processStagingReleaseResources (*)
     \--- :app:mergeStagingReleaseResources (*)

"@sentry/react-native": "^5.22.2"

UPDATE I got it to build by downgrading the plugin in android/build.gradle from 4.6.0 to 4.2.0

dependencies {
     classpath 'io.sentry:sentry-android-gradle-plugin:4.2.0'
}

ys-sherzad avatar May 16 '24 14:05 ys-sherzad

Thank you everyone for the comment, we are reopening the issue and will investigate it.

krystofwoldrich avatar May 17 '24 08:05 krystofwoldrich

Is this still happening?

feinstein avatar Jul 30 '24 08:07 feinstein

We currently don't have any new reports of this issue, if you are experiencing this @feinstein, please share details of your setup, so we can reproduce it (or reproducible example).

krystofwoldrich avatar Jul 31 '24 13:07 krystofwoldrich

I can see this happening with the gradle plugin version set as id "io.sentry.android.gradle" version "4.10.0". Using the Flutter package.

feinstein avatar Aug 08 '24 01:08 feinstein

@krystofwoldrich I am still getting the same issue with 'classpath("io.sentry:sentry-android-gradle-plugin:4.11.0")' and "@sentry/react-native": "^5.28.0", in React Native.

What went wrong:

Circular dependency between the following tasks:

:app:compileReleaseJavaWithJavac
\--- :app:processReleaseResources
     +--- :app:mapReleaseSourceSetPaths
     |    \--- :app:mergeReleaseResources
     |         \--- :app:copyReleaseBundledJs
     |              \--- :app:mergeReleaseAssets
     |                   \--- :app:generateSentryDebugMetaPropertiesRelease
     |                        \--- :app:generateSentryProguardUuidRelease
     |                             \--- :app:minifyReleaseWithR8
     |                                  +--- :app:mergeReleaseGeneratedProguardFiles
     |                                  |    +--- :app:compileReleaseJavaWithJavac (*)
     |                                  |    \--- :app:processReleaseResources (*)
     |                                  +--- :app:processReleaseResources (*)
     |                                  \--- :app:transformReleaseClassesWithAsm
     |                                       +--- :app:compileReleaseJavaWithJavac (*)
     |                                       \--- :app:processReleaseResources (*)
     \--- :app:mergeReleaseResources (*)

Any solution for this? This is affecting my release.

IbrahimSheikh24 avatar Aug 14 '24 04:08 IbrahimSheikh24

Hi @IbrahimSheikh24, thank you for the message, we are currently unable to reproduce the error with our sample applications,

the workaround is to use lower version the Sentry Android Gradle Plugin, version 4.2.0, or disabling the plugin and only keep sentry.gradle to upload source maps.

If you would be able to provide minimal reproducible example that would help us debug the issue.

krystofwoldrich avatar Aug 16 '24 14:08 krystofwoldrich

Hi @IbrahimSheikh24, thank you for the message, we are currently unable to reproduce the error with our sample applications,

the workaround is to use lower version the Sentry Android Gradle Plugin, version 4.2.0, or disabling the plugin and only keep sentry.gradle to upload source maps.

If you would be able to provide minimal reproducible example that would help us debug the issue.

Hi @krystofwoldrich,

You can also reproduce by generating release build(also make minifyEnabled true and shrinkResources true) in Android, it will fail with the given error message. By making minifyEnabled false, release build will be successful.

IbrahimSheikh24 avatar Aug 17 '24 04:08 IbrahimSheikh24

Hi @IbrahimSheikh24 I've tried ./gradlew assembleRelease with minifyEnabled true and shrinkResources true, but sadly no circular issue occured.

krystofwoldrich avatar Aug 19 '24 13:08 krystofwoldrich