android - 属性 android:shortcutLongLabel 未找到
问题描述
尝试测试我的 android 快捷方式,但我不断收到错误消息,指出未找到属性 android:shortcutLongLabel,这继续使用 shorcutShortLabel、shortcutID 等。应该没有什么不同,但我正在用 kotlin 编写应用程序,并且正在使用 compileSdkVersion 29.
尝试将应用程序快捷方式添加到我的项目中。所以我创建了shortcuts.xml 文件并将其添加到res/xml/shortcuts.xml。我确保 Gradle 中的所有内容都是最新的,并且一直遵循 Google 的文档,直到在您的应用程序中添加快捷方式。我认为我的 Gradle 或 manifest.xml 有问题,但我不知道是什么。此外,当我按 F2 时,它说在此文件上没有发现错误。
<?xml version="1.0" encoding=utf-8"?>
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut android:enable="true"
android:shortcutID="xxxx"
android:icon="@drawable/xxxxx"
android:shortcutShortLabel="@string/xxxx"
android:shortcutLongLabel="@string/xxxxx">
<intent android:action="android.intent.action.VIEW"
android:targetPackage="com.example.test"
android:targetClass="com.example.test.TestIntent/>
</shortcut>
每次在我构建项目时都会发生以下情况:
AAPT:错误:找不到属性 android:shortcutLongLabel。AAPT:错误:找不到属性 android:shortcutShortLabel。AAPT:错误:找不到属性 android:shortcutID。
解决方案
推荐阅读
- javascript - 当我重写滚动条css属性时,textarea样式的resize图标发生了变化
- authentication - 在对 Azure 静态网站进行身份验证时检索组
- delphi - 如何禁用 TWebBrowser 上下文菜单?
- robotframework - 如何将参数传递给机器人库
- java - LinkedBlockingQueue 何时优于 ConcurrentLinkedQueue?
- arrays - 对象数组内的弹性搜索查询
- python - 带有查询返回值的 Sqlite OperationalError
- reactjs - 在 render() 中反应 setState
- android - 无法获取“https://google.bintray.com/flexbox-layout/com/google/android/flexbox/1.0.0/flexbox-1.0.0.pom”
- python - 使用 Python Cx_Oracle 将 7L 行的 185 列插入到 Oracle sql 表中