spe*_*ker 6 android-studio ionic-framework ionic-native ionic4 capacitor
当我运行“离子电容器运行android”命令以在android studio中启动我的应用程序时,出现错误消息:
无法启动Android Studio。”,您必须使用JavaScript转义的路径,在capacitor.config.json中配置“ linuxAndroidStudioPath”以指向studio.sh的位置:例如:{“ linuxAndroidStudioPath”:“ / usr / local / android -studio / bin / studio.sh“}
但是我配置了我的电容器.config.json的路径,但错误仍然存在。
这是我的capacitor.config.json文件
首先whereis android-studio在您的终端上运行。此命令将返回您的android studio的路径。
我的是/snap/android-studio/current/android-studio/bin/studio.sh。我从ubuntu软件商店安装了android-studio。可能您通过不同的来源和不同的位置进行安装。
然后添加"linuxAndroidStudioPath": "/snap/android-studio/current/android-studio/bin/studio.sh"位于项目根目录中的capacitor.config.json。
替换/snap/android-studio/current/android-studio/bin/studio.sh为您的路径。这是由您退还给您的whereis android-studio
我希望它会起作用。请投票。谢谢
我使用JetBrains Toolbox和macOS
要使用 Android Studio 打开电容器项目,npx cap open android我必须导出 Android Studio 路径,如下所示:
export CAPACITOR_ANDROID_STUDIO_PATH="/Users/myuser/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7199119/Android Studio.app"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
662 次 |
| 最近记录: |