运行android时反应本机错误

时间:2017-11-15 03:44:39

标签: react-native-android aapt

当我第一次运行react-native run-android时出现此错误

Execution failed for task ':app:mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: java.lang.RuntimeException: AAPT process not ready to receive commands

这是我的aapt错误,上面有这样的日志

app:mergeDebugResources
AAPT err(Facade for 806023675): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 320379832): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1789437959): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1055339140): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 520641803): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1656371171): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1847553157): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1677766557): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1952482313): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1103640883): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1227322743): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 962420428): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1155783227): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 236690628): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1275003794): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1275871824): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 2018846724): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 291122889): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1890726756): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
AAPT err(Facade for 122608110): /usr/Android/Sdk/build-tools/23.0.1/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory

...     :app:mergeDebugResources FAILED

我正确安装了android sdk,我运行我的android模拟器,我的反应原生包装器正在运行

1 个答案:

答案 0 :(得分:5)

我只是将其粘贴在命令行中并输入

sudo apt-get install lib32stdc++6 lib32z1

这对我有用,也许你对AAPT有不同的问题,所以我不能说这是绝对的答案,但这对我有用

注意:不是每个aapt错误的解决方案都是这样,但我希望这可能会对你们中的一些人有所帮助。