radarlabs / react-native-radar

React Native module for Radar, the leading geofencing and location tracking platform
https://radar.com
Apache License 2.0
170 stars 32 forks source link

Launcher Icon disappearing #111

Closed sebastiangrebe closed 4 years ago

sebastiangrebe commented 4 years ago

I have found a weird bug when adding react-native-radar to a React Native project.

Until adding react-native-radar everything was working fine. In the moment when installing react-native-radar with yarn or npm my app launcher icons disappear for no reason.

Summary

I am a little bit unsure why that happens. I already tried getting react-native-radar directly from the git and switched out the gradle versions inside the package as they are not the default once provided with react native 0.62.2 but this did not work. I was thinking about an SDK mismatch as my project and also react-native 0.62.2 specifies SDK version 28 as default and react-native-radar 29. Maybe that is reason why my icons disappear.

Code to reproduce

Here is my package.json:

{
  "name": "XYZ",
  "version": "2.4.1",
  "private": true,
  "scripts": {
    "start": "react-native start start",
    "dev.android": "sh dev.sh && react-native run-android",
    "dev.ios": "sh dev.sh && react-native run-ios",
    "prod": "sh production.sh",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-native-community/async-storage": "^1.11.0",
    "@react-native-community/geolocation": "^2.0.2",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-community/netinfo": "^4.1.5",
    "@react-native-community/push-notification-ios": "^1.2.0",
    "@react-native-community/viewpager": "^4.0.0",
    "@react-navigation/bottom-tabs": "^5.5.1",
    "@react-navigation/material-top-tabs": "^5.2.9",
    "@react-navigation/native": "^5.5.0",
    "@react-navigation/stack": "^5.4.1",
    "bugsnag-react-native": "^2.23.8",
    "html-entities": "^1.3.1",
    "moment": "^2.26.0",
    "react": "16.11.0",
    "react-native": "0.62.2",
    "react-native-actionsheet": "^2.4.2",
    "react-native-background-downloader": "^2.3.4",
    "react-native-datepicker": "1.7.2",
    "react-native-dimension": "^1.0.6",
    "react-native-file-viewer": "^2.1.1",
    "react-native-fs": "^2.16.6",
    "react-native-fullwidth-image": "^0.1.3",
    "react-native-gesture-handler": "^1.6.1",
    "react-native-google-places-autocomplete": "^1.7.1",
    "react-native-iphone-x-helper": "^1.2.1",
    "react-native-keyboard-aware-scroll-view": "^0.9.1",
    "react-native-maps": "^0.27.1",
    "react-native-maps-super-cluster": "^1.6.0",
    "react-native-offline": "^4.3.0",
    "react-native-percentage-circle": "^1.0.7",
    "react-native-push-notification": "^3.5.2",
    "react-native-qrcode-svg": "^6.0.6",
    "react-native-radar": "^3.0.2",
    "react-native-reanimated": "^1.9.0",
    "react-native-safe-area-context": "^3.0.2",
    "react-native-screens": "^2.8.0",
    "react-native-segmented-control-tab": "^3.4.1",
    "react-native-splash-screen": "^3.2.0",
    "react-native-svg": "^9.6.4",
    "react-native-svg-charts": "^5.4.0",
    "react-native-tab-view": "^2.14.2",
    "react-native-vector-icons": "^6.6.0",
    "react-redux": "6.0.0",
    "redux": "^4.0.5",
    "redux-logger": "^3.0.6",
    "redux-persist": "^6.0.0",
    "redux-thunk": "^2.3.0",
    "rn-viewpager-handy": "^1.5.0",
    "supercluster": "^4.1.1"
  },
  "devDependencies": {
    "@babel/core": "^7.10.2",
    "@babel/runtime": "^7.10.2",
    "@react-native-community/eslint-config": "^1.1.0",
    "babel-jest": "^26.0.1",
    "eslint": "^7.1.0",
    "metro-react-native-babel-preset": "^0.59.0"
  },
  "jest": {
    "presets": [
      "react-native"
    ]
  }
}

Steps to reproduce

Like said I just installed it and the icons are gone. When removing it from the package.json and running yarn the app has got it icons back again.

OS version

Android 10

Other information

I specified the icons correctly in my AndroidManifest.xml like this and they are already working if not using react-native-radar:

android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
sebastiangrebe commented 4 years ago

Just as an idea, is it possible that the radar-android-sdk which is a dependency obviously for this react-native package is the cause for the problem? As saw that the sdk includes app icons like this: https://github.com/radarlabs/radar-sdk-android/tree/master/sdk/src/main/res/drawable-v24 This could maybe override the custom app icon of my app.

Just to track down this issue the same problem also occured for another react-native library: https://github.com/callstack/react-native-fbads/issues/174

nickpatrick commented 4 years ago

Hey @Sebi55, thanks for the heads up. We're going to prefix the ic_launcher file in the native SDK: https://github.com/radarlabs/radar-sdk-android/pull/87 We'll release this in the next week or two. In the meantime, maybe you can change your app icon file name as a workaround?

sebastiangrebe commented 4 years ago

Hey @Sebi55, thanks for the heads up. We're going to prefix the ic_launcher file in the native SDK: radarlabs/radar-sdk-android#87 We'll release this in the next week or two. In the meantime, maybe you can change your app icon file name as a workaround?

Thanks for your response. I will probably just wait until you fix it in the SDK.

nickpatrick commented 4 years ago

Hey @Sebi55, this should be fixed in react-native-radar 3.0.3, which upgrades to Android SDK 3.0.2. Give it a try and let us know!