My application crash randomly in production and dev mode shows a fatal error

I’m using:
SDK Version: 43
Platform: Android

In production I can’t see the error, the only thing I can see is this (dev-mode).

The error is totally random, I managed to make the error appear by modifying TextInputs or Pickers quickly.
My project uses expo entirely, I understand that it is a bug, but is there a solution to it?

Thanks and kind regards.

Debugging - Expo Documentation This will be one of your best friends moving forward!

Hi Adam, I have looked for this error and it is due to the version of react native. In theroy, it is solved by updating to 0.66. Any ideas about it?

Do you have a link to the commit that fixes it by any chance?

You can find the fix here , however you need eject expo from your project because the fix need to modify some xml files (Android version).
As I told, the version 0.66 of react-native fixes that error, in my case I can’t eject expo… so basicly I’m stucked.

That is a workaround, but apparently the fix is here:

The fix is pretty small.

So it seems to me you have two options and you do not need to eject. But you would need to use EAS Build.

1.) Use patch-package to apply the patch from the above PR to react native during the build.
2.) Alternatively, write a Config Plugin to apply the workaround.

Hi Wodin thanks for your reply,

I’m trying to build using EAS, however the build generates a AAB file and I need a APK (I can’t use a play store).
I modified the eas.json following the doc , but when I use eas build only generate a AAB build.

This is my eas.json:

{
  "cli": {
    "version": ">= 0.43.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "android": {
        "buildType":"apk"
      },
      "distribution": "internal"
    },
    "production": {}
  },
  "submit": {
    "production": {}
  }
}

did you see any errors? I think I forgot something to do.

Thanks and kind regards.

Build with eas build -p android --profile preview or else you can add a build profile like this:

  "build": {
    "apk": {
      "android": {
        "buildType": "apk"
      }
    },
[...]
  }

and then use eas build -p android --profile apk

Thanks Wodin, with your example I’ve created an apk with eas build etc…
However for some reason my app doesn’t work as expected (permanent loading), honestly, I don’t know what I’m doing wrong.

Hard to say off hand. I suggest you have a look through the debugging documentation again. e.g. using adb logcat might show you what’s wrong.

1 Like

I’ll do, also I’ll keep updating expo (and all dependeces), when expo upgrade rn version I’m sure the bug will be fixed. That’s frustrating but I hope this bug fixes asap. Thanks again Wodin.

1 Like

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