Fedora 28下Android Studio无法识别SDK及虚拟机启动失败求助
解决Fedora 28上Android Studio的SDK路径与模拟器启动问题
Hey there, let's break down your issues step by step—these are pretty common hurdles with AMD CPUs on Fedora, so I've got some practical fixes to share:
一、SDK路径找不到的问题
Even though you've set sdk.dir in local.properties and ANDROID_HOME, here are some checks to ensure everything is working as expected:
- Verify
local.propertieslocation & permissions
Make sure the file is in your project root directory (not inside a module folder). Check permissions with:
If it's not readable by your user, fix it with:ls -l local.propertieschmod 644 local.properties - Double-check environment variables
Newer Android Studio versions sometimes prioritizeANDROID_SDK_ROOToverANDROID_HOME. Add both to your shell config file (~/.bashrcor~/.zshrc):
Then apply the changes:export ANDROID_HOME=/home/USER/Android/Sdk export ANDROID_SDK_ROOT=$ANDROID_HOME
Confirm they're set with:source ~/.bashrcecho $ANDROID_HOME && echo $ANDROID_SDK_ROOT - Sync Android Studio's SDK config
OpenFile > Project Structure > SDK Locationand confirm the path matches yourANDROID_HOME. Sometimes Studio overrides this after updates. - Clear Gradle cache
Go toFile > Invalidate Caches..., check "Invalidate and Restart"—this clears any cached path references that might be causing conflicts.
二、模拟器启动错误代码134(SIGABRT)
This is almost always related to AMD virtualization compatibility or missing system dependencies on Fedora. Try these fixes:
- Confirm virtualization is fully enabled
Check if CPU virtualization is active in the system:
If the output isegrep -c '(vmx|svm)' /proc/cpuinfo0, go back to your BIOS/UEFI and enable AMD-V (SVM) and IOMMU (some motherboards hide this under "Advanced CPU Settings"). - Install required system packages
Fedora might be missing libraries needed for the emulator. Install them with:
Then start and enable the libvirt service:sudo dnf install qemu-kvm libvirt virt-install bridge-utilssudo systemctl start libvirtd sudo systemctl enable libvirtd - Adjust AVD settings
- Open AVD Manager, edit your Pixel 2/Nexus 6 emulator.
- Under Emulated Performance, set Graphics to Software (hardware acceleration can have AMD-specific bugs on Fedora).
- Reduce the allocated RAM (e.g., from 4GB to 2GB) to avoid memory conflicts with your host system.
- Check SELinux restrictions
Fedora's SELinux might block the emulator from accessing resources. Temporarily disable it to test:
If the emulator starts, add a permanent SELinux rule to allow it:sudo setenforce 0sudo semanage fcontext -a -t emulator_exec_t '/home/USER/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64' sudo restorecon -v '/home/USER/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64' - Update Android Emulator
Open SDK Manager > SDK Tools, check for updates to the Android Emulator. Newer versions often fix AMD compatibility issues.
三、Ubuntu vs Fedora for Android Development
Both distros work well for Android development, but there are small differences:
- Ubuntu has a larger user base, so you'll find more pre-written fixes for AMD-specific emulator issues. Its default system configuration is often more "out-of-the-box" friendly for Android Studio.
- Fedora offers newer software packages and a more up-to-date environment, which can be nice if you want the latest tools. Once you resolve the virtualization and dependency issues, it's just as reliable as Ubuntu.
I've been using Fedora with an AMD CPU for Android development for years now, and after sorting out these initial kinks, it's been smooth sailing.
内容的提问来源于stack exchange,提问作者user198881
相关产品推荐
相关产品推荐

