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.

Support for Android? Failed to apply plugin [id 'com.android.application']

See original GitHub issue

I am trying to applying to my kotlin supported project here: https://github.com/jaredsburrows/android-gif-example.

Versions:

  • com.android.tools.build:gradle:2.3.2
  • org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.2-3
  • gradle.plugin.io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.0.0.M10.3

Error:

* What went wrong:
A problem occurred evaluating root project 'android-gif-example'.
> Failed to apply plugin [id 'com.android.application']
   > Could not create plugin of type 'AppPlugin'.
      > com.google.common.collect.Lists.newArrayListWithCapacity(I)Ljava/util/ArrayList;

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED in 16s

I am applying the apply plugin: "io.gitlab.arturbosch.detekt" plugin after both android and kotlin plugins.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
arturboschcommented, Jun 5, 2017

Will be fixed in M11 today later. It works for me now with your project. I will upload a PR where you can confirm it also works for you ^^

git clone https://github.com/arturbosch/detekt
git checkout embedabble-compiler
gradle build install

buildscript {
  repositories {
    mavenLocal()
  }
  dependencies {
    classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.0.0.M11"
  }
}
repositories {
  jcenter()
  mavenLocal()
}
apply plugin: "io.gitlab.arturbosch.detekt"
detekt {
  version = "1.0.0.M11"  // Specify current detekt version
  input = "$input/src/main/kotlin" // input is preconfigured to 'project.projectDir.absolutePath'
  config = "$project.projectDir/detekt.yml" // Use $project.projectDir to navigate inside your project
  filters = ".*test.*, .*/resources/.*" // What paths to exclude? Use comma oder semicolon to separate
}
1reaction
arturboschcommented, Jun 5, 2017

I have the feeling that because I’m using the kotlin-compiler which also have guava etc classes, there can be conflicts. Will try to migrate to embeddable compiler.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to apply plugin [id 'com.android.application']
Try this simple and quick solution. Invalidating cache solved my problem. Just go to File>Invalidate Cache /Restart. Share. Share a ...
Read more >
Solve Gradle error: Plugin with id 'com.android.application' not ...
The Android Gradle plugin is downloaded from Google's Maven repository. You need to make sure that the repository google() is listed under ...
Read more >
Can't build/debug - "Failed to apply plugin [id 'com.android ...
Hello! I have the most recent version of android studio, of the project (on master branch), of kotlin, gradle and windows 10.
Read more >
Plugin [id: 'com.android.application', version: '7.2.1', apply
Cause it was broken, I change it to my Windows computer. After I install Android Studio in my Windows and clone it, it's...
Read more >
Configure your build - Android Developers
The Android build system compiles app resources and source code and packages them ... Gradle and the Android Gradle plugin help you configure...
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