包装耐磨应用 [英] Packaging wearable apps

查看:264
本文介绍了包装耐磨应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在开发针对Android设备的磨损一个表盘服务的最后阶段。问题是:
每次我尝试登录我的应用程序,正在生成两个文件:耐磨release.apk和移动release.apk,没有其他的apk。不应该的APK名字是我的projectdirectory的PACKAGENAME?
- 因为我试图打开我的智能手机兼容的两个文件(附加有weardevice),它总是在措辞错误结束瞬间。

I'm in the last stage of developing a watchface service for the android wear devices. The problem is the following: Every time i try to sign my app, two files are being generated: wear-release.apk and mobile-release.apk , there is no other apk. Shouldnt the apk name be my Packagename of the projectdirectory? -Because i tried opening both files with my compatible Smartphone (with a weardevice attached), which always ends instantly in a phrasing error.

Thinngs我已经注意到:

Thinngs i have noticed:


  • 有一个在移动版包Android Studio中
  • 没有内容
  • 的权限仅在移动清单(也试图与权限是两个舱单)
  • 提及
  • 这是一个正常的werable表盘没有配置活动

  • IHE移动释放APK是远远比啤酒的磨损APK虽然我有几乎没有放置在移动部分。 ( - >好,也许耐磨APK已经在移动APK)

  • 我试图从SD卡和手机内存
  • 安装的APK
  • 我安装来源不明的APK打开。

  • There is no content in the mobile version package in Android Studio
  • The permissions are only mentioned in the mobile Manifest (also tried with the permissions being on both manifests)
  • it's a normal werable watchface with no config activity
  • Ihe mobile-release apk is way lager than the wear-apk although i have nearly nothing placed in the mobile part. (--> good ,maybe wear-apk is already in the mobile-apk)?
  • I tried to install the apks from the SD card and the phone memory
  • i have install apks from unknown sources turned on.

感谢您的帮助和放大器;时间-Botti560

Thanks for your help & time -Botti560

推荐答案

在点击生成签名APK确保模块移动是从下拉选择了。生成APK含有耐磨和移动模块将被命名为移动release.apk。也settings.gradle应该有包括':移动',':穿' present还的build.gradle(模块:手机)应该有

After clicking "Generate Signed APK" Make sure module "mobile" is selected from the drop down. The generated APK containing both wear and mobile modules will be named "mobile-release.apk". Also settings.gradle should have include ':mobile', ':wear' present and also build.gradle (Module: mobile) should have

dependencies {
    wearApp project(':wear')
}

修改更多的内容/澄清如下补充

本编辑好希望我可以帮你解决你的问题!

OK with this edit hopefully I can help you solve your issues!

首先,请确保您运行的是Android工作室的最新稳定版本。作为今天的日期的最新版本的是Android 1.1.0工作室
我previously有一些问题在早期版本生成APK签署。其次要确保你有拥有最新的SDK文件,包括最新的API(API 22)。

First off, make sure you are running the latest stable version of Android Studio. As of today's date the latest version is Android Studio 1.1.0 I previously had some issues generating a signed APK on an earlier version. Second make sure you have have the latest SDK files including the latest API (API 22).

一旦你有这样的设置中,如果产生一个被烫伤的APK为您的应用程序仍然不能正常工作。我会尝试进行新的Andr​​oid项目。设置最小的SDK手机API 18(4.3果冻豆,最低的API级别与Android Wear兼容)。并设置最小磨损SDK API到20(Android 4.4的奇巧磨损)。

Once you have this setup, if generating a singed APK for your app still does not work. I would try making a new android project. Set Minimum SDK for phone to API 18 (4.3 Jelly Bean, the lowest API level compatible with Android Wear). And set the Minimum Wear SDK to API 20 (Android 4.4 KitKat Wear).

然后尝试生成这个新项目的签约APK而不做任何更改。这应该工作!如果您仍然有问题,则是非常严重的犯规了,我只想从头重新安装Android的工作室。

Then try to generate a signed APK of this new project without making any changes to it. THIS SHOULD WORK! If you are still having issues, then something is seriously fouled up and I would just reinstall Android studio from scratch.

如果这个新项目确实工作,然后注意这方面的工作项目的清单和gradle这个文件和其他非工作之一之间的任何差别。你发现任何差异很可能是您的问题。

If this new project does indeed work, then take note of any differences between the manifest and gradle files of this working project and your other, non working one. Any discrepancies you find might very well be your issue.

最后三个文件:的build.gradle(项目:anAppImade)的build.gradle(Moduble:手机),和的build.gradle(模块:穿)应该是这个样子(分别)本

Finally three files: build.gradle (Project: anAppImade), build.gradle (Moduble: mobile), and build.gradle (Module: wear) should look something like this (respectively)

的build.gradle(项目: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:移动)

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

这篇关于包装耐磨应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆