TypeError r is not a function - only on device, not simulator

Greetings!
I am getting an error “whoops, something went wrong” only on my device.
When I run the program in the simulator, it is fine.
When I run it on the device from

expo start --localhost --android

with the device plugged into USB, it seems fine. But when I publish to expo to run in my Expo app, or try to run the apk that I built with expo build:android. It breaks.

i have tried clearing data on both the apk version and the Expo app, but it does not seem to help.

error is Uncaught Error: TypeError:
TypeError: TypeError: r is not a function. (in 'r(d[10]), ‘r’ is 87)

This error is located at:
in I
in RCTView
in p
in RCTView
in o
in RCTView
in n

etc…

I would really appreciate any help. Thanks !

Hey @skrite,

Can you try either (or both):

A. Running the command expo start --no-dev --minify as it replicates the environment in a production env.

B. Connecting your device, enabling USB debugging and then opening the .apk in Android Studio and running adb logcat to get device logs as they contain much more insightful information for errors and crashes.

Cheers,
Adam

Thanks very much. Sorry for the delay in reply. Had to do some reading before I could put your advice into action. Here is what I have found so far…
the app works fine when not in production mode. Both the simulators (android and ios) and when usb connected to an android app. In production mode, they all fail when I navigate to an item’s detail view, back to the list view screen, and again to a detail view. (list of items → one item → list of items) = ok, but (list => one item => list => one item) crashes (even if same item)
adb logcat while connected to the phone spits out exactly the same error.
This one (only in text)

i actually wonder if there is something in the version of React-Native that I am using

"@expo/samples": "2.1.1",
    "expo": "^31.0.4",
    "mobx": "^3.3.1",
    "mobx-react": "^4.3.4",
    "moment": "^2.19.3",
    "react": "16.5.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-31.0.1.tar.gz",
    "react-native-elements": "^0.18.2",
    "react-native-highcharts": "^1.0.2",
    "react-native-modal": "^6.5.0",
    "react-native-simple-store": "^1.3.0",
    "react-navigation": "2.18.2"

I finally worked this out.
In a component I had a require(“Dimensions”) in the actual code of the component.
When I moved it to the top (where the other imports are) it worked again.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.