Unable to build react-native 2 project to phone

纵然是瞬间 提交于 2019-12-04 17:57:51

问题


I have my react-naive project completely setup and have been trying to run it to my phone but kep getting the following error when i run the

react-native run-android

command.

Output:

java.io.IOException: Cannot run program "/home/webshinobis/Android/sdk/build-tools/23.0.1/aapt": error=2, No such file or directory

But i have checked the build tools and that file is right there. I have reinstalled the build tools for 23.0.1 but no change. any ideas to help? thanks.


回答1:


Required libraries for 64-bit machines:

If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries:

$sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386

If you are running 64-bit Fedora:

$sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686



回答2:


Ah thank you. I just followed this

sudo dpkg --add-architecture i386

sudo apt-get update

but I got an error said that couldn't found the package. Then I found answer in here . To summarize it , you should add architecture i386 like this

sudo dpkg --add-architecture i386

sudo apt-get update

this work for me very well.



来源:https://stackoverflow.com/questions/41181412/unable-to-build-react-native-2-project-to-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!