Skip to content

Fix #358#360

Closed
ccarmox wants to merge 2 commits intogoogle:mainfrom
ccarmox:fix-#358
Closed

Fix #358#360
ccarmox wants to merge 2 commits intogoogle:mainfrom
ccarmox:fix-#358

Conversation

@ccarmox
Copy link

@ccarmox ccarmox commented Dec 12, 2025

The path where the "third_party_license_metadata" and "third_party_licenses" files are stored has been changed from "raw" to "res/raw" to make it accessible from the application, fixing bug #358

@google-cla
Copy link

google-cla bot commented Dec 12, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@timothyfroehlich
Copy link
Member

Thank you for looking into this and submitting a fix!

However, this PR should not be merged because the current implementation in main is actually correct due to a recent architectural change in the plugin.

The oss-licenses-plugin was recently updated to use the modern AGP Variant API for generating resources. When using variant.sources.res.addGeneratedSourceDirectory, AGP treats the provided output directory as a res root.

Therefore, any task generating resources must mimic the standard Android res folder structure directly inside that root directory. By creating the raw folder directly (e.g., generated_dir/raw/), AGP correctly identifies it as a raw resource type and packages it.

If we were to apply this PR, the path would become generated_dir/res/raw/. AGP would see a top-level folder named res, which is not a valid Android resource type (like values, layout, or raw), and would silently fail to package the licenses, breaking the plugin for everyone using modern AGP versions.

The bug reported in #358 was likely caused by an incomplete migration or temporary instability in version 0.10.8, but the underlying directory structure logic currently in main is correct for the new Variant API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants