首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何为Google发布打包WatchFace专用应用程序

如何为Google发布打包WatchFace专用应用程序
EN

Stack Overflow用户
提问于 2016-04-18 12:10:55
回答 1查看 686关注 0票数 6

到目前为止

我正在开发一个用于android穿戴的手表脸应用程序。

我创建了两个模块:

  1. 磨损-在开发中工作良好的手表面板
  2. Mobile -一个没有任何活动的空模块,如注释所示

我已经将磨损模块作为依赖关系添加到移动设备中,如packaging wear apps for the playstore中所述

这款应用程序在playstore的alpha版中。我上传了移动版本have。

应用程序在我的手机上安装得很好,但是磨损模块,WatchFace不会安装在我的穿戴设备上。,这是我的问题。

我做错了什么?

这是我的舱单和Gradle吐露的

移动报表

代码语言:javascript
复制
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dimitrioskanellopoulos.athletica">

<uses-permission android:name="android.permission.BODY_SENSORS"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

<application android:allowBackup="true" android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name" android:supportsRtl="true"
    android:theme="@style/AppTheme">

</application>

磨损表

代码语言:javascript
复制
<service
  android:name="com.dimitrioskanellopoulos.athletica.WatchFaceService"
  android:label="@string/app_name"
  android:permission="android.permission.BIND_WALLPAPER">

  <meta-data
    android:name="android.service.wallpaper"
    android:resource="@xml/watch_face" />

  <meta-data
      android:name="com.google.android.wearable.watchface.preview"
      android:resource="@drawable/preview_rectangular" />

  <meta-data
      android:name="com.google.android.wearable.watchface.preview_circular"
      android:resource="@drawable/preview_circular" />

  <intent-filter>
    <action android:name="android.service.wallpaper.WallpaperService" />
    <category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
  </intent-filter>
</service>

Build.gradle for Project

代码语言:javascript
复制
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

移动模块Build.gradle

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.dimitrioskanellopoulos.athletica"
        minSdkVersion 22
        targetSdkVersion 23
        versionCode 4
        versionName "1.0.2"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            zipAlignEnabled true
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.3.0'
    wearApp project(':wear')
}

磨损模块Build.gradle

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.dimitrioskanellopoulos.athletica"
        minSdkVersion 22
        targetSdkVersion 23
        versionCode 4
        versionName "1.0.2"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            zipAlignEnabled true
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-annotations:23.3.0'
    compile 'com.google.android.support:wearable:1.4.0'
    compile 'com.android.support:support-v4:23.3.0'
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.google.android.gms:play-services-location:8.4.0'
    compile 'com.google.android.gms:play-services-wearable:8.4.0'
    compile 'com.luckycatlabs:SunriseSunsetCalculator:1.2'
    compile 'org.apache.commons:commons-lang3:3.4'
}

任何帮助都将不胜感激!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-04-21 10:47:27

过了一段时间它就安装好了。安装了几次。

更新的清单是评论的结果,对此表示感谢。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36693617

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档