{"id":2420,"date":"2020-03-07T13:00:00","date_gmt":"2020-03-07T13:00:00","guid":{"rendered":"https:\/\/chewett.co.uk\/blog\/?p=2420"},"modified":"2020-03-07T13:00:57","modified_gmt":"2020-03-07T13:00:57","slug":"fixing-gradle-error-unnecessarily-replacing-a-task-that-does-not-exist-is-not-supported","status":"publish","type":"post","link":"https:\/\/chewett.co.uk\/blog\/2420\/fixing-gradle-error-unnecessarily-replacing-a-task-that-does-not-exist-is-not-supported\/","title":{"rendered":"Fixing Gradle error Unnecessarily replacing a task that does not exist is not supported."},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"254\" data-attachment-id=\"2421\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/2420\/fixing-gradle-error-unnecessarily-replacing-a-task-that-does-not-exist-is-not-supported\/fixing_gradle6_error\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/03\/fixing_gradle6_error.jpg?fit=800%2C300&amp;ssl=1\" data-orig-size=\"800,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"fixing_gradle6_error\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/03\/fixing_gradle6_error.jpg?fit=300%2C113&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/03\/fixing_gradle6_error.jpg?fit=678%2C254&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/03\/fixing_gradle6_error.jpg?resize=678%2C254&#038;ssl=1\" alt=\"\" class=\"wp-image-2421\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/03\/fixing_gradle6_error.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/03\/fixing_gradle6_error.jpg?resize=300%2C113&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/03\/fixing_gradle6_error.jpg?resize=768%2C288&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/03\/fixing_gradle6_error.jpg?resize=50%2C19&amp;ssl=1 50w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/figure>\n\n\n\n<p>This short blog post talks about why you get this error and how to fix &#8220;Unnecessarily replacing a task that does not exist is not supported&#8221;.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">What is the error and why does it occur<\/h2>\n\n\n\n<p>When you attempt to run or debug a method using Gradle and IntelliJ you may encounter the following error.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Unnecessarily replacing a task that does not exist is not supported.  Use create() or register() directly instead.  You attempted to replace a task named &#8216;Example.main()&#8217;, but there is no existing task with that name.<\/p><\/blockquote>\n\n\n\n<p>This will stop you building any projects until you have resolved this issue.<\/p>\n\n\n\n<p>This has started to occur when using Gradle 6 as they made old deprecated behaviour be logged as an error. The  reply relating to this issue from the gradle devs is:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p> This is coming from a long deprecated behavior that was finally made an error in Gradle 6.0. Unfortunately, we&#8217;re not going to restore the old behavior, but we&#8217;ll work with JetBrains to make this sort of thing work without requiring special handling on IDEA&#8217;s side. <\/p><cite>big-guy <a href=\"https:\/\/github.com\/gradle\/gradle\/issues\/11371\">https:\/\/github.com\/gradle\/gradle\/issues\/11371<\/a> <\/cite><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Fixing this error<\/h2>\n\n\n\n<p>This error relates to using Gradle 6 with IntelliJ 2019.2 or older. This means to fix the issue you just need to upgrade to IntelliJ 2019.3 or newer.<\/p>\n\n\n\n<p>If this isn&#8217;t possible you are able to downgrade gradle to the latest version 5 distribution. This should also resolve the issue.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This short blog post talks about why you get this error and how to fix &#8220;Unnecessarily replacing a task that does not exist is not supported&#8221;.<\/p>\n","protected":false},"author":1,"featured_media":2422,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Today I have written about fixing #Gradle error Unnecessarily replacing a task that does not exist is not supported. ","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[368,370,369,364],"class_list":["post-2420","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fixes","tag-gradle","tag-idea","tag-intellij","tag-java"],"wppr_data":{"cwp_meta_box_check":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/03\/fixing_gradle6_error_icon.jpg?fit=800%2C800&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p2toWX-D2","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2902,"url":"https:\/\/chewett.co.uk\/blog\/2902\/making-a-fully-packaged-jarfile-with-all-dependencies-with-gradle\/","url_meta":{"origin":2420,"position":0},"title":"Making a fully packaged Jarfile with all dependencies with gradle","author":"Chewett","date":"April 24, 2021","format":false,"excerpt":"This blog post talks about how you can create a fully packaged jarfile including all its gradle dependencies. What is a fully packaged jar file also known as a fat jar or uber jar When using gradle dependencies it will download the various required files and have them available. When\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/04\/gradle_fat_jar_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/04\/gradle_fat_jar_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/04\/gradle_fat_jar_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/04\/gradle_fat_jar_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/04\/gradle_fat_jar_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1106,"url":"https:\/\/chewett.co.uk\/blog\/1106\/fixing-livekernelevent-crashing-fallout-4\/","url_meta":{"origin":2420,"position":1},"title":"Fixing LiveKernelEvent crashing Fallout 4","author":"Chewett","date":"April 11, 2018","format":false,"excerpt":"This post describes how I fixed crashes with Fallout 4 with the event name \"LiveKernelEvent\" when playing with an AMD GPU. The Crash details I found that after playing Fallout for a couple minutes it would crash. This would typically either crash to desktop (CTD) or the entire graphics driver\u2026","rel":"","context":"In &quot;Fixes&quot;","block_context":{"text":"Fixes","link":"https:\/\/chewett.co.uk\/blog\/category\/fixes\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/04\/fallout_4_ctd_fix.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/04\/fallout_4_ctd_fix.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/04\/fallout_4_ctd_fix.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/04\/fallout_4_ctd_fix.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1332,"url":"https:\/\/chewett.co.uk\/blog\/1332\/fixing-remote-desktop-connection-an-authentication-error-has-occurred\/","url_meta":{"origin":2420,"position":2},"title":"Fixing Remote Desktop Connection &#8220;An authentication error has occurred&#8221;","author":"Chewett","date":"July 11, 2018","format":false,"excerpt":"This post talks about how you can resolve Remote Desktop authentication issues due to CredSSP encryption oracle remediation. Why is the error and why does it occur? Recently there was an exploit found in the CredSSP module which affected a number of systems including remote desktop. This allowed remote code\u2026","rel":"","context":"In &quot;Fixes&quot;","block_context":{"text":"Fixes","link":"https:\/\/chewett.co.uk\/blog\/category\/fixes\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/07\/fixing_rdp_auth_issue.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/07\/fixing_rdp_auth_issue.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/07\/fixing_rdp_auth_issue.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/07\/fixing_rdp_auth_issue.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":2623,"url":"https:\/\/chewett.co.uk\/blog\/2623\/pokemon-go-api-research-task-exclusive-pokemon-api\/","url_meta":{"origin":2420,"position":3},"title":"Pokemon Go API &#8211; Research Task Exclusive Pokemon API","author":"Chewett","date":"September 19, 2020","format":false,"excerpt":"This post talks about the latest API I have added to PoGoAPI.net, the Research Task Exclusive Pokemon API. What is the Research Task Exclusive Pokemon API Some Pokemon and their evolutions are only available by completing research tasks. To get these you will have to find the research task by\u2026","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/chewett.co.uk\/blog\/category\/software\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/pogo_api_raid_research_exclusive_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/pogo_api_raid_research_exclusive_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/pogo_api_raid_research_exclusive_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/pogo_api_raid_research_exclusive_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/pogo_api_raid_research_exclusive_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1010,"url":"https:\/\/chewett.co.uk\/blog\/1010\/canon-printer-stuck-creating-print-data-canon-5300-series-printer\/","url_meta":{"origin":2420,"position":4},"title":"Canon printer stuck on &#8220;Creating print data&#8221; Canon 5300 Series Printer","author":"Chewett","date":"February 14, 2018","format":false,"excerpt":"This post describes what it means when a Canon printer gets stuck on \"Creating print data\" and what you can do to fix it. What does Creating Print Data actually mean? There are a couple of reasons creating print data may appear. It isn't a very helpful message in terms\u2026","rel":"","context":"In &quot;Fixes&quot;","block_context":{"text":"Fixes","link":"https:\/\/chewett.co.uk\/blog\/category\/fixes\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/fixing_canon_mg5300_printer.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/fixing_canon_mg5300_printer.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/fixing_canon_mg5300_printer.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/fixing_canon_mg5300_printer.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":2303,"url":"https:\/\/chewett.co.uk\/blog\/2303\/fixing-overcooked-2-failed-to-start-error-code-51\/","url_meta":{"origin":2420,"position":5},"title":"Fixing Overcooked 2 Failed to start error code 51","author":"Chewett","date":"August 3, 2019","format":false,"excerpt":"This post talks about how you can fix \"Overcooked! 2 failed to start (error code 51)\". Sometimes this will occur with the error text \"Steam Error Application load error 3:0000065432\". Overview of the issue This error may come in two forms which will prevent Overcooked! 2 from starting. Overcooked! 2\u2026","rel":"","context":"In &quot;Fixes&quot;","block_context":{"text":"Fixes","link":"https:\/\/chewett.co.uk\/blog\/category\/fixes\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/07\/fixing_overcooked2_failedtostart.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/07\/fixing_overcooked2_failedtostart.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/07\/fixing_overcooked2_failedtostart.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/07\/fixing_overcooked2_failedtostart.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2420","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=2420"}],"version-history":[{"count":1,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2420\/revisions"}],"predecessor-version":[{"id":2423,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2420\/revisions\/2423"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media\/2422"}],"wp:attachment":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=2420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=2420"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=2420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}