Questions tagged [android-multi-module]
29 questions
4
votes
1 answer
Android R.string ids mix in multi-module tests
My app is implemented as a multi-module project (with dynamics module), where there is a shared module with espresso tests. These espresso tests give me different outcomes depending if I run them from Android Studio or from the command line.
The…

jgarciabt
- 559
- 1
- 5
- 19
4
votes
0 answers
How to make a data class Parcelable in a Kotlin library in multi-module Android project?
I am trying to break my android app into smaller gradle modules (for now data and model modules). I want to keep my model module as a Kotlin library because it will only contains data classes. But some of those data classes are Parcelable. To use…

Arpit Shukla
- 9,612
- 1
- 14
- 40
4
votes
0 answers
Dagger Multi Module -- ViewModelProvider.Factory cannot be provided without an @Provides-annotated method
I am working on applying the multi module structure with dagger to my project.
I am getting error while working on ViewModelFactory. What I actually want to do for the ViewModelFactory is this:
I want to have the app module provide the…

Emre Memil
- 233
- 3
- 5
2
votes
1 answer
Android - how to migrate from LintOptions to Lint in a plugin of a multi-module app
I have a multi-module app which uses a plugin to handle common settings for modules. One of the things I configure are some lint options. So far this was my implementation:
class MyPlugin : Plugin {
override fun apply(project: Project)…

suue
- 295
- 6
- 17
2
votes
1 answer
Android Macrobenchmark module doesn't recognise 'com.android.test' plugin
I'm trying to put the MacroBenchmark library in my project, but I'm getting an error to apply com.android.test the plugin. This error happens while syncing Gradle.
I've added the plugin root gradle using the same AGP version (7.3.1). I'm also using…

Artur Schaefer
- 31
- 6
2
votes
0 answers
Hilt dependency injection in multi-module project
I have two modules in my android app, app and data. data module contains retrofit dependency and app module depends on data module.
app/build.gradle:
implementation project(':data')
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt…

Arpit Shukla
- 9,612
- 1
- 14
- 40
1
vote
1 answer
Android App module's build.gradle.kts Unresolved reference error when importing a Kotlin class from an included (composite) module
In the #NowInAndroid sample app a Kotlin file NiaBuildType from an included module is being imported in the app modules build.gradle.kts file.
###build.gradle.kts (:app)
import com.google.samples.apps.nowinandroid.NiaBuildType
I have tried…

Amir
- 1,290
- 1
- 13
- 20
1
vote
0 answers
How to generate a module with empty res files
Whenever I'm creating a new module I find myself annoyed that it does not come with a generated res directory for colors, strings etc. It is quite annoying that I have to create it within every feature-module and also I cannot find a way to create…

JustSightseeing
- 1,460
- 3
- 17
- 37
1
vote
1 answer
Unresolved reference BuildConfig.field
I'm working on a multi-module project. In a module called network I'm providing the instance of Retrofit through Hilt dependency injection and works fine, I can compile the app, and run unit and instrumentation tests but when I try to execute all…

Oscar Ivan
- 819
- 1
- 11
- 21
1
vote
1 answer
New Module will not use Version catalog information - Android studio Gradle Dependency management
Hi I'm using gradle catalog feature (libs.versions.toml) . this is OK , but when I want to use multiple module in my android project I have an error in build.gradle .
My config :
libs.version.toml
[versions]
gradleplugin = "7.4.0-alpha09"
kotlin =…

Hossein Zafari
- 29
- 4
1
vote
1 answer
Android Room with Dagger 2 in a multi-module
Is there a way or approach to provide a Room DB instance from a module/library which can be consume on any project (app module)?
The problem I am facing is the abstract class that extends RoomDatabase() lies in our app module and there we define our…

Bitwise DEVS
- 2,858
- 4
- 24
- 67
1
vote
0 answers
Android Two-way binding and @InverseBindingAdapter doesn't work in Modular Architecture project
Having Modular Architecture project. Reusable custom views are being moved to core-ui module. Features (fragments, sheets, etc) at the moment are still in app module.
Before migrating custom views with @InverseBindingAdapter (two-way binding) from…

Justin
- 51
- 1
- 5
1
vote
0 answers
Android Studio: Submodules in Project Structure Hierarchy
I am building a multi-module app, and I have included the modules in the project-level settngs.gradle file, in this manner:
include(":sub_module_1")
project(":sub_module_1").projectDir =…

iSofia
- 1,412
- 2
- 19
- 36
0
votes
0 answers
Android, Gradle, Kotlin-dsl, multi-module, centralize android blocks for application and library, as well as dependencies?
Gradle - 8.2.1, AGP - 8.0.2, Kotlin - 1.9.0
buildSrc/build.gradle.kts
plugins {
`kotlin-dsl`
}
dependencies {
implementation("com.android.tools.build:gradle-api:8.0.2")
}
gradle/support/common-app-config.gradle.kts
plugins {
…

AndroidRocks
- 292
- 4
- 16
0
votes
1 answer
What would be the best type of class to use for a module representation?
To clarify the title:
I've got a multi-module app that has 5 feature-modules, I've set up navigation etc. but currently for my bottom navigation bar everything is hard-coded, the paths to graphs + icons + titles, I'm trying to find a way to create a…

JustSightseeing
- 1,460
- 3
- 17
- 37