手动更新适合以下场景:
1. 目前版本与Gradle版本不一致。
2. 错误 IllegalStateException: Can’t deserialize target data of key ‘IdeaAndroidProject’.
Given class loaders: [PluginClassLoader[org.jetbrains.android, 10.0]]:
3. 新建工程出错,在线更新更新失败。
4. 无外网,不能在线更新。

我们采用离线更新的方法解决:

1.获取安装的Android Studio 的Build Number
如果已经安装了Android Studio,那么我们只需要增量更新即可。所以下载更新jar包即可,首先要知道自己当前的Android Studio的版本号,Help-》About。

Build #AI-135.1404660 135.1404660即为版本号

2.查询目前官方Android Studio的最新版本号

(1)访问网站http://tools.android.com/recent可查看最新的Build Number,或者
(2)访问https://dl.google.com/android/studio/patches/updates.xml查看最新的版本号,目前笔者获得的最新xml数据如下。

<products>
<product name=”Android Studio”>
<code>AI</code>
<channel id=”AI-0-eap”
name=”Android Studio updates”
status=”eap”
url=”http://tools.android.com/recent”
feedback=”https://code.google.com/p/android/issues/entry?template=Android+Studio+bug”
majorVersion=”0″>
<build number=”135.1446794″ version=”0.8.11″>
<message><![CDATA[<html>
A new Android Studio
0.8.11
is available in the canary channel.<p/>
Canary builds are the bleeding edge, released about weekly. While these builds do get tested,<br/>
they are still subject to bugs, as we want people to see what’s new as soon as possible.<br/>
<p/>
For slightly more predictable builds, use <b>Settings | Updates</b> and select the <b>Dev Channel</b>.
</html>]]>
</message>
<button name=”Download” url=”http://tools.android.com/download/studio/canary/latest/” download=”true” />
<button name=”Release Notes” url=”http://tools.android.com/recent” />
<patch from=”135.1248636″ size=”12″ exclusions=”mac” />
<patch from=”135.1267975″ size=”12″ exclusions=”mac” />
<patch from=”135.1281642″ size=”12″ exclusions=”mac” />
<patch from=”135.1295215″ size=”7″ exclusions=”mac” />
<patch from=”135.1331330″ size=”7″ exclusions=”mac” />
<patch from=”135.1339820″ size=”5″ exclusions=”mac” />
<patch from=”135.1371801″ size=”5″ exclusions=”mac” />
<patch from=”135.1391024″ size=”1″ exclusions=”mac” />
<patch from=”135.1404660″ size=”1″ exclusions=”mac” />
<patch from=”135.1428667″ size=”Windows/Linux: 1MB, Mac: 160″ />
</build>
</channel>
<channel id=”AI-0-dev-channel”
name=”Android Studio updates”
status=”milestone”
url=”http://tools.android.com/recent”
feedback=”https://code.google.com/p/android/issues/entry?template=Android+Studio+bug”
majorVersion=”0″>
<build number=”135.1404660″ version=”0.8.9″>
<message><![CDATA[<html>
A new Android Studio
0.8.9
is available in the dev channel.<p/>
Dev channel builds are hand-picked older canary builds that survived the test of time.
</html>]]>
</message>
<button name=”Download” url=”http://developer.android.com/sdk/installing/studio.html” download=”true” />
<button name=”Release Notes” url=”http://tools.android.com/recent” />
<patch from=”135.1245622″ size=”11″ />
<patch from=”135.1248636″ size=”11″ />
<patch from=”135.1267975″ size=”11″ />
<patch from=”135.1281642″ size=”7″ />
<patch from=”135.1295215″ size=”7″ />
<patch from=”135.1331330″ size=”4″ />
<patch from=”135.1339820″ size=”4″ />
<patch from=”135.1371801″ size=”1″ />
<patch from=”135.1391024″ size=”1″ />
</build>
</channel>
<channel id=”AI-0-beta”
name=”Android Studio updates”
status=”beta”
url=”http://tools.android.com/recent”
feedback=”https://code.google.com/p/android/issues/entry?template=Android+Studio+bug”
majorVersion=”0″>
<build number=”135.1404660″ version=”0.8.9″>
<message><![CDATA[<html>
A new Android Studio
0.8.9
is available in the beta channel.<p/>
</html>]]>
</message>
<button name=”Download” url=”http://developer.android.com/sdk/installing/studio.html” download=”true” />
<button name=”Release Notes” url=”http://tools.android.com/recent” />
<patch from=”135.1245622″ size=”11″ />
<patch from=”135.1248636″ size=”11″ />
<patch from=”135.1267975″ size=”11″ />
<patch from=”135.1281642″ size=”7″ />
<patch from=”135.1295215″ size=”7″ />
<patch from=”135.1331330″ size=”4″ />
<patch from=”135.1339820″ size=”4″ />
<patch from=”135.1371801″ size=”1″ />
<patch from=”135.1391024″ size=”1″ />
</build>
</channel>
</product>
</products>

从返回的xml数据可知目前最新的Build Number 为135.1446794。

3.下载增量更新包
获得版本号,我们就可以下载更新包了,我的更新包下载地址为
https://dl.google.com/android/studio/patches/AI-135.1404660-135.1446794-patch-win.jar
格式为AI-$FROM-$TO-patch-win.jar,其中$FROM为你当前android studio的build number,$TO为最新的android studio 的build number。

4.安装更新包
将下载的更新包拷贝至Android Studio 的安装目录,将下载的jar拷贝到该目录下

5、然后打开命令行提示符,cd到Android Studio 的安装目录,键入如下命令

java -classpath AI-135.1404660-135.1446794-patch-win.jar com.intellij.updater.Runner install .

.代表当前目录。即Android Studio 的安装目录。
安装完毕后,你可以重新启动Android Studio,然后Help-》about查看是不是更新到135.1446794了!

收集自网络