-1

I am trying to use firebase's real-time database with android instant app. Looking at google doc for using the real-time database, I do have bit of idea. However the example that google provide is base on android app, not the instant one. As you know that there are multiple modules for instant app. base, app, feature(default name suggested by android studio). Should I add firebase packages in each of appGriddle, baseGriddle and appGriddle?

What about the JSON file generated by firebase... where should I place that JSON file? If the app is not instant one, I know that I just need to place it in app..There are multiple modules...

I try to do it with android studio's firebase tool for configuration. However it does not work. I looked up others attempt;changing "implement" to "api"... It does not work either.

Please let me know if you know a way to deal with instant app and firebase's real-time database together

Thank you.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
HanJo Jang
  • 23
  • 1
  • 4
  • I followed https://firebase.google.com/docs/database/android/start/ and had no issues with integrating Firebase database with my multi-feature app. You need to place google-services.json file and firebase-db dependency (api 'com.google.firebase:firebase-database:16.0.1') into base module (base/build.gradle). Plugin 'com.google.gms.google-services' should be also applied in base module build.gradle. – Julia K Jun 18 '18 at 20:55
  • Thanks for the comment. It seems you are tackling the base module. However, When I try to make a connection with firebase, I can do only app(=installed) and instant module. Despite I do not make connection with base module, are you saying that the base module can connect to firebae? – HanJo Jang Jun 18 '18 at 21:19
  • By doing your way, I have versioning problem. When I have a look base/build.gridle, I get the versioning error with 'com.android.support:appcompat-v7:27.1.1'. It conflicts with version 26.1.0. Have you had same problem? – HanJo Jang Jun 19 '18 at 18:03
  • I haven't ran into any versioning problems. Check out this post about support libs versioning errors https://stackoverflow.com/questions/42374151 – Julia K Jun 19 '18 at 20:57
  • As for the firebase connection issue, are you using Firebase Assistant? If so, try to do this manually: https://firebase.google.com/docs/android/setup#manually_add_firebase – Julia K Jun 19 '18 at 21:08
  • I forgot to mention one more error. I have another error running the app module(= install module). After I add firebase in base/gradle. I got the following error. "Error running 'app' Default activity not found". I visited Run/Debug configuration to solve the problem. The result was not fruitful. Do you know how to deal with this issue? – HanJo Jang Jun 20 '18 at 17:20

1 Answers1

0

Can you explain more on what you mean by 'Instant' app? All the docs are available in the firebase website: https://firebase.google.com/docs/guides/

There are guides for iOS, android, etc.

For a start, have you create your database by logging in the Firebase online console?

LiveRock
  • 1,419
  • 2
  • 17
  • 27