Jimmy Kane
Jimmy Kane

Reputation: 16825

How to package a WatchFace only App for Google Play publishing

So far

I am developing a watch face app for android wear.

I have created 2 modules:

  1. Wear - The Watch face that works fine on development
  2. Mobile - An empty module with no activity as suggested by the comments

I have added the wear module to the mobile as a dependancy as described in packaging wear apps for the playstore

The app is in alpha in the playstore. I have uploaded the mobile-release.apk.

The app installs fine on my mobile but the wear module, the WatchFace will not install on my wear device. This is my problem.

What am I doing wrong?

Here are my manifests and Gradle configs

Mobile Manifest

<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>


Wear Manifest

<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 the Project

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 for the mobile module

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 for the wear module

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'
}

Any help would be much appreciated!

Upvotes: 6

Views: 746

Answers (1)

Jimmy Kane
Jimmy Kane

Reputation: 16825

Well after some time it installed. Took several uninstalls/installs.

The updated manifests are result of the comments and thanks for that.

Upvotes: 2

Related Questions