首页 文章

Android Wear - WearablePkgInstaller:软件包安装失败returnCode -104

提问于
浏览
0

我正在玩自定义表盘工作,但当我用移动apk打包应用程序并将已签名的移动APK安装到我的手机上时,我在我的logcat中遇到以下错误消息,当穿戴apk试图安装到 Watch

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>

3 回答

  • 0

    EDIT :以下是我的一篇新博文,解释了Lollipop中新的Watch Face API .

    http://toastdroid.com/2014/12/10/developing-a-watch-face-for-android-wear-lollipop/


    确保您的移动和磨损模块具有相同的包名称,并且移动应用程序包含磨损模块所需的所有权限 . 此外,表面不需要WAKE_LOCK权限 . 你可以在我做的博客文章中阅读更多关于watchface dev的信息:

    http://toastdroid.com/2014/07/18/developing-watchfaces-for-android-wear/

  • 1

    从您的AndroidManifest.xml文件中删除以下2个权限行:

    <uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    

    我相信如果你只想让你的应用成为表盘,那么意图过滤器是可选的 .

    这是一个我发现的 Watch 示例应用程序,您可以查看参考 . https://github.com/kentarosu/AndroidWearAndLIFX

  • 0

    只需要在移动清单中添加权限

相关问题