【问题标题】:Changing CAPACITOR_ANDROID_STUDIO_PATH in Arch Linux在 Arch Linux 中更改 CAPACITOR_ANDROID_STUDIO_PATH
【发布时间】:2021-10-05 19:54:40
【问题描述】:

我正在尝试在 Arch Linux 上设置 CapacitorJS 的开发环境。 我按照文档添加了

CAPACITOR_ANDROID_STUDIO_PATH=/usr/bin/android-studio

到我的系统环境变量(不是项目),但我仍然遇到同样的错误

[error] Unable to launch Android Studio. Is it installed?
        Attempted to open Android Studio at:
        /usr/local/android-studio/bin/studio.sh
        You can configure this with the CAPACITOR_ANDROID_STUDIO_PATH
        environment variable.

即使它从未指向/usr/local/android-studio/bin/studio.sh

我运行whereis android-studio 并得到android-studio: /usr/bin/android-studio,所以我认为这是正确的路径,但每次我运行npx cap open android 时,它都说它正在尝试从同一路径启动并且永远不会改变

【问题讨论】:

    标签: linux android-studio environment-variables capacitor


    【解决方案1】:

    这取决于您如何安装它,例如 Toolbox 将其安装在用户的主目录中。

    nano ~/.bashrc

    export CAPACITOR_ANDROID_STUDIO_PATH=~/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/202.7486908/bin/studio.sh
    

    locate studio.sh 或许也能找到它。

    【讨论】:

    • whereis studio.sh 给了我/opt/android-studio/bin/studio.sh 所以我将导出更改为那个,但它仍在尝试从原始路径打开。
    • 你能解决吗,我也出现同样的情况?
    • 在 ~/.bashrc 中更改导出后,您应该重新启动终端/bash,这样它才会真正加载变量。
    猜你喜欢
    • 1970-01-01
    • 2013-01-11
    • 1970-01-01
    • 2018-05-19
    • 1970-01-01
    • 2020-04-20
    • 2014-03-11
    • 2013-11-24
    • 1970-01-01
    相关资源
    最近更新 更多