You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu16下NativeScript安卓虚拟设备无法访问/未授权问题求助

Hey there, let's work through this NativeScript issue you're hitting on Ubuntu 16. You mentioned you've got the AVD running, developer options and USB debug enabled, but tns doctor is throwing errors—let's break down the fixes step by step.

Troubleshooting tns doctor Issues with NativeScript & Android Virtual Device on Ubuntu 16

First off, your truncated tns doctor hint mentions iOS limitations (which makes sense, since you're on Ubuntu), but the actual problem is almost certainly related to Android SDK configuration or AVD detection. Here's how to fix it:

1. Verify Android SDK Environment Variables

NativeScript relies on correct environment variables to find your Android SDK. Let's make sure these are set properly:

  • Open your shell config file (use ~/.zshrc if you use Zsh instead of Bash):
    nano ~/.bashrc
    
  • Add these lines (replace the ANDROID_HOME path with your actual SDK location—usually ~/Android/Sdk or /opt/android-sdk):
    export ANDROID_HOME=~/Android/Sdk
    export PATH=$PATH:$ANDROID_HOME/tools
    export PATH=$PATH:$ANDROID_HOME/platform-tools
    export PATH=$PATH:$ANDROID_HOME/emulator
    
  • Save and refresh the config:
    source ~/.bashrc
    
  • Confirm the variables work:
    echo $ANDROID_HOME
    
    You should see your SDK path printed out.

2. Ensure ADB Recognizes Your Virtual Device

Even if your AVD launches, adb might not be picking it up. Check with:

adb devices

If you see your emulator listed (something like emulator-5554), you're good. If not, restart the adb service:

adb kill-server
adb start-server

Then re-launch your AVD and run adb devices again to confirm.

3. Re-Run tns doctor & Fix Remaining Issues

Now run the doctor command again:

tns doctor

If there are still specific errors (like missing SDK components), follow the prompts to install what's needed. For Ubuntu 16, we recommend sticking with API 29 or newer stable SDK versions for better compatibility.

4. Extra Fixes If Above Steps Fail

  • Use x86/x86_64 AVDs: NativeScript has poor support for ARM-based emulators, so switch to an x86/x86_64 system image when creating your AVD.
  • Install 32-bit dependencies: Ubuntu 16's 64-bit system needs these for Android tools:
    sudo apt-get install lib32stdc++6 lib32z1
    

内容的提问来源于stack exchange,提问作者Raphael Hippe

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 12:07:58