Android SDK 路径 - adb

问题描述 投票:0回答:1

我尝试使用 React Native 执行“npx expo start --tunnel”来预览我的应用程序。

当我尝试输入“a”在 Android Studio 上举办博览会时遇到问题。

问题首先出在 adb 上:

    › Opening on Android...
    Failed to resolve the Android SDK path. Default install location not found: /home/quentin/Android/sdk. Use ANDROID_HOME to set the Android SDK location.
    Failed to resolve the Android SDK path. Default install location not found: /home/quentin/Android/sdk. Use ANDROID_HOME to set the Android SDK location.
    Error: spawn adb ENOENT

我花了3小时寻找解决方案,不可能解决。

仅供参考,我在 Windows 上工作,在 ubuntu 上工作。 我尝试编辑我的 zshrc 文件来执行此操作;

  • 纳米~/.zshrc

  • 添加(尝试更多多种写法...)

    export ANDROID_HOME="/mnt/c/Users/quent/AppData/Local/Android/Sdk"
    export PATH="$ANDROID_HOME/platform-tools:$PATH"
  • 来源~/.zshrc

android文件夹位于:C:\Users\quent\AppData\Local\Android\Sdk,adb很好地存在于文件夹platform-tools中

然后,我尝试做

sudo apt-get install android-tools-adb

这样,问题就变了:

Logs for your project will appear below. Press Ctrl+C to exit.
› Opening on Android...
Failed to resolve the Android SDK path. Default install location not found: /home/quentin/Android/sdk. Use ANDROID_HOME to set the Android SDK location.
Failed to resolve the Android SDK path. Default install location not found: /home/quentin/Android/sdk. Use ANDROID_HOME to set the Android SDK location.
Failed to resolve the Android SDK path. Default install location not found: /home/quentin/Android/sdk. Use ANDROID_HOME to set the Android SDK location.
CommandError: No Android connected device found, and no emulators could be started automatically.
Please connect a device or create an emulator (https://docs.expo.dev/workflow/android-studio-emulator).
Then follow the instructions here to enable USB debugging:
https://developer.android.com/studio/run/device.html#developer-device-options. If you are using Genymotion go to Settings -> ADB, select "Use custom Android SDK tools", and point it at your Android SDK directory.

我不知道如何解决这个问题。

谢谢你

android react-native sdk
1个回答
0
投票

“仅供参考,我在 Windows 上工作,在 ubuntu 上工作。”什么?

你使用的是ubuntu还是windows?

© www.soinside.com 2019 - 2024. All rights reserved.