Execution failed for task ':permission_handler:compileDebugJavaWithJavac'

Viewed 4592

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.

3 Answers

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

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.

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.

Related