Why Error: (2) Resource ID not found for attribute 'shortcutShortLabel' in package 'android' when creating shourtcut in Android7?

When I create a shortcut, go to developer.android.com, the code I wrote below

<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
    android:enabled="true"
    android:icon="@drawable/share"
    android:shortcutId="search"
    android:shortcutShortLabel="@string/recommend_us"
    android:shortcutLongLabel="@string/recommend_to_friend"
    android:shortcutDisabledMessage="@string/bind_unbound">
    <intent
        android:action="android.intent.action.VIEW"
        android:targetPackage="com.example.myapplication"
        android:targetClass="com.yidian.news.ui.search.SearchChannelActivity" />
</shortcut>
<!-- Specify more shortcuts here. -->

Plain. But when I create a project, I get an error here

Error: (2) Resource ID not found for attribute 'shortcutId' in package 'android'

Error: (2) Resource ID not found for attribute 'shortcutShortLabel' in package 'android'

Error: (2) Resource ID not found for attribute 'shortcutLongLabel' in package 'android' Error: (2) Resource ID not found for attribute 'shortcutDisabledMessage' in package 'android'

Why is this

update all Android SDKs and tools

+4
1

Android 7.1. .. API 25

+2

Source: https://habr.com/ru/post/1663051/


All Articles