Skip to content

Dynamic feature unit test referencing base module class issue #388

@deividasstr

Description

@deividasstr

Description

I am not sure if I am reporting this issue in the appropriate place, please direct me if I am mistaken.

When running unit test through gradle command in the dynamic feature module where a class from base module is referenced, test fails with

com.example.dynamic_feature.DynamicClassTest > test FAILED
    java.lang.NoClassDefFoundError at DynamicClassTest.kt:13
        Caused by: java.lang.ClassNotFoundException at DynamicClassTest.kt:13

If the test is run through android studio, test runs successfully

Expected Results

Test succeeds

Actual Results

Test fails with the above exception.

Link to a public git repo demonstrating the problem:

https://github.com/deividasstr/robolectric-dynamic-module/tree/dynamic-feature-unit-test-issue
use command gradlew :dynamic_feature:testDebugUnitTest --tests *DynamicClassTest o run the test.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions