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

Circular dependency between compileReleaseJavaWithJavac and generateSentryProguardUuidRelease #3644

Open
2 tasks
abdullRahman95 opened this issue Feb 29, 2024 · 25 comments · Fixed by getsentry/sentry-android-gradle-plugin#682

Comments

@abdullRahman95
Copy link

abdullRahman95 commented Feb 29, 2024

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://...@sentry.io/...'
  // 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?

@krystofwoldrich
Copy link
Member

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?

@abdullRahman95
Copy link
Author

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

@Ch4rl3B
Copy link

Ch4rl3B commented Mar 6, 2024

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

@krystofwoldrich
Copy link
Member

krystofwoldrich commented Mar 7, 2024

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
Copy link
Member

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

@krystofwoldrich krystofwoldrich changed the title Release build error on Android is showing when upgrade "@sentry/react-native" from 5.13.0 to 5.17.0 Circular dependency between compileReleaseJavaWithJavac and generateSentryProguardUuidRelease Mar 8, 2024
@markushi markushi self-assigned this Mar 18, 2024
@markushi
Copy link
Member

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?

@Karjan1
Copy link

Karjan1 commented Mar 24, 2024

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

@krystofwoldrich
Copy link
Member

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

@markushi
Copy link
Member

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?

@Karjan1
Copy link

Karjan1 commented Mar 26, 2024

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

@daniel-johns-99
Copy link

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)

@Karjan1
Copy link

Karjan1 commented Mar 27, 2024

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

@markushi
Copy link
Member

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
Copy link
Member

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

@subramani48
Copy link

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

How to resolve this

@Lucienzera
Copy link

Lucienzera commented May 15, 2024

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?

@ys-sherzad
Copy link

ys-sherzad commented May 16, 2024

@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'
}

@krystofwoldrich
Copy link
Member

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

@feinstein
Copy link

Is this still happening?

@krystofwoldrich
Copy link
Member

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).

@feinstein
Copy link

feinstein commented Aug 8, 2024

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.

@IbrahimSheikh24
Copy link

IbrahimSheikh24 commented Aug 14, 2024

@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.

@krystofwoldrich
Copy link
Member

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.

@IbrahimSheikh24
Copy link

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.

@krystofwoldrich
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Status: No status
Status: Backlog