1

I am receiving this error (error: style attribute 'android:attr/windowOptOutEdgeToEdgeEnforcement' not found.) while building my app, seems image_cropper is expecting target sdk to be 35, while I have latest Flutter update which seems using Android SDK 35, what shall I do?

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
   > Android resource linking failed
     ERROR:D:\myproject\build\image_cropper\intermediates\packaged_res\debug\values-v35\values-v35.xml:3:5-5:13: AAPT: error: style attribute 'android:attr/windowOptOutEdgeToEdgeEnforcement' not found.

while my config in build.gradle is, which seems using Android SDK 35 :

targetSdkVersion flutter.targetSdkVersion

And my Flutter version is :

Flutter (Channel stable, 3.27.1, on Microsoft Windows [Version 10.0.26100.2605], locale en-US)
1
  • 1
    Please share your flutter configuration file so we can see what the value of flutter.targetSdkVersion is. Also, the error you shared doesn't talk about API 35, but rather a style attribute not being found. Your pubspec.yaml can also help. Commented Dec 17, 2024 at 10:17

1 Answer 1

3

image_cropper 8.1.0 adds windowOptOutEdgeToEdgeEnforcement which is only in API 35. It looks like somewhere the build is defaulting to API 34.

Check the ext setting in android/build.gradle (or other build settings that may be overriding the compileSdk)

e.g.

ext {
    buildToolsVersion = "35.0.0"
    minSdkVersion = 28
    compileSdkVersion   = 35                // or higher / as desired
    targetSdkVersion    = 35                // or higher / as desired
}

Also do a clean if recently upgraded.

I rolled back to 8.0.2 to resolve but I am building for API 34.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. This solution effectively resolved the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.