Multiple modules - moxy-community/Moxy GitHub Wiki

Multi-modular apps require almost no additional setup.

  1. Follow the Getting started guide for your main app module.

  2. In each library module that has Moxy-powered screens, add moxy-compiler dependency as described in the guide:

Java

dependencies {
  // ...
  annotationProcessor "com.github.moxy-community:moxy-compiler:$moxyVersion"
}

Kotlin

apply plugin: 'kotlin-kapt'
// ...
dependencies {
  // ...
  kapt "com.github.moxy-community:moxy-compiler:$moxyVersion"
}

Don't forget about Java 8:

android {
  // ...

  // For Java-only projects use only this
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }

  // For Kotlin and mixed projects also add this
  kotlinOptions {
    jvmTarget = "1.8"
  }
}

That's it, you're all set!