I got an error I had not before:
Execution failed for task ':app:generateDebugBuildConfig'.
> Failed to calculate the value of task ':app:generateDebugBuildConfig' property 'buildConfigPackageName'.
> Failed to query the value of property 'packageName'.
> java.lang.NumberFormatException: For input string: "${versionCode}"
The android studio version is:
Android Studio 4.1.1
Build #AI-201.8743.12.41.6953283, built on November 5, 2020
Runtime version: 1.8.0_242-release-1644-b3-6222593 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
The build.gradle(:app) file contains the following:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' //< for image visualization with glide
//Serialization
apply plugin: 'kotlinx-serialization'
android {
signingConfigs {
release {
storeFile file('xxxx.jks')
storePassword 'xxxxxxx'
keyPassword 'xxxxxxxx'
keyAlias 'my-app'
}
}
compileSdkVersion propCompileSdkVersion
buildToolsVersion propBuildToolsVersion
defaultConfig {
applicationId "com.user.myapp"
minSdkVersion propMinSdkVersion
targetSdkVersion propTargetSdkVersion
versionCode 3
versionName "2.0-beta.26"
manifestPlaceholders = [versionCode:"3", versionName:"2.0-beta.26"]
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
applicationIdSuffix ".debug"
debuggable true
resValue "string", "app_name", "myapp-dev"
}
optimizedDebug {
initWith debug
minifyEnabled false
applicationIdSuffix ".optimizedDebug"
debuggable false
resValue "string", "app_name", "myapp-optimized-dev"
}
debugProd {
initWith debug
minifyEnabled false
applicationIdSuffix ".debugProd"
debuggable true
resValue "string", "app_name", "myapp-logs-in-prod"
}
release {
minifyEnabled false
resValue "string", "app_name", "myapp"
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
applicationVariants.all { variant ->
variant.resValue "string", 'images_file_path', "Android/data/\"${applicationId}\"/files/Pictures"
}
/* Necessary to have Parcelable / @Parcelize functionalities */
androidExtensions {
experimental = true
}
lintOptions {
checkReleaseBuilds false
abortOnError true
}
}
dependencies {
...
}
repositories {
mavenCentral()
}
I have invalidated the caches and restarted several times, nothing changes. I would like to pinpoint exactly what happens, to at least be able to understand what causes gradle to be confused. Can anyone point me to a step by step run of gradle to find what is the problem ?