Eas build fails but project builds locally

eas build failed with the following error :

[stderr]
/home/expo/Android/Sdk/build-tools/30.0.3/llvm-rs-cc: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
1701[stderr]
FAILURE: Build failed with an exception.
1702[stderr]
* What went wrong:
1703[stderr]
Execution failed for task ':app:compileReleaseRenderscript'.
1704[stderr]
>
1705[stderr]
com.android.ide.common.process.ProcessException: Error while executing process /home/expo/Android/Sdk/build-tools/30.0.3/llvm-rs-cc with arguments {-I /home/expo/Android/Sdk/build-tools/30.0.3/renderscript/include/ -I /home/expo/Android/Sdk/build-tools/30.0.3/renderscript/clang-include/ -rs-package-name=androidx.renderscript -p /home/expo/workingdir/build/android/app/build/generated/renderscript_source_output_dir/release/out -target-api 23 /home/expo/workingdir/build/android/app/src/main/rs/ProcessImage.rs -O 3 -o /home/expo/workingdir/build/android/app/build/generated/res/rs/release/raw}

I have tried downgrading gradle version , running expo doctor and with no results , also I cannot find anything about this error online, please help. P.S im not and android developer.

Hi @sandor147

Could you post a link to one of the failed builds in case one of the Expo team members can have a look? (I won’t be able to, but always a good idea to post it so that time is not wasted if an Expo team member wants to inspect the build logs.)

Any idea what dependency needs libncurses!? That’s weird. I would not expect that in an Android app. It’s used for terminal-based apps e.g. text editors etc.

@wodin Builds were working like 2 days ago , but today for some reason the android build stopped working with the same code , is a link to the build enough for the devs to inspect it ?

Hi @sandor147, a link to the build will help us inspect the log to see what could be the issue :slight_smile:

So I managed to solve the first error on this build:

By changing:

distributionUrl=https://services.gradle.org/distributions/gradle-7.3.3-all.zip
TO
distributionUrl=https://services.gradle.org/distributions/gradle-7.3.3-bin.zip

in gradel-wrapper.properties file.

But then I got a different error on this build:

[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':react-native-gesture-handler:compileReleaseKotlin'.

In the end i managed to solve the problem by myself , I’m posting the solution here:

The problem was that I was using a library Renderscript for manipulating images (this library is deprecated) that had a dependency on libncurses.so.5 but this dependency is not present on the eas default build environment at this moment ubuntu 20.04 jdk 11 or the latest env ubuntu 22.04 jdk 11 so I had to downgrade the android build image to ubuntu-18.04-jdk-11-ndk-r19c as a workaround until I substitute Renderscript for another library.

@amanhimself Maybe consider adding libncurses.so.5 to the later build environments so people who use outdated but still working libraries can use the service.

2 Likes

You could also run apt-get install --yes libncurses-dev in a eas-build-pre-install hook

EDIT: Oops, I see on Ubuntu 22.04 that’s version 6. Then I suppose you could build your own copy of libncurses version 5 or something. But it seems like downgrading as you did is probably the right way to go while you move away from renderscript.

This should work on Ubuntu 20.04:

apt-get install --yes libncurses5-dev
sudo apt-get install --yes libncurses5

2 Likes

This command does not solve the issue at hand, I have just tried it. As a note the command runs only if you use sudo so the full command would be sudo apt-get install --yes libncurses5-dev.

Also I have tried your solution with a different command : sudo apt-get install --yes libncurses5 that works so I’m awarding the solution to you since without yours I would have not find mine.

Thank you @wodin :slight_smile: .

2 Likes

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