i'm migrating an app from a single module app to a multimodule app. Im following this structure:
[Core] -> [App] -> [Feature]
I created the core module and the feature called wallet, using the File -> new -> new Module option in Android Studio and selected Android library.
In my core module i don't include any dependencies from the other modules, in my build.gradle from app i already included it using the following:
implementation project(":core")
implementation project(":wallet")
in my build.gradle from wallet which is the feature module, i included.
implementation project(':core')
And finally i can see they're in the settings.gradle
include ':app', ':core', ':wallet'
import com.mycompany.core.data.repository.WalletRepository
class WalletUseCaseImpl(walletRepository: WalletRepository) : WalletUseCase {
override fun getSavedOffers(): Boolean {
return true
}
}
I created a WalletUseCaseImpl which implements an interface, in the constructor i want to pass a repository let's call it WalletRepository when i'm typing the AndroidStudio suggest to import it. So i assume the Android Studio recognize the module dependencies.
Android Studio add this import, which is correct i can use cmd + b to go to the file and that's the file i'm using, everything is good.
This is the import: import com.companyname.core.data.repository.WalletRepository
The problem comes when i hit build i'm getting this errors from the Kotlin Compiler:
/Users/myuser/companyprojectname/wallet/src/main/java/com/example/wallet/data/usecase/WalletUseCaseImpl.kt: (3, 24): ** Unresolved reference: data **
Unresolved reference: OffersRepository
Things that i already do: Invalidate Cache/Restart ./gradlew clean ./gradlew build
Thanks in advance.