7

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.

Zilaid
  • 464
  • 6
  • 22

3 Answers3

9

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

Amjad
  • 106
  • 3
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.

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.

  • 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](/help/how-to-answer). – Community May 25 '22 at 09:21