Official update for Day 5 of my #100DaysOfCode and #Devember coding challenge.
Checklist
Daily Requirements
Extra Tasks
Progress Report
- Added and configured react-native-maps. This was not easy as I ran into a crashing issue that gave no hints on errors when running
react-native run-android
. What ultimated happened:
- I ran into these tow bugs where react-native-maps conflicts with react-native-background-geolocation.
- The fix required manually defining the Google Play Services version as the default versions used in react-native-maps and react-native-background-geolocation are different and thus conflict. This was explained in a bug fix for the react-native-background-geolocation example when they integrated react-native-maps.
- Both the react-native-maps and react-native-background-geolocation docs hint at this being an issue but don’t outright say so (react-native-maps step 1 for Android and the last section in Gradle config for react-native-background-geolocation). It’s a good lesson learned as I’m sure this will pop up again in other native modules that use Google Play Services.
- I ended up fixing it by configuring the
android/build.gradle
to use the minimum version required by react-native-background-geolocation as that has a minimum required version (11.2.0) whereas react-native-maps does not.
- Total time took over 2 hrs because rebuilding and testing gradle configs took forever on my old, slow laptop.
- I also learned new stuff with git:
- How to properly rename a file:
git mv source dest
- How to roll back an add so long as you haven’t done commit:
git reset file
or for all adds git reset
- Also, one thing for the curious. I love Expo, but I cannot use it right now because I need background code execution for my demo project. When I was writing my original MVP projects, I eventually had to eject because of this limitation. If you are curious of Expo’s limitations, read this page in the docs.
Copyright © 2011-2020
Ho Yin Cheng