Litho: Litho loses access to Yoga Sources for version 0.4.0

Created on 12 Jul 2017  路  9Comments  路  Source: facebook/litho

Version

Add the version of the litho packages you use. You can paste the dependency
section of the gradle file if you have one.

compile 'com.facebook.litho:litho-core:0.4.1'
compile 'com.facebook.litho:litho-widget:0.4.0'
provided 'com.facebook.litho:litho-annotations:0.4.0'
annotationProcessor 'com.facebook.litho:litho-processor:0.4.0'
    // SoLoader
compile 'com.facebook.soloader:soloader:0.2.0'
    // Optional
    // For debugging
debugCompile 'com.facebook.litho:litho-stetho:0.4.0'
    // For integration with Fresco
compile 'com.facebook.litho:litho-fresco:0.4.0'

After updating to litho package versions 0.4.0, it cal no longer find any Yoga source files that may be loaded by SoLoader. On going back to version 0.3.1, it successfully built and deployed.

Issues and Steps to Reproduce

Upgraded Litho libraries to version 0.4.0

Expected Behavior

When any Yoga reference is made in a Spec file, it cannot be found with version 0.4.0

Link to Code

        Column.create(c)
                    .widthPercent(70)
                    .marginDip(YogaEdge.ALL, 8)
                    .alignSelf(YogaAlign.BASELINE)
                    .heightPercent(100)

All 9 comments

@passy Could you have a look?

Thanks for the report!

After updating to litho package versions 0.4.0, it cal no longer find any Yoga source files that may be loaded by SoLoader.

What exactly does this mean? Is that at build time or run time? Could you post the error message you're seeing?

@passy Can't import yoga packages such as com.facebook.yoga.YogaEdge which is using in some layout api(eg. paddingDip(YogaEdge edge, @Dimension(unit = DP) int padding);)

Should I add yoga dependence manually in build.gradle?

Oh, I can see why now, thanks @simpleton for the explanation. The POM file published by the new version of the gradle file doesn't seem to include the dependencies, even when marked as api. So yes, it would be necessary for now to include yoga explicitly. I'll look into a fix for this.

I found the cause for this: The plugin we use for generating the POMs based on our Android dependency declarations hadn't been updated for the new dependency formats yet: https://github.com/dcendents/android-maven-gradle-plugin/issues/61

It looks like the version on master already supports it, so I will try to publish a new release with that yesterday and, if that doesn't work, revert back to the old-style declarations until we have a new version.

I've just released a new version that should address the issue: https://github.com/facebook/litho/releases/tag/v0.4.1

Could you check if this fixes your problem?

That seems to have done it! Thanks @passy 馃檹馃徑

@passy It works now, thanks for your quick fix.

Fabulous! Thanks for confirming! :)

Was this page helpful?
0 / 5 - 0 ratings