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.

Compatibility issue with Android tools 3.3.0-alpha11

See original GitHub issue

I just tried the 6.0.0 version of ktlint Gradle plugin with the latest version of Android Gradle plugin.

The latest version of ktlint removed the afterEvaluate The latest version of AGP introduced lazy task creation.

When they come together, I got the following error:

Cannot add task ‘assembleDebug’ as a task with that name already exists.

Caused by: org.gradle.api.internal.tasks.DefaultTaskContainer$DuplicateTaskException: Cannot add task 'assembleDebug' as a task with that name already exists. at org.gradle.api.internal.tasks.DefaultTaskContainer.duplicateTask(DefaultTaskContainer.java:250) at org.gradle.api.internal.tasks.DefaultTaskContainer.registerTask(DefaultTaskContainer.java:365) at org.gradle.api.internal.tasks.DefaultTaskContainer.register(DefaultTaskContainer.java:345) at com.android.build.gradle.internal.tasks.factory.TaskFactoryImpl.register(TaskFactoryImpl.kt:84) at com.android.build.gradle.internal.TaskManager.createAnchorAssembleTasks(TaskManager.java:3038) at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:814) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81) at com.android.build.gradle.BasePlugin.lambda$createTasks$4(BasePlugin.java:667) at com.android.build.gradle.internal.crash.CrashReporting$afterEvaluate$1.execute(crash_reporting.kt:37) at com.android.build.gradle.internal.crash.CrashReporting$afterEvaluate$1.execute(crash_reporting.kt)

AGP tries to register the task but the assembleDebug task is already added by ktlint Gradle plugin. Not sure if ktlint really creates a task named assembleDebug but it would worth double-checking.

Reverting back to 5.0.0 fixes the problem. 👍

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:22 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
tasomaniaccommented, Sep 25, 2018

Here is the project I tried. https://github.com/tasomaniac/OpenLinkWith

It has build flavors. Just by updating the ktlint version, you can reproduce the error.

0reactions
Tapchicomacommented, Oct 5, 2018

Please try released version 6.1.0 and feel free to reopen this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wrong gradle version used for building plugins for android ...
Issue Description When running tns build android, I get an error: A problem occurred evaluating root project 'gesturehandler'.
Read more >
@capacitor/android | Yarn - Package Manager
Capacitor lets you run web apps natively on iOS, Android, Web, and more with a single codebase and cross-platform APIs. Capacitor provides a...
Read more >
Sentry.AspNetCore 3.0.0-alpha.11 - NuGet
Official ASP.NET Core integration for Sentry - Open-source error tracking that helps developers monitor and fix crashes in real time.
Read more >
native-base - npm
Essential cross-platform UI components for React Native. Latest version: 3.4.25, last published: 8 days ago. Start using native-base in your ...
Read more >
Android Maven Plugin 4.0.0-rc.2 - GitHub Pages
fixed https://github.com/jayway/maven-android-plugin/issues/431 ... usage allowing compatibility with Maven 3.0.x and therefore with IDE's and other tools ...
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