简体   繁体   English

如何更新 Android Studio .jar 文件?

[英]How to update Android Studio .jar file?

I want to update my Android Studio from v0.1 to v0.2.5 and download the .jar file from here .我想将我的 Android Studio 从 v0.1 更新到 v0.2.5 并从此处下载 .jar 文件。

How to reload .jar file in Android Studio?如何在 Android Studio 中重新加载 .jar 文件?

Note: There is not a patch update available from 0.1.9 to 0.2. 注意:没有补丁更新,从0.1.9到0.2。 To update from Android Studio 0.1.x to 0.2.x, you must install a new Android Studio bundle from this page. 要从Android Studio 0.1.x更新到0.2.x,您必须从此页面安装新的Android Studio捆绑包。 The reason for that is that we have made changes to the bundled SDK such that it includes a pre-configured local Maven repository which can serve up the v4 support library and which is required for creating new projects. 原因是我们对捆绑的SDK进行了更改,使其包含预先配置的本地Maven存储库,该存储库可以提供v4支持库,这是创建新项目所必需的。

From http://developer.android.com/sdk/installing/studio.html#Revisions 来自http://developer.android.com/sdk/installing/studio.html#Revisions

So why not downloading a new version of Android Studio? 那么为什么不下载新版Android Studio呢?

Update : If you can't update by network. 更新 :如果您无法通过网络更新。 Try this: 试试这个:

java -classpath /path/to/AI-130.687321-130.692269-patch-unix.jar com.intellij.updater.Runner install $PWD java -classpath /path/to/AI-130.687321-130.692269-patch-unix.jar com.intellij.updater.Runner install $ PWD

From https://code.google.com/p/android/issues/detail?id=56068 来自https://code.google.com/p/android/issues/detail?id=56068

Running Windows 8 (as a local admin), I needed patch from a reasonably recent version to 0.9.2. 运行Windows 8(作为本地管理员),我需要从最新版本的补丁到0.9.2。 However I ran into the "unable to delete files" issue when trying to patch directly from within Android Studio (running as admin). 但是,当我尝试直接从Android Studio(以管理员身份运行)进行修补时,我遇到了“无法删除文件”的问题。 After doing the 100 MEG download twice (Aussie slow Internet), I needed something smarter. 在完成100次MEG下载(Aussie slow Internet)后,我需要更聪明的东西。 Follows is what worked for me (your mileage may vary): 跟随对我有用(你的里程可能会有所不同):

  1. I found the download JAR in my C:\\Users\\MYUSERNAME\\AppData\\Local\\Temp directory. 我在C:\\ Users \\ MYUSERNAME \\ AppData \\ Local \\ Temp目录中找到了下载JAR。 It had a strange extension, but was obviously the patch file from the files date/time stamp. 它有一个奇怪的扩展,但显然是文件日期/时间戳的补丁文件。
  2. So I copied this file into a nice directory (c:\\temp), renaming the extension to ".jar" 所以我将这个文件复制到一个漂亮的目录(c:\\ temp)中,将扩展名重命名为“.jar”
  3. My install of Android Studio is in c:\\program files (x86)\\Android\\android-studio - so using Windows Explorer I gave the "everyone" user full control of the folder and all sub-folders. 我安装的Android Studio在c:\\ program files(x86)\\ Android \\ android-studio中 - 所以使用Windows资源管理器我给了“everyone”用户完全控制文件夹和所有子文件夹。 Yes I know this is bad practice on a prod server but hear me out. 是的我知道这在prod服务器上是不好的做法,但是听我说。
  4. I open up a command window in c:\\temp and entered the following command line (where the .jar file name was the JAR file I found and renamed): 我在c:\\ temp中打开一个命令窗口并输入以下命令行(其中.jar文件名是我找到并重命名的JAR文件):

    java -classpath jetbrains.patch.jar.androidstudio.jar install "c:\\program files (x86)\\Android\\android-studio" java -classpath jetbrains.patch.jar.androidstudio.jar安装“c:\\ program files(x86)\\ Android \\ android-studio”

  5. This commenced the patch which completed successfully. 这开始了成功完成的补丁。 Giving "everyone" full control meant that the delete operations completed okay - at least that's my belief. 给予“每个人”完全控制权意味着删除操作已经完成 - 至少这是我的信念。 I remove the everyone access after the patch completed (I bet you thought I'd forget to do this!). 补丁完成后我删除了所有人的访问权限(我打赌你以为我会忘记这样做!)。

  6. Started up Android Studio and checked the version which is now current - PHEW! 启动Android Studio并检查现在的版本 - PHEW!

Best of luck with manually patching on Windows 8. I really love Android Studio, but its definitely on the clunky side in this regard. 祝你在Windows 8上手动打补丁。我真的很喜欢Android Studio,但在这方面它绝对是笨拙的一面。

Copy the new jar file to app\\libs folder.将新的 jar 文件复制到 app\\libs 文件夹。 Make sure in your build.gradle (app), you import the file under dependencies section:确保在您的 build.gradle(应用程序)中,您在依赖项部分下导入文件:

dependencies {
...
implementation files ('libs/myfile.jar')

Do a File |做一个文件 | Invalidate caches / restart to refresh the jar file.使缓存无效/重新启动以刷新 jar 文件。

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

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