Gradle: how do I include a local jar from a dependent java project in an Android build?

前端 未结 2 1968
盖世英雄少女心
盖世英雄少女心 2020-12-09 11:41

In my Android app, I\'m getting a java.lang.NoClassDefFoundError when the code that references code in a dependent .jar is executed. My project includes an Andr

2条回答
  •  [愿得一人]
    2020-12-09 11:57

    In recent (4+, IIRC) versions of gradle, you can achieve this with the following configuration:

    compile (project(':ProjectIDependOn')) {
      transitive = true
    }
    

    Setting transitive to true when depending on another project will expose all of that project's libraries to this project.

提交回复
热议问题