google / google/play-services-plugins

OSS Licenses Plugin causes build issue due to androidx.annotation

Open
#179 0 comments 0 reactions 0 assignees View on GitHub
oss-licenses
Dominant language
Kotlin
Stars
526
Forks
167
Avg merge
7d 21h
Merged PRs (30d)
2

Description

**Describe the bug**
When `com.google.android.gms.oss-licenses-plugin` is applied on module's build.gradle file, I get this error when I am trying to build:

```
Execution failed for task :app:getDependencies.
Could not find annotation-1.0.0.jar (androidx.annotation:annotation:1.0.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/annotation/annotation/1.0.0/annotation-1.0.0.jar
```

I have to note that the link listed in the error actually works for me so I am unsure why Gradle has issues with it. Other than removing the plugin, the only way I could build my app was to add this line to my module's build.gradle:

> api 'androidx.annotation:annotation:1.2.0'

Adding v1.0.0 has no effect on the issue even though the error says it looks for 1.0.0, both 1.1.0 and 1.2.0 fix the issue

**To Reproduce**
Steps to reproduce the behavior:
1. Add OSS licenses library to your project
2. Build the app

**Expected behavior**
The project should successfully build without needing to add an `api` to the module's builld.gradle file.

**Desktop (please complete the following information):**
- Gradle version: [6.7.1]
- Android Studio version [4.2.1 (stable)]:
- Plugin name and version [OSS Licenses 17.0.0]:

**Additional context**
I did try re-cloning the repository tons of times and with different Gradle versions. None seemed to help. I also do not have any issues with my other projects. I also should mention that my windows install is fresh so maybe that has to do something with it since I had no issues building the project before this windows reinstall.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.