Requires GLIBC_2.14 while building Android App from Command Line in CentOS 6

3.3k Views Asked by At

I am trying to build Android App from commandline using following command:

./gradlew assemble

But getting following error.

java.io.IOException: Stream closed
    at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:433)
    at java.io.OutputStream.write(OutputStream.java:116)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
    at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
    at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
    at com.android.builder.png.AaptProcess.shutdown(AaptProcess.java:143)
    at com.android.builder.png.QueuedCruncher$1.destruction(QueuedCruncher.java:144)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:245)
    at java.lang.Thread.run(Thread.java:745)
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
AAPT err(Facade for 725518148): /opt/android-sdk-linux/build-tools/25.0.0/aapt: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /opt/android-sdk-linux/build-tools/25.0.0/lib64/libc++.so)
Thread(png-cruncher_6): Stream closed

It says `GLIBC_2.14' not found. I checked with command,

strings /lib/libc.so.6 | grep GLIBC

So, its as expected, GLIBC_2.14 is not available in following list,

GLIBC_2.0
GLIBC_2.1
GLIBC_2.1.1
GLIBC_2.1.2
GLIBC_2.1.3
GLIBC_2.2
GLIBC_2.2.1
GLIBC_2.2.2
GLIBC_2.2.3
GLIBC_2.2.4
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_PRIVATE

So, I've tried to install GLIBC_2.14, but unable to install it on my Linux CentOS 6.

Some threads on Stackoverflow suggested to upgrade build-tools and platform version. I did that as well. Even reinstalled Android SDK, but it doesn't seem to work.

Can you please suggest steps to install GLIBC_2.14 on CentOS 6?

1

There are 1 best solutions below

2
On

Issue has been resolved.

First I have manually installed GLIBC 2.14 by following steps given in this link.

Still I was facing the issue. So, what I did was changed the Symbolic link of /lib64/libc.so.6. Made it point to /opt/glibc-2.14/lib/libc.so.6.

So, basically symbolic link is,

/lib64/libc.so.6 -> /opt/glibc-2.14/lib/libc.so.6