iyegoroff / react-native-image-filter-kit

Various image filters for iOS & Android
MIT License
315 stars 42 forks source link

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

Open yannisdev opened 1 year ago

yannisdev commented 1 year ago

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

Irfanwani commented 1 year ago

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'.

yannisdev commented 1 year ago

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.

Irfanwani commented 1 year ago

@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

pratikgehlott commented 2 months ago

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