Description of Issue
I am trying to deploy my react-native app to a physical android device for testing but when doing so, I receive a few red-screen errors.
Here are the red screen errors. The variable error shows up when launching the app. The other errors are displayed when pressing "Reload (R,R)
Error #1:
"Can't find variable: Symbol"
https://flic.kr/p/2gM2dHq
Error #2: "Could not connect to development server. Try the following to fix the issue: - Ensure that the packager server is running. - Ensure that your device/emulator is connected to your machine and has USB debugging enabled. Run 'adb devices' to see a list of connected devices. - Ensure airplane mode is disabled. If you're on a physical device connected to the same machine, run 'adb reverse tcp:8081 tcp:8081' to forward requests from your device. - If your device is on the same WiFi network, set 'Debug server host & port for device' in 'Dev settings' to your machine's IP address and the port of the local dev server. e.g. 10.0.1.1:8081. URL: http://127.0.0.1:8081/index.delta?platform=android&dev=true&minify=false
https://flic.kr/p/2gM2Y44
Error #3: "Module RCTEventEmitter is not a resgistered callable module (calling receiveTouches)
https://flic.kr/p/2gM2Y3s
What I have already tried
1. Attempt #1: Disable dev mode
a. On android emulator, press command + “m” on the keyboard to display the “mobile SDK support” menu.
b. Click “React Native DEV Support”
c. Click on “Dev settings”
d. Uncheck “JS dev mode”
e. Export unsigned APK to physical android device.
f. Results: Same red screen errors.
2. Attempt #2: Use ADB reverse.
a. Tried the ADB reverse command from here: https://facebook.github.io/react-native/docs/running-on-device#method-1-using-adb-reverse-recommended
b. Export unsigned APK to physical android device.
c. Results: Same errors.
3. Attempt #3: Try running on different device.
a. Tried deploying the app to a Moto e4 that is running android 8.
b. Also tried running on a couple different google pixels that are running android 9.
c. Results: Same errors
4. Attempt #4: Invalidate caches / restart
a. Referenced the following video: https://www.youtube.com/watch?v=FX_gCTpqhwM
b. Click "file" on the top menu bar of android studio.
c. Click "Invalidate caches / restart"
d. Export unsigned APK to physical android device.
e. Results: same errors.
5. Attempt #5: Disable a debug mode on device
a. Open android/app/build.gradle
b. Set "bundleInFreeDebug" to false
c. Export unsigned APK to physical android device.
d. Results: Same errors
6. Attempt #6: Change build variant
a. Click on “build” at the top menu bar of android studio.
b. Then click on “select build variant...”
c. Change the build variant from “debug” to “release”.
d. Export unsigned APK.
e. Results: The app does not install on physical android device. Instead, it just shows a warning that says “app not installed”.
7. Attempt #7: Create signed APK
a. Tried following the instructions from the link to create a signed APK export. http://www.androiddocs.com/tools/publishing/app-signing.html
b. Tried using a key already in the project AND also tried creating own key.
c. Results: Error returned that says “invalid keystore format”. Could not export the APK.
8. Attempt #8: Enable remote debugging.
a. Shake android device to display developer menu.
b. Select “debug js remotely”
c. Results: Can’t connect to remote debugger.
9. Attempt #9: Connect to dev server with WiFi
a. Used the accepted answer from here . to connect the dev server: [react-native]could not connect to development server on android
b. Results: Same red screen errors as above.
Additional Notes
1. I have been able to deploy this app to a physical ios device with no problems.
2. The app runs fine on an android emulator that I'm running from android studio.
3. Using android studio 3.4.2
4. Testing with salesforce mobile SDK boilerplate react-native app. Configured for both ios and android.
Expected Results:
I should be able to run the app on a physical android device without red screen errors like how I am running it on the android emulator.