react-native-image-filter-kit icon indicating copy to clipboard operation
react-native-image-filter-kit copied to clipboard

OutOfMemory // App crashes on IOS when the filterComponent is rendered

Open yannisdev opened this issue 2 years ago • 4 comments

I am using expo EAS.

While the filters works flawlessly for the Android version of the app, when i tried to load an image with its filters on iOS 16.1, i get the following crash:

OutOfMemory
The OS most likely terminated your app because it overused RAM.

When comment out the FilterComponent the app does not crash.

The implementation i followed is the one described here

yannisdev avatar Dec 23 '22 12:12 yannisdev

Followed the same implementation and it works fine in development mode, but when building with eas, build fails.

Execution failed for task ':react-native-image-filter-kit:compileReleaseRenderscript'.

Irfanwani avatar Jan 06 '23 08:01 Irfanwani

Followed the same implementation and it works fine in development mode, but when building with eas, build fails.

Execution failed for task ':react-native-image-filter-kit:compileReleaseRenderscript'.

@Irfanwani I am not sure if this is exactly the same case, but i had similar issues during the app building. They way to overcome these problems is by executing a pre-install script.

Inside package.json:

"scripts": {
    "eas-build-pre-install": "./pre-install"
}

Pre-install script:

#!/bin/bash

# This is a file called "pre-install" in the root of the project

if [[ "$EAS_BUILD_PLATFORM" == "android" ]]; then
  sudo apt install -y libncurses5
elif [[ "$EAS_BUILD_PLATFORM" == "ios" ]]; then
  brew install ncurses
fi

However, in my case, the app crashes on ios when i select an image and the filters are created. It works fine on android.

yannisdev avatar Jan 11 '23 11:01 yannisdev

@yannisdev I actually found the answer from the expo forums, and the answer is same as you said, but a small change,

"eas-build-pre-install": "sudo apt-get install --yes libncurses5"

As the error shows libncurses5 is missing. For now i am using for android only so maybe I will need this answer later. BTW thanks for the reply

Irfanwani avatar Jan 11 '23 16:01 Irfanwani

how can we fix this in react native project without expo?

pratikgehlott avatar Jun 24 '24 17:06 pratikgehlott