如何为Google Play发布打包仅限WatchFace的应用

Jim*_*ane 6 android google-play android-studio android-gradle-plugin wear-os

至今

我正在为Android服装开发一款表盘应用程序.

我创建了2个模块:

  1. 磨损 - 可在开发中正常工作的表盘
  2. 移动 - 评论建议的没有活动的空模块

我已经将磨损模块添加到移动设备作为依赖性,如Playstore的包装磨损应用程序中所述

该应用程序在Playstore中处于alpha状态.我上传了mobile-release.apk.

该应用程序安装在我的手机上,但磨损模块,WatchFace将不会安装在我的佩戴设备上.这是我的问题.

我究竟做错了什么?

这是我的清单和Gradle配置

移动清单

<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>
Run Code Online (Sandbox Code Playgroud)


穿上清单

<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>
Run Code Online (Sandbox Code Playgroud)


项目的Build.gradle

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
}
Run Code Online (Sandbox Code Playgroud)

移动模块的Build.gradle

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')
}
Run Code Online (Sandbox Code Playgroud)

Build.gradle用于磨损模块

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'
}
Run Code Online (Sandbox Code Playgroud)

任何帮助将非常感激!

Jim*_*ane 2

一段时间后就安装好了。进行了多次卸载/安装。

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