0

Im using Google Maps with Flutter, i've followed all of the steps, and it worked perfectly, i had a map widget that i could use to browse, zoom and everything. A few days later, after i started tinkering with Firebase Auth (for the same app), it stopped working, as a matter of fact, the app makes my (Xiaomi) phone crash and reboot when i enter the map screen, while it works completely fine on my emulator. I tried to create another blank google console project and created the APIs from scratch, and created a blank flutter project and set everything up, but it still crashes my phone. I tried this on a Samsung, the phone doesnt crash, but the map shows up a blank grey area.

What should i do ?

RedZ
  • 857
  • 1
  • 13
  • 25
  • See this : https://stackoverflow.com/q/55431120/14945696 – Kevin M. Mansour May 01 '21 at 19:48
  • Also I experienced same issue on Huawei Device. – Kevin M. Mansour May 01 '21 at 19:49
  • I tried all of the solutions on that post along with many other posts before writing my question – RedZ May 01 '21 at 19:53
  • Try clear cache for the app in the Xiaomi and restart device. – Kevin M. Mansour May 01 '21 at 19:56
  • it didnt work, neither on the Xiaomi nor the Samsung! – RedZ May 01 '21 at 22:54
  • Interesting. See this Article : https://medium.com/flutter/google-maps-and-flutter-cfb330f9a245. But at all you said that when you added Firebase Auth Maps did not start to work again. Right? if yes So remove Google Maps and try it on Xiaomi then see what will you get. – Kevin M. Mansour May 01 '21 at 23:05
  • the thing is, i created a brand new project just for google maps, and it didnt work, and remember i said this whole thing worked perfectly before, google maps worked like charm before back when i had a new fresh project, but now it just doesnt ! – RedZ May 02 '21 at 08:27
  • The problem maybe from two. First: There is something conflict like another API or something from your project. Second: it maybe problem from the device itself (Which is Xiaomi or Samsung. At all in follow up of our discussion in comments edit your question to add all this details. – Kevin M. Mansour May 02 '21 at 12:43
  • Also did you added Internet permission in your project. like this : https://stackoverflow.com/a/60076737/14945696 – Kevin M. Mansour May 02 '21 at 12:48
  • i did, i added INTERNET and both LOCATION permissions but it didnt work then, now it works after creating a whole new project, and moving all of flutter files into the new project, "somehow" it works now, which really worries me that it might crash again in the hands of a user! – RedZ May 02 '21 at 12:55
  • 1
    Happy it worked but the problem was from your Project(You might conflict something with something maybe) So just double check when you update Google Maps API or even add any other API. To do not return problem again. But do not worry it will work great in hands of user but just double check when you edit any API. At all question still open which might anyone else know the problem or how to solve it. – Kevin M. Mansour May 02 '21 at 13:00
  • Yes, id have to check everything again after every core change i make, thank you for your help :) – RedZ May 02 '21 at 13:02
  • 1
    Thanks you too. Also I will check again for the problem because it is interesting and will help a lot of other people. :) – Kevin M. Mansour May 02 '21 at 13:03
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/231848/discussion-between-kevin-m-mansour-and-redz). – Kevin M. Mansour May 02 '21 at 13:15

1 Answers1

1

Need to Add Permission . User have to confirm the permission then you will able to view it

  • Which permission ? also, remember i mentioned that the app worked with no issues before, without adding any permissions (freshly created flutter project) – RedZ May 02 '21 at 08:28
  • which permission you have added? you can add permission package for this – Tasnuva Tavasum oshin May 02 '21 at 17:49
  • 1
    After creating a whole new project, and redoing everything (Google maps + firebase installations), it works now, but i still dont know why, because i created a blank project before just for google maps but it didnt work, so i dont know how it got fixed – RedZ May 02 '21 at 19:50