如何将我的Android Wear分发给Google Play商店中的alpha / beta用户?

时间:2015-05-28 22:06:55

标签: android wear-os

我正在测试我的应用程序并处于Alpha模式。我的应用已获批准,我可以在Play商店中以alpha模式找到它。但是,穿着'我的应用程序的一部分没有自动安装到磨损。

我的佩戴应用程序目前功能很少,所以"选择加入"因为磨损一直被拒绝。我仍然希望能够为我的阿尔法用户打包我的最小磨损应用程序,但它似乎并没有起作用。我有什么想法可以自动安装应用程序的磨损部分吗?

目前我的文件是:

/build.gradle

// Used in 'mobile' and 'wear' submodules
def versionMajor() { 0 }
def versionMinor() { 0 }
def versionPatch() { 8 }

def gitVersion() {
    def process = "git rev-list master --first-parent --count".execute()
    return process.text.toInteger()
}

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'

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

allprojects {
    repositories {
        jcenter()
    }
}

/mobile/build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.kamil.coach"
        minSdkVersion 19
        targetSdkVersion 22
        versionCode gitVersion()
        versionName "${versionMajor()}.${versionMinor()}.${versionPatch()}"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
        exclude 'APK META-INF/NOTICE.txt'
        exclude 'APK META-INF/notice.txt'
    }
}

if(project.hasProperty("MyProject.signing") && new File(project.property("MyProject.signing") + ".gradle").exists()) {
    println "mobile applying gradle file"
    apply from: project.property("MyProject.signing") + ".gradle";
} else {
    println "mobile not applying gradle file"
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':core')
    wearApp project(':wear')
    compile "com.android.support:appcompat-v7:22.1.0"

    compile 'com.google.android.gms:play-services:7.3.0'
    compile 'com.google.android.support:wearable:1.1.0'
    compile 'com.google.android.gms:play-services-wearable:7.3.0'
    compile 'org.apache.commons:commons-lang3:3.0'
    compile 'joda-time:joda-time:2.7'
    compile 'org.ocpsoft.prettytime:prettytime:4.0.0.Final'

    compile 'com.uservoice:uservoice-android-sdk:+'

    compile(name:'cloud-release', ext:'aar')
    compile(name:'auth-release', ext:'aar')
    compile(name:'core-release', ext:'aar')
}

repositories {
    flatDir {
        dirs 'libs'
    }
}

/wear/build.gradle

apply plugin: 'com.android.application'


android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.kamil.coach"
        minSdkVersion 20
        targetSdkVersion 22
        versionCode gitVersion()
        versionName "${versionMajor()}.${versionMinor()}.${versionPatch()}"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
        exclude 'APK META-INF/NOTICE.txt'
        exclude 'APK META-INF/notice.txt'
    }
}

if(project.hasProperty("MyProject.signing") && new File(project.property("MyProject.signing") + ".gradle").exists()) {
    println "wear applying gradle file"
    apply from: project.property("MyProject.signing") + ".gradle";
} else {
    println "wear not applying gradle file"
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':core')
    compile 'com.google.android.support:wearable:1.1.0'
    compile 'com.google.android.gms:play-services-wearable:7.3.0'
    compile 'org.apache.commons:commons-lang3:3.0'

    compile(name:'cloud-release', ext:'aar')
    compile(name:'auth-release', ext:'aar')
    compile(name:'core-release', ext:'aar')
}

repositories {
    flatDir {
        dirs 'libs'
    }
}

/core/build.gradle

apply plugin: 'com.android.library'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        minSdkVersion 17
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.0.0'


    compile 'com.squareup.retrofit:retrofit:1.9.+'
}

/mobile/AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.kamil.coach"
          xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-feature android:name="android.hardware.sensor.accelerometer"/>
    <uses-feature android:name="android.hardware.sensor.gyroscope"/>

    <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-permission android:name="android.permission.BLUETOOTH"/>
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

    <application
        android:name=".mobile.MobileKamilApplication"
        android:allowBackup="true"
        android:icon="@drawable/launcher_icon"
        android:label="@string/app_name"
        android:theme="@style/CoachTheme"
        >

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version"/>

        .
        .
        .
    </application>

</manifest>

/wear/AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.kamil.coach"
          xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-feature android:name="android.hardware.type.watch"/>
    <uses-feature android:name="android.hardware.sensor.accelerometer"/>
    <uses-feature android:name="android.hardware.sensor.gyroscope"/>

    <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-permission android:name="android.permission.BLUETOOTH"/>
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>

    <application
        android:name="com.core.KamilApplication"
        android:allowBackup="true"
        android:icon="@drawable/launcher_icon"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.DeviceDefault"
        >

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version"/>

        .
        .
        .
        .

    </application>

</manifest>

2 个答案:

答案 0 :(得分:1)

磨损应用程序必须打包在主应用程序中,它不是单独分发的。您只需将移动应用的发布apk正常上传到Play商店Alpha通道。

两个应用必须具有相同的软件包名称,使用相同的密钥进行签名,并且在移动gradle依赖项中,您必须包含可穿戴项目

wearApp project(':wearable')

有关详细信息,请参阅完整的Google文档。 http://developer.android.com/training/wearables/apps/packaging.html

答案 1 :(得分:0)

我正在嵌入一个导致权限错误的aar文件 我不得不将该aar文件中的权限复制到我的移动应用程序中。

我通过在磨损上使用'adb logcat'来解决这个问题,因为我的mobile-release.apk试图从磨损中安装并找出问题所在。