Packaging wearable applications

I am at the last stage of the development of a watchdog service for android devices. The problem is this: Every time I try to sign my application, two files are generated: wear-release.apk and mobile-release.apk, there is no other apk. Should the apk name be my Packagename in the project directory? -Because I tried to open both files using my compatible smartphone (with an attached wear device), which always ends instantly with a phrase error.

Thinngs I noticed:

  • There is no content in the package for mobile devices in Android Studio
  • Permissions are only mentioned in the mobile manifest (also tried with permissions for both manifest)
  • this is a regular werable watchface with no configuration activity
  • The apk mobile release is a lager path than wear-apk, although I put almost nothing on the mobile part. (-> well, maybe clothing-apk is already in mobile-apk)?
  • I tried installing apks from the SD card and phone memory
  • I have apks installed from unknown sources.

Thanks for your help and time - Botti560

+4
source share
2 answers

" APK" , "" . APK, , , "mobile-release.apk". settings.gradle include ':mobile', ':wear' present, build.gradle(Module: mobile)

dependencies {
    wearApp project(':wear')
}

/,

, , !

, , Android Studio. Android Studio 1.1.0 APK . -, , SDK, API (API 22).

, APK - . Android. SDK API 18 (4.3 Jelly Bean, API, Android Wear). Mini Wear SDK API 20 (Android 4.4 KitKat Wear).

APK - . ! , - , Android .

, gradle , - . , , .

, : build.gradle(Project: anAppImade), build.gradle(Moduble: mobile) build.gradle(: ) ()

build.gradle(Project: anAppImade)

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.0'

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

allprojects {
    repositories {
        jcenter()
    }
}

build.gradle(Moduble: mobile)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.0"

    defaultConfig {
        applicationId "com.ppltalkin.anappimade"
        minSdkVersion 18
        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'])
    wearApp project(':wear')
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.google.android.gms:play-services:6.5.87'
}

build.gradle(: )

apply plugin: 'com.android.application'


android {
    compileSdkVersion 22
    buildToolsVersion "22.0.0"

    defaultConfig {
        applicationId "com.ppltalkin.anappimade"
        minSdkVersion 20
        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.google.android.support:wearable:1.1.0'
    compile 'com.google.android.gms:play-services-wearable:6.5.87'
}
+1

, Android:

build.gradle :

dependencies {
   ...
   wearApp project(':wear')
}

> apk. .

, , . apk - , . .

.

+2

All Articles