-5

The purpose of posting images is to spot the errors easily as it is not the normal manifest file.

I'm trying to display Google Maps inside an instant app application. Now the application gets installed successfully (and runs smoothly) if I try to run it via app module i.e. normal install (which means I have included all the necessary gradle dependencies and API key) but if I try to run it as an instant app (not instant run) I'm facing this error:

this

and it takes me to debug/xml file:

enter image description here

enter image description here

Any idea?

halfer
  • 19,824
  • 17
  • 99
  • 186
Daksh Gargas
  • 3,498
  • 2
  • 23
  • 37
  • First, please post text, not images of text. Second, the stacktrace tells you the resource @integer/google_play_services_version does not exist. So there's your problem. – wvdz Jul 13 '17 at 07:56
  • hah! Like I haven't checked it. It is a debug/xml file which means it created dynamically and I can't edit it. And read the problem carefully, it is working fine if I run the application normally. – Daksh Gargas Jul 13 '17 at 08:04
  • who so ever downvoted this question: WHY? – Daksh Gargas Jul 13 '17 at 09:08
  • Unclear of what I'm asking? Are you even aware of Android instant apps? – Daksh Gargas Jul 13 '17 at 09:10

1 Answers1

4

This problem occurs when you include the google-play-services dependency in a non-base feature module. The underlying issue is that although the

<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />

element is added to the base feature's AndroidManifest.xml, the referenced id (@integer/google_play_services_version) is not available since the dependency is defined, and scoped, in another feature module.

The easiest, and most maintainable, workaround is to add the google-play-services dependency to the base feature module. Everything included in the base is available to non-base features, but as this error shows the opposite is not true.

dscannell
  • 221
  • 1
  • 3
  • I did, still didn't work. Were you successfully able to do it? – Daksh Gargas Aug 17 '17 at 19:26
  • Dennis - dscannell's suggestion should work (moving com.google.android.gms:play-services... dep from feature to base build.gradle file). Can you post your build.gradle files which aren't working? – zavidovych Aug 28 '17 at 21:28