Execution failed for task ':permission_handler:compileDebugJavaWithJavac'
Asked Answered
Y

4

8

When I added permission_handler plugin in flutter. This Error Occured:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task 
':permission_handler:compileDebugJavaWithJavac'.   
> Compilation failed; see the compiler error output for details.

I tried to change the version of plugin and I also tried to run flutter clean but not worked.

If you know the answer of this question.Please answer this question.

Ynez answered 28/10, 2021 at 11:7 Comment(0)
G
9

changing the compileSdkVersion to 30 or 31 in android\app\build.gradle can fix this issue

Gatekeeper answered 3/11, 2021 at 8:33 Comment(4)
Thanks for this information. It solved my issuePilau
Thanks! I had 30 but had to change to 31.Coprolite
This must be a red herring though .. it's a cache issue so just updating your SDK isn't really solving the underline issueSubminiaturize
this did not work for me. I get the same error with 31Carny
S
1

Most probably there is a chance that you are using an outdated dependency. Removing it can solve it. However, I was facing the same issue and changing "compileSdkVersion" to 31 in build.gradle solved my problem.

Sihonn answered 21/4, 2022 at 5:48 Comment(0)
C
0

Changed the compileSdkVersion to 31 and then it asked for 32. Now I am getting the following:

 What went wrong:
Execution failed for task ':permission_handler:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

Make sure that you fully go through the V2 migration. Keep in mind that some plugins might not be null safety or V2 compliant and that might be the issue. So you might want to remove those or find a way to replace them.

Christean answered 24/5, 2022 at 22:42 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Quintilla
T
0

For me, the problem is with Android Studio. I use a Mac with M1 processor and everytime there is an update with the Android studio, I need to do the following.

Go to Applications folder in Finder, right click on Android Studio -> Show Package contents. Navigate inside the folder and create a new directory named jre and copy the contents of jbr into newly created jre. Restart Android studio and it worked fine for me.

Tumble answered 6/3, 2024 at 10:15 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.