Closed yoontaeseong closed 2 years ago
It looks like you're trying to make the library build a staging
variant, which isn't a standard Android thing (just something unique to your build).
Do you have a reproduction project I could take a look at?
There are some unpublishable codes, so I brought sample codes temporarily.
Below code is BuildTypes based on app/build.gradle
android {
buildTypes {
debug {
signingConfig = signingConfigs.getByName("release")
applicationIdSuffix = ".debug"
....
}
release {
signingConfig = signingConfigs.getByName("release")
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
...
}
create("staging") {
signingConfig = signingConfigs.getByName("release")
isMinifyEnabled = false
isDebuggable = true
}
baseCommonBuildConfigField() // just extension func
}
}
dependencies {
...
implementation("net.danlew:android.joda:2.10.14")
...
}
I researched the issue and the problem is that your app includes a build type ("staging") that the library dependency (joda-time-android) does not have.
The solution is to use matchingFallbacks
, as described here. Here's an example:
create("staging") {
// ...your code...
matchingFallbacks = ['debug', 'release']
}
Summary
Using version 2.10.14, When using the library, the following error occurs only in buildTypes (Build Variant) staging. There is no error in release and debug
This issue does not occur in 2.10.7.2, but it seems to occur in the latest version 2.10.14.
Below is a summary of the error.
An error like this:
Versions
My guess is that the library doesn't support the staging build variant. or Did I miss something?