我在 ubuntu 服务器中有一个 React Native 项目,我想构建一个用于生产的 Android 应用程序。为此,我首先必须生成 Gradle Wrapper 文件,因此我在中运行此命令android
目录
gradle wrapper --gradle-version <my-gradle-version>
运行此命令后,我收到此错误
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
我知道如何定义 SDK 位置sdk.dir
in the local.properties
文件或带有ANDROID_HOME
环境变量。
但我的问题是没有安装SDK
我的问题是在 React Native 中我需要哪个 sdk 来构建一个用于生产的 Android 应用程序以及如何将其安装在 ubuntu 服务器中
尝试这个 :
下载最新的安卓sdk
cd /opt
wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
tar -xvf android-sdk*-linux.tgz
cd android-sdk-linux/tools
./android update sdk --no-ui --filter platform,platform-tools
set path
echo 'export PATH=$PATH:/opt/android-sdk-linux/platform-tools' >> /etc/profile.d/android.sh
echo 'export ANDROID_TOOLS=/opt/android-sdk-linux' >> /etc/profile.d/android.sh
source /etc/profile.d/android.sh
添加 i386 支持
dpkg --add-architecture i386
apt-get update
apt-get install -y libc6:i386 libstdc++6:i386 zlib1g:i386
安装软件开发工具包
cd /opt/android-sdk-linux/tools
./android list sdk --all
./android update sdk --no-ui --all
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)