我有一个离子角度的应用。当我从WSL运行“离子电容器构建android”时
我得到以下错误:
[INFO] Ready for use in your Native IDE!
To continue, build your project using Android Studio!
> capacitor open android
[capacitor] [error] Unable to launch Android Studio. Is it installed?
[capacitor] Attempted to open Android Studio at: /usr/local/android-studio/bin/studio.sh
[capacitor] You can configure this with the CAPACITOR_ANDROID_STUDIO_PATH environment variable.
我安装了android,另外还为CAPACITOR_ANDROID_STUDIO_PATH设置了system变量,并设置了通向其windows位置的路径。
我还在这里尝试了建议的修补程序,CAPACITOR_ANDROID_STUDIO_PATH environment variable in Ionic 5也不起作用
想知道有没有人能帮上忙
谢谢
发布于 2022-04-12 09:23:44
也犯了同样的错误。我的Android在一个不同的位置,因为我使用快照。
首先要弄清楚工作室在哪里:
which android-studio
然后将变量添加到您的.bashrc (或例如.zshrc)中:
echo export CAPACITOR_ANDROID_STUDIO_PATH="/snap/bin/android-studio" >> ~/.bashrc
重新启动终端,它应该可以工作。
发布于 2022-05-03 11:17:50
我所做的是:
步骤1:标识studio.sh的位置
那里可能有很多地方。对我来说,我从Ubuntu软件安装了Android,安装位置在
/snap/android-studio/current/android-studio/bin/studio.sh
步骤2:添加到环境变量
vim ~/.bashrc
然后在该行后面加上studio.sh的位置如下所示:
export CAPACITOR_ANDROID_STUDIO_PATH="/snap/android-studio/current/android-studio/bin/studio.sh"
步骤3:在$ source ~/.bashrc
中重新启动终端或输入
我希望这能帮到你。
https://stackoverflow.com/questions/71683772
复制相似问题