Ubuntu 64位,Android studio 的安装,配置和使用
1 Download it.
2 设置环境变量:
export ANDROID_STUDIO=/home/usrname/Documents/android-studio/bin
export PATH=${ANDROID_STUDIO}:$PATH
这样任何界面,都可以studio.sh启动。
3 下载gradle-1.8-bin.zip总是失败。
修改 studio/bin/studio64.vmoptions
-Djava.net.preferIPv4Stack=true
-Didea.updates.url=http://dl.google.com/android/studio/patches/updates.xml
-Didea.patches.url=http://dl.google.com/android/studio/patches/
将gradle-1.8-bin.zip放入~/.gradle/wrapper/dists/gradle-1.8-bin/72srdo3a5eb3bic159kar72vok/文件夹中,重启android studio
4 WARN - ateSettings.impl.UpdateChecker - Connection failed.
配置 ~/.AndroidStudio/config/options/other.xml
<?xml version="1.0" encoding="UTF-8"?>
<application>
<component name="HttpConfigurable">
<option name="USE_HTTP_PROXY" value="true" />
<option name="PROXY_HOST" value="127.0.0.1" />
<option name="PROXY_PORT" value="3128" />
</component>
</application>
change 127.0.0.1 to your real proxy.
7
error 1 :No cached version listing for com.android.tools.build:gradle:0.12.+ available for offline mode.
check "Offline work" in File>Settings>Gradle>Global Gradle Settings
8 jdk setting
执行下面命令,配置需要默认的JDK
sudo update-alternatives --config java
会列出jdk版本,其中被“*”标注的为默认JDK。如果要维持当前默认JDK,直接按回车键即可;否则输入相应JDK的编号将其设置为默认版本。
9 A problem occurred configuring project ':Application'.
> Could not resolve all dependencies for configuration ':Application:_debugCompile'.
> Could not find any version that matches com.android.support:support-v4:21.+.
Required by:
BasicNotifications:Application:unspecified
> Could not find any version that matches com.android.support:gridlayout-v7:21.+.
Required by:
sloution: update and download any missing build-tools and make sure you update the Android Support Repository and Android Support Library under Extras. Restart Android Studio after the SDK Manager finishes