-
Notifications
You must be signed in to change notification settings - Fork 97
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
Plugin won't work with Android multimodule project #199
Comments
These issues are hard to debug since the gradle warning is very specific but not very helpful. I had this with some newer versions of the plugin. Does it fix anything to explicitly request android specific configs in the licenseReport block for all modules?
|
In case it's helpful, here's how I worked around this issue with a React Native project:
|
Hello In case a project having submodules the plugin fails as identified by this open bug . Example in build the build.gradle file we have as below- Also any hint, how it can be fixed. Would be glad to know about it. |
Possible fix here : |
@brsaylor2 do you remember on which gradle version you were ? it's not working for me on 6.7 with |
@maxaggedon I think it was 6.2. The
Relevant docs: |
Thanks a lot @brsaylor2 for you detailed reply ! I managed to make it work also on gradle 6.7. My problem was with |
is there any update on this i still have the same problem using gradle 7.6 and agp 7.2.2 or gradle 8 and agp . |
This seems to work for the current android plugin: https://github.com/jaredsburrows/gradle-license-plugin |
I created a minimum reproducible example here: https://github.com/tfcporciuncula/dependency-license-report-android
It's basically a blank new project with an extra library module. It was created on Android Studio 4.1.1 with Android Gradle Plugin 4.1.1. It's using Gradle 6.5, which is the default version for a new Android project right now with AS 4.1.1, but the same error happens on Gradle 6.7.1 -- there's a separate branch with Gradle updated.
I have a regular
app
module and a separatelib
module which is a dependency ofapp
. This is the error I get when running./gradlew generateLicenseReport
:This is the exception output when I run with
--stacktrace
:I've tried different
configurations
value (releaseRuntimeClasspath
,debugRuntimeClasspath
,releaseCompileClasspath
,debugCompileClasspath
) but they all lead to the same error. If I don't set a value forconfigurations
or go with the default value (runtimeClasspath
), there's no error but the report is empty. There's basically two ways to make the plugin work:lib
fromapp
as a dependency (which wouldn't make sense in a real project).implementation project(':lib')
toimplementation project(path: ':lib', configuration: 'default')
.I'm not a Gradle expert, so I'm honestly not sure what's the implication of passing a
default
configuration
there, but I'd hope there's a way for the plugin to work without the need for that change. I decided to try this after reading this other issue, but I thought it would make sense to open a separate and more specific issue about this.The text was updated successfully, but these errors were encountered: