How do I extract the Android NDK package?
My OS is CentOS 32-bit.
I want to extract a package with 7-zip, install 7-zip with rpm without error. but when I extract the NDK package it doesn't work. eg:
[root@localhost ~]# ls
anaconda-ks.cfg jni-test
android-ndk-r10e-linux-x86.bin p7zip-9.20.1-1.el5.rf.i386.rpm
install.log p7zip-plugins-9.20.1-1.el5.rf.i386.rpm
install.log.syslog
[root@localhost ~]# 7z x android-ndk-r10e-linux-x86.bin
7-Zip 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,1 CPU)
Processing archive: android-ndk-r10e-linux-x86.bin
Error: Can not open file as archive
According to the official google docs:
[root@localhost ~]# ll
ζ»η¨ι 307344
-rw-------. 1 root root 1096 6ζ 25 17:41 anaconda-ks.cfg
-rwxr-xr-x. 1 root root 309844799 6ζ 25 21:24 android-ndk-r10e-linux-x86.bin
-rw-r--r--. 1 root root 9119 6ζ 25 17:41 install.log
-rw-r--r--. 1 root root 3091 6ζ 25 17:41 install.log.syslog
drwxr-xr-x. 2 root root 4096 6ζ 25 20:04 jni-test
-rw-r--r--. 1 root root 4455529 4ζ 20 2011 p7zip-9.20.1-1.el5.rf.i386.rpm
-rw-r--r--. 1 root root 382577 4ζ 20 2011 p7zip-plugins-9.20.1-1.el5.rf.i386.rpm
[root@localhost ~]# ./android-ndk-r10e-linux-x86.bin
7-Zip SFX 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,1 CPU)
Processing archive: ./android-ndk-r10e-linux-x86.bin
Error: Can not open file as archive
Archive Errors: 1
[root@localhost ~]# file android-ndk-r10e-linux-x86.bin
android-ndk-r10e-linux-x86.bin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, stripped
Why?
UPDATE: The reason for this issue is that the MD5 value does not match.
source to share
If the package is in 7zip format, you can extract it using 7zip. But it is not, you can see the format from the command file
.
$ file android-ndk-r10e-linux-x86_64.bin
android-ndk-r10e-linux-x86_64.bin: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=8c7de897dd2f5d869d108bed2f2152a68b2f7b0a, stripped
From the output above, we can see that it is an ELF executable, so just add the executable bit and execute it.
$ chmod u+x android-ndk-r10e-linux-x86_64.bin $ ./android-ndk-r10e-linux-x86_64.bin
It will be extracted to a directory android-ndk-r10e
in the current directory.
source to share
It is a self-extracting binary file. You don't need 7Zip, just chmod a + x and. / android -ndk-r10e-linux-x86.bin
UPDATE
I see you tried this in your update, now according to the doc https://developer.android.com/ndk/downloads/index.html , I think your file is corrupted just by seeing size 309844799 vs 394281908, you don't even need to check md5.
Download again, check the md5 of the file and try again.
source to share