简体   繁体   English

android-studio:执行studio.sh时出错

[英]android-studio : Error while executing studio.sh

After attending Google IO 2016 extended, I downloaded studio from https://dl.google.com/dl/android/studio/ide-zips/2.2.0.0/android-studio-ide-145.2878421-linux.zip 在参加Google IO 2016扩展后,我从https://dl.google.com/dl/android/studio/ide-zips/2.2.0.0/android-studio-ide-145.2878421-linux.zip下载了工作室

I extracted it. 我提取了它。 But after that, I am not able to execute studio.sh.. 但在那之后,我无法执行studio.sh ..

It shows following error: 它显示以下错误:

To-be-filled-by-O-E-M:~/Applications/android-studio/bin$ ./studio.sh 
./studio.sh: 137: ./studio.sh: declare: not found
./studio.sh: 141: ./studio.sh: Syntax error: "(" unexpected (expecting "fi")

Am I missing something ? 我错过了什么吗?

Note: I have posted the issue on Google Plus Community Android Studio . 注意:我已在Google Plus社区Android Studio上发布此问题。 Hers's the Link to my post 她是我帖子链接

If you are ubuntu user then you can edit studio.sh and change fist line from 如果你是ubuntu用户,那么你可以编辑studio.sh并更改第一行

#!/bin/sh

to

#!/bin/bash

It works for me in Ubuntu 14.04. 它适用于Ubuntu 14.04。

Original Issue 原始问题

只需使用以前的studio.sh文件,它就像一个魅力!

Edit the file ~/android-studio/bin/studio.sh : 编辑文件~/android-studio/bin/studio.sh

change line 1 改变第1行

#!/bin/sh

to

#!/bin/bash

This issue is fixed in Android Studio 2.2 preview 2 (download from this page ). 此问题已在Android Studio 2.2预览2中修复(从此页面下载)。

Fixed bug preventing the IDE from starting on some Linux distributions (in particular where /bin/sh is not bash) 修复了阻止IDE在某些Linux发行版上启动的错误(特别是在/ bin / sh不是bash的情况下)

From the changelog . 来自更改日志

我也得到了同样的错误,我已经更换了最新的/bin/studio.sh文件与我以前/bin/studio.sh文件和它的作品般的魅力。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM