This message was deleted.
# community-support
s
This message was deleted.
j
To understand what's going on I usually compare the dependency graphs of both versions. When you run with "--scan" you can check through the dependencies in the build scan. Gradle Enterprise has a very nice comaparision feature for that but unfortunately that's not available in the public Build Scan version. What I do as alternative is running the dependencies task and write that to a file and then do a comparison of the text files (IDEA is doing this very well). For example:
Copy code
./gradlew :app:dependencies -q --configuration=runtimeCLasspath > gradle7-deps.txt
In general, if you move away from "compile", I can recommend using the dependency analysis plugin: https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin I give an overview of that here:

https://youtu.be/Lipf5piizZc

a
Many thanks for the feedback, Jendrik.
a
Reposting with "Also send to # community-support " option checked. Deleted my earlier duplicate message in the thread. I am trying to upgrade a multimodule project (with several hundred subprojects) from Gradle 6.6 to 7.6. I tried taking help from IntelliJ IDEA's inspection feature to find out deprecated api/configuration usages. But it seems IDEA could only recognize compile -> implementation migration. Once I applied IDEA's suggestion, all
compile
configurations got changed to
implementation
. But I found no usage of api configuration whatsoever. As a result of this my build keeps failing everytime unless I change all transitive dependencies' declarations to use api configuration. Initialy I did try to look out for any such plugins but couldn't find one. Literally no mention of this plugin in the search result when I queried for "plugin to convert from implementation to api, gradle". I then went about doing it by hand but soon realised this wasn't a feasible option give the size of the project that I am dealing with. Luckily enough, I thought of searching in this slack channel and came acrosss this thread. I tried to use this plugin and could see its tasks listed upon running
gradlew tasks
. But since all my projects are having only implementation configurations, whenever I try to run
projectHealth
or
buildHealth
task the build fails everytime complaining about "package xyz not found" as its unable to resolve the classes because they happen to be coming from transitive dependencies. This is where I am confused as to how then will the plugin be able to identify the issues with transitive depdencies that are wrongly declared as implementation, if my build keeps failing with "package not found found error". I am now not sure how to best use this plugin to help me with my upgrade. Any help or guidance is greatly apreciated.
t
Declare them all as
api
then use the plugin recommended above by Jendrik, it will tell you which ones you can put back to
implementation
❤️ 2
a
Thank you so much @Thomas Broyer. I'll defintely give it a try. Will share the status.
a
I’m getting
Copy code
➜  ir-csa git:(CLOUD-3831) ✗ ./gradlew buildHealth -Dorg.gradle.java.home=/Users/anwarparker/Library/Java/JavaVirtualMachines/corretto-11.0.15/Contents/Home 
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details
Configuration on demand is an incubating feature.

> Configure project :
Parallel forks:6

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'ir-csa'.
> Failed to apply plugin 'com.autonomousapps.dependency-analysis'.
   > Cannot run Project.afterEvaluate(Action) when the project is already evaluated.

* 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>

BUILD FAILED in 26s
I managed to get the plugin to work. There were some false recommendations specifically where
Unused dependencies which should be removed
were mentioned. Removing the “unused” dependencies would result in a build failure due to missing packages.
j
If you can isolate these "false recommendations" into a reproducer that would be great.