Compatibility issue with Android tools 3.3.0-alpha11
See original GitHub issueI 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:
- Created 5 years ago
- Comments:22 (9 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
Please try released version
6.1.0
and feel free to reopen this issue.