question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Gradle Configuration Failing when Applying Plugin to JVM only project

See original GitHub issue

When applying the plugin to a kotlin jvm project configuration of the project fails with the following.

> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find com.android.tools.build:gradle:3.3.0.
     Searched in the following locations:
       - file:/Users/areitz/.gradle/caches/5.5-rc-2/embedded-kotlin-repo-1.3.31-3/repo/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.jar
       - https://plugins.gradle.org/m2/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.pom
       - https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.pom
       - https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.jar
       - https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.pom
       - https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.jar
     Required by:
         project : > com.squareup.sqldelight:gradle-plugin:1.1.3

I believe the issue is that the plugin depends on the android build tools to be present, even when not applicable for the project the plugin is being applied to.

Adding the google() repository for plugin management solves the issue, but I think maybe a better solution would be to have the android build tools be an optional dependency.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
JakeWhartoncommented, Jun 26, 2020

I am officially licking this cookie. Progress has been made and I just need to get all the tests updated.

1reaction
JakeWhartoncommented, Jul 28, 2020

I have sent a PR to make the AGP dependency optional, but in the time since we started using SparseArray from androidx.collection which requires the google() repository. That can be fixed separately. Feel free to send a PR since I’m burned out on the compileOnly change for a few days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gradle Configuration Failing when Applying Plugin to JVM only ...
When applying the plugin to a kotlin jvm project configuration of the project fails with the following. > Could not resolve all artifacts...
Read more >
Failed to apply plugin [id 'com.android.application']
Workaround: · Close android studio · right click and rename the project name without using paste, instead type it. · When you open...
Read more >
Opening build.gradle as a project fails with "Gradle JVM ...
I'm using IntelliJ IDEA 2018.2.7 (Community Edition)Build #IC-182.5107.41, built on November 26, 2018JRE: 1.8.0_152-release-1248-b22...
Read more >
The Application Plugin - Gradle User Manual
The Application plugin facilitates creating an executable JVM application. It makes it easy to start the application locally during development, ...
Read more >
Troubleshooting builds - Gradle User Manual
If your Gradle build fails before running any tasks, you may be encountering problems with your network configuration. When Gradle is unable to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found