hugo
hugo copied to clipboard
App debug variants are not handled properly
If your app exceeds 65K limit and you use new variant just for development purpose, Hugo might not work properly, reason being in HugoPlugin.groovy only debugCompile is added as dependency.
Workwround is to manually add dependency in your build.gradle like below
if suppose devBuild
is your variant you want to enable Hugo then add like below
dependencies {
devBuildCompile 'com.jakewharton.hugo:hugo-runtime:1.2.1'
}
+1
Our project has two subprojects, main and base, and main depends upon base. When I execute ./gradlew :main:assembleDebug, :base:bundleRelease will be executed. So hugo-runtime library will not be packed in.
+1
The problem has nothing todo with Hugo. It is the way Gradle resolves dependencies, from gradle docs:
By default a library only publishes its release variant. This variant will be used by all projects referencing the library, no matter which variant they build themselves. This is a temporary limitation due to Gradle limitations that we are working towards removing.
You need to allow library to publish its debug variant by adding this code into library's build.gradle file:
android {
defaultConfig {
defaultPublishConfig 'release'
publishNonDefault true
}
}
Then force the module that depends on your library to grab debug
version in debug
build:
dependencies {
debugCompile project(path: ':app2', configuration: "debug")
releaseCompile project(path: ':app2', configuration: "release")
}
For more info check Gradle docs.