javaandroidxmlgradleaapt

AAPT: error: attribute android:clipToOutline not found


Executing tasks: [:app:assembleDebug]

Task :app:preBuild UP-TO-DATE Task :app:preDebugBuild UP-TO-DATE Task :app:compileDebugAidl NO-SOURCE Task :app:checkDebugManifest UP-TO-DATE Task :app:compileDebugRenderscript NO-SOURCE Task :app:generateDebugBuildConfig UP-TO-DATE Task :app:prepareLintJar UP-TO-DATE Task :app:processDebugGoogleServices UP-TO-DATE Task :app:generateDebugSources UP-TO-DATE Task :app:javaPreCompileDebug UP-TO-DATE Task :app:mainApkListPersistenceDebug UP-TO-DATE Task :app:generateDebugResValues UP-TO-DATE Task :app:generateDebugResources UP-TO-DATE Task :app:createDebugCompatibleScreenManifests UP-TO-DATE Task :app:mergeDebugResources Task :app:processDebugManifest UP-TO-DATE Task :app:processDebugResources FAILED

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 54s 12 actionable tasks: 2 executed, 10 up-to-date


Solution

  • Due to a bug the android:clipToOutline attribute is not recognised and will throw a compiler error when trying to build. I've read that using android:outlineProvider="background" is working in some cases, but for me it doesn't work. A workaround is to programmatically set view.setClipToOutline(true) in Java or view.clipToOutline = true in Kotlin on your view.