Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App debug variants are not handled properly #143

Open
riyaz opened this issue Aug 30, 2016 · 4 comments
Open

App debug variants are not handled properly #143

riyaz opened this issue Aug 30, 2016 · 4 comments

Comments

@riyaz
Copy link

riyaz commented Aug 30, 2016

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'
}
@wangying3426
Copy link

+1

@wangying3426
Copy link

wangying3426 commented Sep 28, 2016

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.

@martijndebruijn
Copy link

+1

@NikitaKozlov
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants