久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Android Wear 應(yīng)用程序打包失敗

Android wear application packaging fails with flavours(Android Wear 應(yīng)用程序打包失敗)
本文介紹了Android Wear 應(yīng)用程序打包失敗的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我有一個包含穿戴應(yīng)用程序的應(yīng)用程序.在使用真實設(shè)備進行調(diào)試測試時一切正常.我還可以創(chuàng)建將磨損 apk 打包在其中的發(fā)布 apk.但前提是我的應(yīng)用程序只有一種風(fēng)格.

I have an application that includes a wear app. All works fine on debug tested with a real device. I can alse create the release apk that packs the wear apk inside it. But only if there is only one flavour on my application.

我想維護具有不同 applicationId 的應(yīng)用程序的兩個版本,但是盡管編譯沒有錯誤,但在這種情況下,兩個發(fā)布 apk(每種風(fēng)格一個)不包含相應(yīng)的磨損 apk.

I want to maintain two versions of the application with different applicationId, but although this compile without errors, in this case the two release apks (one of each flavour) don't cointain the corresponding wear apks.

這是移動應(yīng)用 build.gradle 的相關(guān)部分:

This is the relevant part of the mobile app build.gradle:

    productFlavors {
    Trial {
        applicationId "com.example.myapp.trial"
        versionName "3.0.1"
        versionCode 301
    }
    Full {
        applicationId "com.example.myapp"
        versionName "3.0.1"
        versionCode 301
    }
}

}

dependencies {
    compile 'com.google.android.gms:play-services:6.1.+@aar'
    wearApp project(':myWearApp')
}

這是對應(yīng)的wear app build.gradle:

And this is the correspondig wear app build.gradle:

productFlavors {
    Trial {
        applicationId "com.example.myapp.trial"
        versionName "3.0.1"
        versionCode 301
    }
    Full {
        applicationId "com.example.myapp"
        versionName "3.0.1"
        versionCode 301
    }
}

}

dependencies {
    compile 'com.google.android.support:wearable:1.0.0'
    compile 'com.google.android.gms:play-services-wearable:6.1.71'
}

歡迎任何幫助.謝謝.

推薦答案

感謝 Scott 給我的線索,這是完整的解決方案:

Thanks to the clue Scott gave me this is the full solution:

1.) 味道必須小寫

2.) 依賴配置必須包含flavorRelease

2.) dependency configurations must include flavorRelease

3.) 在 Wear app build gradle 中,在 android{} 下,我們必須包含 publishNonDefault true

3.) In Wear app buil gradle, under android{}, we must include publishNonDefault true

所以對于移動應(yīng)用 build.gradle:

So for mobile app build.gradle:

android {

......

productFlavors {
    trial {
        applicationId "com.sample.myapp.trial"
        versionName "3.0.1"
        versionCode 301
    }
    full {
        applicationId "com.sample.myapp"
        versionName "3.0.1"
        versionCode 301
    }
 }
}

dependencies {
    trialWearApp project(path: ':myWearApp', configuration: 'trialRelease')
    fullWearApp project(path: ':myWearApp', configuration: 'fullRelease')
}

對于穿戴應(yīng)用程序 build.gradle:

And for wear app build.gradle:

android {

  publishNonDefault true
......

productFlavors {
    trial {
        applicationId "com.sample.myapp.trial"
        versionName "3.0.1"
        versionCode 301
    }
    full {
        applicationId "com.sample.myapp"
        versionName "3.0.1"
        versionCode 301
    }
 }
}

這篇關(guān)于Android Wear 應(yīng)用程序打包失敗的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

IncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出現(xiàn) IncompatibleClassChangeError)
How to get current flavor in gradle(如何在 gradle 中獲取當(dāng)前風(fēng)味)
How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修復(fù)“意外元素lt;查詢gt;在“清單中找到錯誤?)
Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多風(fēng)味庫的多風(fēng)味應(yīng)用)
Android dependency has different version for the compile and runtime(Android 依賴在編譯和運行時有不同的版本)
Transitive dependencies for local aar library(本地 aar 庫的傳遞依賴)
主站蜘蛛池模板: 亚洲精品久久久 | 9999视频| 国产精品中文字幕在线 | 成人三级在线观看 | 亚洲精品日韩一区二区电影 | 三级成人在线观看 | 黄色毛片在线看 | 国产一区二区久久久 | 99免费视频 | www.黄网| 国产一级在线观看 | 国产美女在线观看 | 日本免费一区二区三区 | 精品一二区| 天天爽夜夜骑 | 91亚洲国产成人久久精品网站 | 国产精品美女一区二区三区 | av男人的天堂在线 | 亚洲美女天堂网 | 精品伦精品一区二区三区视频 | 在线免费观看亚洲 | 亚洲大片 | 精品一区二区三区四区 | 久久久久亚洲精品 | 欧美精品成人一区二区三区四区 | 国产激情偷乱视频一区二区三区 | 亚洲一区二区av | 操操日| 999久久久久久久久 国产欧美在线观看 | 成人九色 | 精品1区 | 中日av | 亚洲高清在线 | 成人乱人乱一区二区三区软件 | 日韩和的一区二区 | 在线观看日韩精品视频 | 国产精品亚洲精品 | 伊人精品在线 | 91麻豆精品国产91久久久更新资源速度超快 | 91亚洲国产成人精品一区二三 | 亚洲欧洲综合av |