horaas opened a new issue #1356:
URL: https://github.com/apache/cordova-android/issues/1356
# Bug Report
**Not run android apk with multiple Flavors, when using the command "cordova
run android"**
## Problem
### What is expected to happen?
the app is expected to run with custom flavors
### What does actually happen?
I have the following configuration
**my build-extras.gradle**
def outputFileNameGeneral
def fileName
if (project.hasProperty('projectName')) {
fileName = projectName
} else {
fileName = project.name
}
def environmentProperties = new Properties()
def hascountryProperties = rootProject.file("environment.properties")
def cdvBuildEnvironment
def manifest = new
XmlSlurper().parse(file(android.sourceSets.main.manifest.srcFile))
if (hascountryProperties.exists()) {
environmentProperties.load(new FileInputStream(hascountryProperties))
cdvBuildEnvironment = environmentProperties['cdvBuildEnvironment']
}
android {
useLibrary 'org.apache.http.legacy'
buildTypes {
debug {
debuggable true
}
release {
debuggable false
}
}
flavorDimensions "environment"
productFlavors {
if (cdvBuildEnvironment == "developer") {
developer {
dimension "environment"
buildConfigField "String", "environment", "\"dev\""
}
}
if (cdvBuildEnvironment == "production") {
production {
dimension "environment"
buildConfigField "String", "environment", "\"prod\""
}
}
}
outputFileNameGeneral =
"${fileName}-${cdvBuildEnvironment}-${manifest."@android:versionCode".text()}"
setProperty("archivesBaseName", "${outputFileNameGeneral}")
}
android.applicationVariants.all { variant ->
variant.outputs.all { output ->
outputFileName = "${outputFileNameGeneral}.apk"
}
}
my enviroment.properties
`cdvBuildEnvironment=developer or production`
### Command or Code
<!-- What command or code is needed to reproduce the problem? -->
when using the command **"cordova run android"**
the following result is obtained
`platforms/android/app/build/outputs/apk/developer/debug/app-developer-10000.apk`
in console
`Could not find any APKs to deploy`
### Version information
<!--
What are relevant versions you are using?
For example:
Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
Other Frameworks: Ionic Framework and CLI version
Operating System, Android Studio, Xcode etc.
-->
`cordova cli 10.0.0`
`cordova android 10.1.1`
`npm 7.13.0`
`node 14.17.0`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]