【发布时间】:2014-07-06 15:42:54
【问题描述】:
我正在尝试让自定义表盘正常工作,但是当我将应用程序与移动 apk 打包并将签名的移动 APK 安装到我的手机上时,当磨损 apk 尝试时,我在我的 logcat 中收到以下错误消息安装到手表上
1149-1159/? E/WearablePkgInstaller﹕ Package install failed com.ptrprograms.wearcustomwatchface, returnCode -104
有谁知道我在哪里可以找到返回代码列表,以便弄清楚发生了什么?我的代码与 Android Studio 生成的基本穿戴项目的唯一区别在于清单:
wear manifest:
<uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
mobile manifest:
<activity
android:name=".CustomWatchFaceActivity"
android:label="@string/app_name"
android:enabled="true"
android:taskAffinity=""
android:allowEmbedded="true"
android:theme="@android:style/Theme.DeviceDefault.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="com.google.android.clockwork.home.category.HOME_BACKGROUND" />
</intent-filter>
<meta-data
android:name="com.google.android.clockwork.home.preview"
android:resource="@drawable/ic_launcher"/>
</activity>
附加信息 - 添加了 LAUNCHER 类别意图过滤器并随后安装,因此看起来现在可能需要将表盘包含在普通应用中,但有人可能也有解决方法。
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
【问题讨论】:
-
对于那些在这里找到类似 returnCode 错误的人; android.googlesource.com/platform/frameworks/base/+/f76a50c/…