Here are steps to do that:
- Make a file
build-extras.gradle
and put it into platforms/android/
. Add line cdvBuildMultipleApks=false
into build-extras.gradle
.
- Now run
ionic run android
, it will create combined single build android-debug.apk
.
build.gradle
will automaticaly import build-extras.gradle
,if that is defined.You can see code of build.gradle
doing this :
def hasBuildExtras = file('build-extras.gradle').exists()
if (hasBuildExtras) {
apply from: 'build-extras.gradle'
}
Plus these instructions are clearly mentioned in build.gradle
line 57 :
Configuration properties. Set these via environment variables,
build-extras.gradle, or gradle.properties.
NOTE: Before you follow these steps, remove platform folder and install again.
Observations: Once you have done these steps, and again at some point, you want to make separate builds, then setting cdvBuildMultipleApks=true
or commenting out sometimes won't work, you will simply have to install platform again. (P.S this is my personal observation, otherwise deleting build-extras.gradle
should be enough.)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…