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

dependencies still missing with com.google.android.gms.oss-licenses-plugin:0.10.1 #119

Closed
hnljp opened this issue Jan 13, 2020 · 14 comments · Fixed by #128
Closed

dependencies still missing with com.google.android.gms.oss-licenses-plugin:0.10.1 #119

hnljp opened this issue Jan 13, 2020 · 14 comments · Fixed by #128

Comments

@hnljp
Copy link

hnljp commented Jan 13, 2020

Describe the bug
Like with com.google.android.gms:oss-licenses-plugin:0.10.0, com.google.android.gms:oss-licenses-plugin:0.10.1 is still thinking that the app does not have any open source licenses.
Using com.android.tools.build:gradle:3.5.3 (same problem with 3.5.1), gradle 6.0.1 (same problem with 5.6.0).

To Reproduce
Apply any dependency. And try to build.

Expected behavior
Three files should get generated by the oss-licenses-plugin, containing all the information needed:
app/build/generated/third_party_licenses/res/dependencies.json
app/build/generated/third_party_licenses/res/raw/third_party_license_metadata
app/build/generated/third_party_licenses/res/raw/third_party_licenses

But the problem is that the two files are generated blank:
app/build/generated/third_party_licenses/res/raw/third_party_license_metadata
app/build/generated/third_party_licenses/res/raw/third_party_licenses

And the third file gets generated as an empty array:
`[

]`
app/build/generated/third_party_licenses/res/dependencies.json

Screenshots
Screenshot 2020-01-13 at 22 40 08

Desktop (please complete the following information):

  • Gradle version: 6.0.1 (same problem with 5.6.0)
  • Android Studio version [e.g. 3.1 (stable)]: 3.5.3
  • Plugin name and version [e.g. OSS Licenses 16.0.0]: com.google.android.gms.oss-licenses-plugin:0.10.1

Additional context
A full list of licenses was generated with com.google.android.gms.oss-licenses-plugin:0.9.5
In case it makes a difference, this is on macOS 10.14.6 but I have also tested on Ubuntu 16.4 with the same result.
And also an extra information, I have tried to delete the third_party_libraries directory, to make sure that it is getting recreated and it is. It is still producing the empty files as described above.

@jkasnicki
Copy link
Collaborator

Can you attach your build.gradle files or a repro test project.

@hnljp
Copy link
Author

hnljp commented Jan 13, 2020

I just tried to reproduce the problem and the thing that broke the gradle plugin was when I added a library module to the project and added it to the app gradle file.
implementation project(':mylibrary')
Until then everything was working fine, but when adding the library module it resulted in the empty list and blank third_party_licenses and third_party_license_metadata files.

Screenshot 2020-01-13 at 23 42 51

Returning to 0.9.5 and that part is working.

@hnljp
Copy link
Author

hnljp commented Jan 13, 2020

My Application.zip
a simple project, where I have added an Android Library module.

@firefinchdev
Copy link

+1
I am having the same issue. When upgrading from 0.9.5 to 0.10.1, I face similar issue as @hnljp mentioned.

@hnljp
Copy link
Author

hnljp commented Jan 14, 2020

+1
I am having the same issue. When upgrading from 0.9.5 to 0.10.1, I face similar issue as @hnljp mentioned.
@firefinchdev
Do you also have a library module in your project?

@firefinchdev
Copy link

Yes, multiple library modules, and my app module depends on them (implementation). None of my library modules' dependencies are listed in oss-license activity.

@hnljp
Copy link
Author

hnljp commented Jan 14, 2020

Related issues
#105
#120

@hnljp
Copy link
Author

hnljp commented Jan 21, 2020

@jkasnicki
I found the reason for this bug and a possible temporary workaround until it is fixed.

The reason for the problem:
49ac4b4#diff-204bda43e6b03d7ab1af29e3774a40ae

How to temporary work around the bug
if you have 3 different product flavors 'alfa', 'bravo' and 'charlie' and two different module 'yankee' and 'zulu'...
change from

implementation project(':yankee')
implementation project(':zulu')

to

alfaImplementation project(':yankee')
bravoImplementation project(':yankee')
charlieImplementation project(':yankee')
alfaImplementation project(':zulu')
bravoImplementation project(':zulu')
charlieImplementation project(':zulu')

@hnljp
Copy link
Author

hnljp commented Jan 21, 2020

#87

@jackyhieu1211-hn
Copy link

@hnljp I have the same problem. I have fixed it as your guide. and it worked fine.

@alwa
Copy link

alwa commented Mar 6, 2020

@jkasnicki
I found the reason for this bug and a possible temporary workaround until it is fixed.

The reason for the problem:
49ac4b4#diff-204bda43e6b03d7ab1af29e3774a40ae

How to temporary work around the bug
if you have 3 different product flavors 'alfa', 'bravo' and 'charlie' and two different module 'yankee' and 'zulu'...
change from

implementation project(':yankee')
implementation project(':zulu')

to

alfaImplementation project(':yankee')
bravoImplementation project(':yankee')
charlieImplementation project(':yankee')
alfaImplementation project(':zulu')
bravoImplementation project(':zulu')
charlieImplementation project(':zulu')

I don't use product flavors and declaring dependencies as

debugImplementation / releaseImplementation doesn't help.

My setup:

  • com.android.tools.build:gradle:3.6.1
  • com.google.android.gms:oss-licenses-plugin:0.10.1

@caller9
Copy link
Collaborator

caller9 commented Mar 9, 2020

This was released in version 0.10.2.
https://developers.google.com/android/guides/releases#march_09_2020

@alwa
Copy link

alwa commented Mar 9, 2020

I can confirm that 0.10.2 solved my problem

@hnljp
Copy link
Author

hnljp commented Mar 9, 2020

also verified here.

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 a pull request may close this issue.

6 participants