0

Different Module Activity

Hi, i've been trying to access DetailActivity in feature_profile module (Dynamic Feature Module) from MainActivity, but no luck. I've tried to access it with Class.forName("com.dynamicfeature.feature.profile.DetailActivity") and it throws an java.lang.ClassNotFoundException

Am i missing something? has anyone overcome this? Would like to hear if you guys have a solution :) Thank you

Kevin Gozali
  • 319
  • 1
  • 3
  • 9
  • 1
    Hi. Did you add the `feature_profile` module as `dependency` in your `build.gradle` file? – name not found Apr 15 '20 at 08:22
  • @namenotfound Hi, i did add it as dynamic feature in my App Build.gradle. Like this: dynamicFeatures = [":feature_profile"]. Then in my feature_profile i added api project(':app') – Kevin Gozali Apr 15 '20 at 11:10
  • I don't know what `dynamicFeatures` are but I guess you need to add dependency with `compile project(':your-module')`. Maybe take a look at [the gradle doc](https://guides.gradle.org/creating-multi-project-builds/) – name not found Apr 15 '20 at 11:20
  • turns out i need to put: apply plugin: 'kotlin-android' in my dynamic module :) thank for pointing it out @namenotfound – Kevin Gozali Apr 15 '20 at 13:12

1 Answers1

0

Turns out i need to put apply plugin: 'kotlin-android' in my dynamic module build.gradle

Kevin Gozali
  • 319
  • 1
  • 3
  • 9