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.

3 Answers 3

9

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

4
  • Thanks for this information. It solved my issue Dec 7, 2021 at 6:58
  • 1
    Thanks! I had 30 but had to change to 31.
    – Chris
    Dec 10, 2021 at 16:16
  • This must be a red herring though .. it's a cache issue so just updating your SDK isn't really solving the underline issue Jan 12, 2022 at 11:54
  • this did not work for me. I get the same error with 31 Mar 26, 2022 at 6:01
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.

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.
    – Community Bot
    May 25, 2022 at 9:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.