0

As the title states, I'm having quite of a frustrating time trying to solve this. It seems like it could be a silly mistake that I have overlooked. The issue here is that I want to include the new Android Architecture Component ViewModel into my project structured as an Instant App. I have followed this guideline to add it as a dependency in build.gradle.

As the documentation states,

For LiveData, and ViewModel, add: implementation "android.arch.lifecycle:extensions:1.0.0"

Now in my AndroidStudio-generated Instant App project structure, I want to make this dependency available to all feature modules. So, I add the above line to my base module, but use the api keyword instead, in order for feature modules to be able to reference it like below

In base module's build.gradle:

api 'android.arch.lifecycle:extensions:1.0.0'

When I now go and add applicationIdSuffix ".dev" to my buildType in build.gradle in the base module, or even change the default applicationId, Android Studio suddenly does not recognize my Default Activity when attempting to run. I have double checked the default activity declaration in my AndroidManifest.xml multiple times, so it is definitely not that issue.

If I remove that dependency from build.gradle, the issue disappears completely and the Default Activity is recognized. This is really weird and would like to know if anyone experiences any issues similar to this.

Note: The Default Activity is declared in a feature module's AndroidManifest.xml

Yoshi3003
  • 91
  • 1
  • 5
  • @PragatiSingh Thanks for your response, it seems I have found another StackOverflow post with the same issue (see comments) https://stackoverflow.com/questions/47198686/android-architecture-components-with-instant-app. I will try to post a complete project that can reproduce this behavior. – Yoshi3003 Dec 01 '17 at 10:54
  • I hope your problems is resolved. – Prags Feb 23 '18 at 04:59

0 Answers0