I want to to have a string version in build config for my library module
I am using the below code
android {
ext{
version = 'NW-1.1.6'
name = 'Network'
}
defaultConfig {
buildConfigField "String", "LIBRARY_VERSION","${version}"
}
But in my build config I see it as
public static final String LIBRARY_VERSION = NW-1.1.6;
instead of
public static final String LIBRARY_VERSION = "NW-1.1.6";
What is wrong with the above code
>Solution :
Just use the following
defaultConfig {
buildConfigField "String", "LIBRARY_VERSION","\"${version}\""
}
this will produces the string you need:
public static final String LIBRARY_VERSION = "NW-1.1.6";