title: TypeError: r(d[2]) is not a function. (In 'r(d[2])(this)', 'r(d[2])' is an instance of Object) in release app only on Android
body: <p>I am converting my react-native app to a mono-repo using yarn workspaces. After moving the logic code into shared packages, I am able to run the app in debug mode and create release apks. But when I run the release apk on a device, the app aborts with error</p>
  <p><code> TypeError: r(d[2]) is not a function. (In 'r(d[2])(this)', 'r(d[2])' is an instance of Object)</code></p>
  <p>It doesn't give any other hints as to where the actual error is occurring.</p>
  <p>Looks like some people have seen similar problems but I couldn't find any solution from any of those posts. I found two similar errors</p>
  <p><a href="https://github.com/mattermost/mattermost-mobile/issues/2757" rel="nofollow noreferrer">https://github.com/mattermost/mattermost-mobile/issues/2757</a></p>
  <p><a href="https://forums.expo.io/t/typeerror-r-is-not-a-function-only-on-device-not-simulator/20985" rel="nofollow noreferrer">https://forums.expo.io/t/typeerror-r-is-not-a-function-only-on-device-not-simulator/20985</a></p>
  <p>I want to know how I can gather more information regarding this error in order to fix it. Currently, it appears the code is minified due to which I am not able to figure exactly where the error is happening.</p>
  <p>Below is the complete error:</p>
  <pre><code>2020-12-16 09:22:28.909 428-494/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
      Process: com.myapp, PID: 428
      com.facebook.react.common.JavascriptException: TypeError: r(d[2]) is not a function. (In 'r(d[2])(this)', 'r(d[2])' is an instance of Object), stack:
      &lt;unknown&gt;@521:145
      exports@477:81
      &lt;unknown&gt;@522:79
      h@2:1585
      &lt;unknown&gt;@521:139
      &lt;unknown&gt;@600:136
      &lt;unknown&gt;@551:319
      t@546:312
      &lt;unknown&gt;@605:70
      t@546:312
      &lt;unknown&gt;@603:94
      t@543:120
      &lt;unknown&gt;@541:513
      h@2:1585
      &lt;unknown&gt;@540:104
      h@2:1585
      &lt;unknown&gt;@539:185
      h@2:1585
      &lt;unknown&gt;@538:1122
      h@2:1585
      &lt;unknown&gt;@528:544
      h@2:1585
      &lt;unknown&gt;@527:109
      h@2:1585
      &lt;unknown&gt;@526:898
      h@2:1585
      &lt;unknown&gt;@466:207
      h@2:1585
      &lt;unknown&gt;@6:122
      h@2:1585
      d@2:958
      global code@2064:3
      
          at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:83)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
          at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
          at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
          at android.os.Handler.handleCallback(Handler.java:873)
          at android.os.Handler.dispatchMessage(Handler.java:99)
          at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
          at android.os.Looper.loop(Looper.java:193)
          at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
          at java.lang.Thread.run(Thread.java:764)
  </code></pre>
  <p>Below is my current package.json</p>
  <pre><code>{
    &quot;name&quot;: &quot;MyApp&quot;,
    &quot;version&quot;: &quot;3.11.0&quot;,
    &quot;private&quot;: true,
    &quot;scripts&quot;: {
      &quot;android&quot;: &quot;react-native run-android&quot;,
      &quot;ios&quot;: &quot;react-native run-ios&quot;,
      &quot;start&quot;: &quot;react-native start&quot;,
      &quot;test&quot;: &quot;jest&quot;,
      &quot;lint&quot;: &quot;eslint .&quot;,
      &quot;prepare&quot;: &quot;cd .. &amp;&amp; yarn patch-package&quot;
    },
    &quot;dependencies&quot;: {
      &quot;@react-native-community/datetimepicker&quot;: &quot;3.0.8&quot;,
      &quot;@react-native-community/netinfo&quot;: &quot;5.9.9&quot;,
      &quot;@react-native-community/push-notification-ios&quot;: &quot;1.8.0&quot;,
      &quot;@react-native-community/slider&quot;: &quot;3.0.3&quot;,
      &quot;@react-native-firebase/analytics&quot;: &quot;10.2.0&quot;,
      &quot;@react-native-firebase/app&quot;: &quot;10.2.0&quot;,
      &quot;@react-native-firebase/auth&quot;: &quot;10.2.0&quot;,
      &quot;@react-native-firebase/database&quot;: &quot;10.2.0&quot;,
      &quot;@react-native-firebase/dynamic-links&quot;: &quot;10.2.0&quot;,
      &quot;@react-native-firebase/messaging&quot;: &quot;10.2.0&quot;,
      &quot;@react-native-firebase/storage&quot;: &quot;10.2.0&quot;,
      &quot;@sentry/react-native&quot;: &quot;2.1.0&quot;,
      &quot;fast-deep-equal&quot;: &quot;3.1.3&quot;,
      &quot;fast-memoize&quot;: &quot;2.5.2&quot;,
      &quot;firebase&quot;: &quot;8.2.0&quot;,
      &quot;my-config&quot;: &quot;1.0.0&quot;,
      &quot;my-ps-api&quot;: &quot;1.0.0&quot;,
      &quot;my-res&quot;: &quot;1.0.0&quot;,
      &quot;my-shared&quot;: &quot;1.0.0&quot;,
      &quot;i18n-js&quot;: &quot;3.8.0&quot;,
      &quot;invariant&quot;: &quot;2.2.4&quot;,
      &quot;libphonenumber-js&quot;: &quot;1.9.6&quot;,
      &quot;lodash&quot;: &quot;4.17.20&quot;,
      &quot;moment-timezone&quot;: &quot;0.5.32&quot;,
      &quot;prop-types&quot;: &quot;15.7.2&quot;,
      &quot;react&quot;: &quot;17.0.1&quot;,
      &quot;react-fast-compare&quot;: &quot;3.2.0&quot;,
      &quot;react-native&quot;: &quot;0.64.0-rc.1&quot;,
      &quot;react-native-action-button&quot;: &quot;2.8.5&quot;,
      &quot;react-native-animatable&quot;: &quot;1.3.3&quot;,
      &quot;react-native-collapsible&quot;: &quot;1.5.3&quot;,
      &quot;react-native-communications&quot;: &quot;2.2.1&quot;,
      &quot;react-native-config&quot;: &quot;1.4.1&quot;,
      &quot;react-native-contacts&quot;: &quot;6.0.3&quot;,
      &quot;react-native-country-picker-modal&quot;: &quot;2.0.0&quot;,
      &quot;react-native-device-info&quot;: &quot;7.3.1&quot;,
      &quot;react-native-dialogs&quot;: &quot;1.1.1&quot;,
      &quot;react-native-elements&quot;: &quot;3.0.0-alpha.1&quot;,
      &quot;react-native-fast-image&quot;: &quot;8.3.4&quot;,
      &quot;react-native-gifted-chat&quot;: &quot;github:varungupta85/react-native-gifted-chat&quot;,
      &quot;react-native-iap&quot;: &quot;5.2.0&quot;,
      &quot;react-native-image-crop-picker&quot;: &quot;0.35.1&quot;,
      &quot;react-native-keyboard-aware-scroll-view&quot;: &quot;0.9.3&quot;,
      &quot;react-native-keyboard-spacer&quot;: &quot;0.4.1&quot;,
      &quot;react-native-localize&quot;: &quot;2.0.1&quot;,
      &quot;react-native-navigation&quot;: &quot;6.12.2&quot;,
      &quot;react-native-parsed-text&quot;: &quot;0.0.22&quot;,
      &quot;react-native-permissions&quot;: &quot;3.0.0&quot;,
      &quot;react-native-radio-buttons&quot;: &quot;1.0.0&quot;,
      &quot;react-native-sound&quot;: &quot;0.11.0&quot;,
      &quot;react-native-store-review&quot;: &quot;0.1.5&quot;,
      &quot;react-native-swiper&quot;: &quot;1.6.0&quot;,
      &quot;react-native-uuid&quot;: &quot;1.4.9&quot;,
      &quot;react-native-vector-icons&quot;: &quot;7.1.0&quot;,
      &quot;react-redux&quot;: &quot;7.2.2&quot;,
      &quot;redux&quot;: &quot;4.0.5&quot;,
      &quot;redux-batched-subscribe&quot;: &quot;0.1.6&quot;,
      &quot;redux-persist&quot;: &quot;6.0.0&quot;,
      &quot;redux-thunk&quot;: &quot;2.3.0&quot;,
      &quot;reduxsauce&quot;: &quot;1.2.0&quot;,
      &quot;reselect&quot;: &quot;4.0.0&quot;,
      &quot;url&quot;: &quot;0.11.0&quot;,
      &quot;uuid&quot;: &quot;8.3.2&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@babel/core&quot;: &quot;7.8.4&quot;,
      &quot;@babel/runtime&quot;: &quot;7.8.4&quot;,
      &quot;@react-native-community/eslint-config&quot;: &quot;1.1.0&quot;,
      &quot;babel-jest&quot;: &quot;25.1.0&quot;,
      &quot;eslint&quot;: &quot;6.5.1&quot;,
      &quot;jest&quot;: &quot;25.1.0&quot;,
      &quot;metro-react-native-babel-preset&quot;: &quot;0.64.0&quot;,
      &quot;react-native-codegen&quot;: &quot;0.0.6&quot;,
      &quot;react-test-renderer&quot;: &quot;17.0.1&quot;,
      &quot;reactotron-react-native&quot;: &quot;2.2.0&quot;,
      &quot;reactotron-redux&quot;: &quot;2.1.3&quot;
    },
    &quot;jest&quot;: {
      &quot;preset&quot;: &quot;react-native&quot;
    }
  }
  </code></pre>