android - react-native 找不到 android sdk
问题描述
我已经在这里解决了所有类似的问题,但找不到解决方案。我正在我的 xubuntu 18.04 上测试 react-native,我被困在手机上启动应用程序的最后一步。我已经安装了 android-sdk,它位于/usr/lib/android-sdk
,
当我这样做时,我还看到我的设备已连接adb devices
我在 .bashrc 文件中添加了以下内容并完成$ source ~/.bashrc
并重新启动了终端并尝试再次运行该应用程序
export ANDROID_HOME=/usr/lib/android-sdk
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/build-tools/24.0.0:$PATH
我不断得到:
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. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and
have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
我还尝试了使用 local.properties 文件并添加 sdk 的本地文件方法。我在这里做错了什么?
解决方案
请检查安装的sdk版本和gradle中sdk的版本
应该是一样的。
提供相同版本时,它对我有用。
推荐阅读
- r - 将一列数据框添加到 R 中的现有数据框列?
- mysql - 使用mysql获取查询返回的总行数
- mongodb - mongoClient.connect VS mongoose.connect 在 MongoDB
- python - Python 数据框 if 和 for 语法错误
- python - Python通过特定列中的条件定义函数来子集数据帧
- java - 无法在 Java 中获得类似金字塔的图像
- python - 如何断开 Gmail API 服务实例?
- javascript - 我收到警告 Synchronous XMLHttpRequest without set async false
- html-table - 下面的 $row['imageData'] 代码不显示图像
- tensorflow - CUDA/TensorFlow 兼容性