0

So I just moved an activity into our first dynamicModule. I'm trying to navigate to that activity with the following code:

    private enum class ACTIVITIES(val location: String) {
  EXAMPLE_ACTIVITY("com.example.feature_member_home.ExampleActivity"),//com.example.feature_member_home
  REFERRAL_SELECTION_ACTIVITY("com.sofi.mobile.feature_example.ReferralSelectionActivity")//com.sofi.mobile.feature_referrals.ReferralSelectionActivity
}

@Throws(LinkageError::class, ExceptionInInitializerError::class, ClassNotFoundException::class)
fun locateReferralSelectionActivity(context: Context): Intent {
  try {
    return Intent(context, Class.forName(ACTIVITIES.REFERRAL_SELECTION_ACTIVITY.location))
  } catch (e: Exception) {
    throw e
  }
}

but the line Class.forName(ACTIVITIES.REFERRAL_SELECTION_ACTIVITY.location) gives an error ClassNotFoundException on path DexPathList

Any ideas what I'm doing wrong?

Dan Anderson
  • 1,062
  • 13
  • 26
  • With the comment, are you typo package name with `feature_referrals` & `feature_example`? – NamNH Sep 05 '19 at 01:00
  • @NamNH no I've double and triple checked the package name. – Dan Anderson Sep 05 '19 at 15:02
  • Hm, because I saw that `com.sofi.mobile.feature_example.ReferralSelectionActivity` && your comment `//com.sofi.mobile.feature_referrals.ReferralSelectionActivity` . In this case, you may try to `invalidate cache & restart android studio` or enable `multiDexEnabled` in your app `build.gradle` file. – NamNH Sep 06 '19 at 02:43

0 Answers0