google/play-services-plugins

oss-licenses-plugin stopped displaying dependencies ("This app does not have any open source licenses")

Morrodin opened this issue · 1 comments

Describe the bug
oss-licenses-plugin seems to have stopped working at some point. I first installed it a year or so ago with plugin version 0.10.4 and dependency version 17.0.0, and know that the list worked at that point. However, checking today I saw that I was just getting an error message of "This app does not have any open source licenses". Our plugin version was at 0.10.4 still despite the dependency having been updated to 17.0.1 so I updated that to 0.10.6 but that didn't seem to have any effect.

To Reproduce
Steps to reproduce the behavior:

  1. Launch OssLicensesMenuActivity
  2. See error

Expected behavior
OSS/third party dependency information is shown.

Desktop (please complete the following information):

  • Gradle version: 7.3.1
  • Android Studio version [e.g. 3.1 (stable)]: Electric Eel | 2022.1.1
  • Plugin name and version [e.g. OSS Licenses 16.0.0]: OSS Licenses 0.10.6/17.0.1

Additional context
I've tried downgrading plugin and dependency versions in a few different combinations and didn't have any luck. The only other result I got was a header of "Debug License Info" and no error message, but the list was still empty.

EDIT: I did notice that I was never actually applying or referencing the plugin in my app level build.gradle. I can't seem to specify a plugins {} block there, receiving an error of only buildscript {}, pluginManagement {} and other plugins {} script blocks are allowed before plugins {} blocks, no other statements are allowed.

I am able to add apply plugin: 'com.google.android.gms.oss-licenses-plugin' and that gets me back to the Debug License Info header with an empty list.

I'm sure there's information I'm missing so please let me know what else I can supply.

Okay. I think the issue was just that my plugin version was behind, and I needed both 0.10.6 and 17.0.1. And then it looks like the dependencies will only show up in a release build? I used those versions and then made a release build and I seem to view the dependencies fine.

I could swear that when I first installed this I could view dependencies in debug builds just fine, but I could be misremembering, and I only need it to work in release builds, so alls well that ends well.