简体   繁体   中英

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.

  • What went wrong: Execution failed for task ':app:processDebugResources'.

    Android resource linking failed C:\Users\user\StudioProjects\IMPwala\app\src\main\res\layout\activity_main2.xml:23: AAPT: error: attribute android:clipToOutline not found.

    C:\Users\user\StudioProjects\IMPwala\app\src\main\res\layout\activity_main2.xml:87: AAPT: error: attribute layout_constrainttop_toTopOf (aka com.example.impwala:layout_constrainttop_toTopOf) not found.

    C:\Users\user\StudioProjects\IMPwala\app\src\main\res\layout\activity_main2.xml:87: AAPT: error: attribute android:clipToOutline not found.

    C:\Users\user\StudioProjects\IMPwala\app\src\main\res\layout\activity_main2.xml:150: AAPT: error: attribute android:clipToOutline not found.

    C:\Users\user\StudioProjects\IMPwala\app\src\main\res\layout\activity_main2.xml:212: AAPT: error: attribute android:clipToOutline not found.

    C:\Users\user\StudioProjects\IMPwala\app\src\main\res\layout\activity_main2.xml:274: AAPT: error: attribute android:clipToOutline not found.

    error: failed linking file resources.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

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

You should offer a little more information than just posting your error here. This article contains information on how to ask a good question on StackOverflow.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM