Member-only story

Flutter — Execution failed for task ‘:camera:compileDebugJavaWithJavac’

Flutter camera: ^0.9.4+4 plugin fails in Flutter version 2.5.2 & minSdkVersion 21

Error:

C:\Users\xxx\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\Camera.java:23: error: cannot find symbol
import android.media.EncoderProfiles;
^
symbol: class EncoderProfiles
location: package android.media
C:\Users\xxx\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\Camera.java:935: error: cannot find symbol
EncoderProfiles getRecordingProfile() {
...

Solution:

Update your compileSdkVersion and targetSdkVersion to 31, in path ./android/app/build.gradle.

Hope this helped 🙏

Support me by becoming a Medium member 🥳, and get access to unique programming articles that will enhance you skills.

Become a Medium member — 🖖 Live long and prosper 🖖

--

--

Flutter Developer
Flutter Developer

Written by Flutter Developer

Flutter and Native Android developer

No responses yet