2017-09-12 8 views
0

に完全な対デモ私は2つのAPKをリリースしたいdemo_release.apkと店舗がPlayストア

を再生するためにfull_release.apkしかし

どのように私は、アプリの変更versionCodeのようなエラーを取得しています私はすでにapp_release.apk持っている2つの異なるバージョン

のバージョンコードを管理することは私が欲しいものversionCode 52

とPlayストアで提供され、両方のAPKをPlayストアでデモやフルバージョン解放することです。 しかし、私はそれが実際に動作し、ユーザーがこれはバージョンを管理する方法

apply plugin: 'com.android.application' 

allprojects { 
repositories { 
    jcenter() 
    maven { 
     url "https://maven.google.com" 
    } 
    } 
} 

android { 
compileSdkVersion 26 
buildToolsVersion '25.0.3' 

defaultConfig { 
    applicationId "com.credihealth.android" 
    minSdkVersion 16 
    targetSdkVersion 26 
    versionCode 52 
    versionName "4.2.1.1" 
} 

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

productFlavors { 

    demo { 
     applicationIdSuffix ".demo" 
    } 

    full { 
     applicationIdSuffix ".full" 
    } 
} 
} 

repositories { 
mavenCentral() 
flatDir { 
    dirs 'libs' 
} 


    } 

dependencies { 
compile(name: "youtube_player_api", ext: "jar") 
// this line must be included to integrate with Firebase 
// this line must be included to use FCM 

compile 'com.android.support:appcompat-v7:26.0.1' 
compile 'com.android.support:design:26.0.1' 
compile 'com.android.support:recyclerview-v7:26.0.1' 
compile 'com.android.support:palette-v7:26.0.1' 
compile 'com.android.support:cardview-v7:26.0.1' 
compile 'com.squareup.retrofit:retrofit:1.9.0' 
compile 'com.squareup.okhttp:okhttp:2.3.0' 
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4' 
compile 'com.roomorama:caldroid:2.2.1' 
compile 'com.facebook.android:facebook-android-sdk:4.7.0' 
compile 'com.uncopt:android.justified:1.0' 
compile 'com.yayandroid:LocationManager:2.0.3' 
compile 'com.google.android.gms:play-services-plus:11.0.1' 
compile 'com.google.android.gms:play-services-location:11.0.1' 
compile 'com.google.android.gms:play-services-auth:11.0.1' 
compile 'com.google.android.gms:play-services-analytics:11.0.1' 
compile 'com.google.android.gms:play-services-maps:11.0.1' 
compile 'com.hbb20:ccp:1.7.6' 
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1' 
compile 'com.github.aakira:expandable-layout:[email protected]' 
compile 'com.google.firebase:firebase-core:11.0.1' 
compile 'com.google.firebase:firebase-messaging:11.0.1' 
compile 'com.stepstone.stepper:material-stepper:3.3.0' 
compile 'com.android.support.constraint:constraint-layout:1.0.2' 
fullCompile 'com.twilio:video-android:1.3.0' 
} 

apply plugin: 'com.google.gms.google-services' 

答えて

0

私のbuild.gradleファイルでデモやアプリ

のフルバージョンをダウンロードすることができますどのように方法についてはあまりにも混乱しています2つの異なるバージョンのコード

各フレーバのバージョンコードをカスタマイズできます。たとえば

productFlavors { 
    demo { 
     applicationIdSuffix ".demo" 
     versionCode XX 
    } 
    full { 
     applicationIdSuffix ".full" 
     versionCode XX 
    } 
} 

私が欲しいものは、PlayストアでのAPKのデモとフルバージョンの両方を解放することです。しかし、私はそれが実際にどのように動作するかについて、あまりにも混乱していますし、ユーザーがデモやアプリ

のフルバージョンをダウンロードすることができますどのように設定をbuild.gradleに関係なく、それはあなたの選択によって左右される。

+0

2種類のバージョンコードの管理方法について –

+0

@ShailendraSachanとはどういう意味ですか? 2つのapkがあり、それぞれに1つのバージョンコードがあります。 –

+0

バージョンコード1のデモとバージョンコード1で完全に同時に存在することはできません。バージョンコード1の2つのフレーバデモとバージョンコード2の完全なバージョンコードを別々に割り当てる必要があります。今度はバージョンコード3で次回のデモをバージョンアップし、バージョンコード4でいっぱいにします。 –

関連する問題