关于AndroidStuido修改插件路径后无法通过UI界面更新和安装新的插件

关于AndroidStuido修改插件路径后无法通过UI界面更新和安装新的插件

1.自定义插件路径程序员的习惯(可能是处女座的习惯),安装软件以及管理软件的文件路径要按照习惯

 以下为D:\WorkSoftware\Android\Android Studio\bin\idea.properties原始文本

# Use ${idea.home.path} macro to specify location relative to IDE installation home.
# Use ${xxx} where xxx is any Java property (including defined in previous lines of this file) to refer to its value.
# Note for Windows users: please make sure you're using forward slashes (e.g. c:/idea/system).

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE config folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
# idea.config.path=${user.home}/.AndroidStudio/config

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE system folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
# idea.system.path=${user.home}/.AndroidStudio/system

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to user installed plugins folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
# idea.plugins.path=${idea.config.path}/plugins

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE logs folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
# idea.log.path=${idea.system.path}/log

#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE should provide code assistance for.
# The larger file is the slower its editor works and higher overall system memory requirements are
# if code assistance is enabled. Remove this property or set to very large number if you need
# code assistance for any files available regardless their size.
#---------------------------------------------------------------------
idea.max.intellisense.filesize=2500

#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE is able to open.
#---------------------------------------------------------------------
idea.max.content.load.filesize=20000

#---------------------------------------------------------------------
# This option controls console cyclic buffer: keeps the console output size not higher than the specified buffer size (Kb).
# Older lines are deleted. In order to disable cycle buffer use idea.cycle.buffer.size=disabled
#---------------------------------------------------------------------
idea.cycle.buffer.size=1024

#---------------------------------------------------------------------
# Configure if a special launcher should be used when running processes from within IDE.
# Using Launcher enables "soft exit" and "thread dump" features
#---------------------------------------------------------------------
idea.no.launcher=false

#---------------------------------------------------------------------
# To avoid too long classpath
#---------------------------------------------------------------------
idea.dynamic.classpath=false

#---------------------------------------------------------------------
# Uncomment this property to prevent IDE from throwing ProcessCanceledException when user activity
# detected. This option is only useful for plugin developers, while debugging PSI related activities
# performed in background error analysis thread.
# DO NOT UNCOMMENT THIS UNLESS YOU'RE DEBUGGING IDE ITSELF. Significant slowdowns and lockups will happen otherwise.
#---------------------------------------------------------------------
#idea.ProcessCanceledException=disabled

#---------------------------------------------------------------------
# There are two possible values of idea.popup.weight property: "heavy" and "medium".
# If you have WM configured as "Focus follows mouse with Auto Raise" then you have to
# set this property to "medium". It prevents problems with popup menus on some
# configurations.
#---------------------------------------------------------------------
idea.popup.weight=heavy

#---------------------------------------------------------------------
# Removing this property may lead to editor performance degradation under Windows.
#---------------------------------------------------------------------
sun.java2d.d3d=false

#---------------------------------------------------------------------
# Set swing.bufferPerWindow=false to workaround a slow scrolling in JDK6 (see IDEA-35883),
# But this may lead to performance degradation in JDK8, because it disables a double buffering,
# which is needed to eliminate tearing on blit-accelerated scrolling and to restore
# a frame buffer content without the usual repainting, even when the EDT is blocked.
#---------------------------------------------------------------------
swing.bufferPerWindow=true

#---------------------------------------------------------------------
# Removing this property may lead to editor performance degradation under X Window.
#---------------------------------------------------------------------
sun.java2d.pmoffscreen=false

#---------------------------------------------------------------------
# Enables HiDPI support in JBRE
#---------------------------------------------------------------------
sun.java2d.uiScale.enabled=true

#---------------------------------------------------------------------
# Applicable to the Swing text components displaying HTML (except JEditorPane).
# Rebases CSS size map depending on the component's font size to let relative
# font size values (smaller, larger) scale properly. JBRE only.
#---------------------------------------------------------------------
javax.swing.rebaseCssSizeMap=true

#---------------------------------------------------------------------
# Workaround to avoid long hangs while accessing clipboard under Mac OS X.
#---------------------------------------------------------------------
#ide.mac.useNativeClipboard=True

#---------------------------------------------------------------------
# Maximum size (kilobytes) IDEA will load for showing past file contents -
# in Show Diff or when calculating Digest Diff
#---------------------------------------------------------------------
#idea.max.vcs.loaded.size.kb=20480

#---------------------------------------------------------------------
# IDEA file chooser peeks inside directories to detect whether they contain a valid project
# (to mark such directories with a corresponding icon).
# Uncommenting the option prevents this behavior outside of user home directory.
#---------------------------------------------------------------------
#idea.chooser.lookup.for.project.dirs=false

#-----------------------------------------------------------------------
# Experimental option that does a number of things to make truly smooth scrolling possible:
#
# * Enables hardware-accelerated scrolling.
#     Blit-acceleration copies as much of the rendered area as possible and then repaints only newly exposed region.
#     This helps to improve scrolling performance and to reduce CPU usage (especially if drawing is compute-intensive).
#
# * Enables "true double buffering".
#     True double buffering is needed to eliminate tearing on blit-accelerated scrolling and to restore
#     frame buffer content without the usual repainting, even when the EDT is blocked.
#
# * Adds "idea.true.smooth.scrolling.debug" option.
#     Checks whether blit-accelerated scrolling is feasible, and if so, checks whether true double buffering is available.
#
# * Enables handling of high-precision mouse wheel events.
#     Although Java 7 introduced MouseWheelEven.getPreciseWheelRotation() method, JScrollPane doesn't use it so far.
#     Depends on the Editor / General / Smooth Scrolling setting, remote desktop detection and power save mode state.
#     Ideally, we need to patch the runtime (on Windows, Linux and Mac OS) to improve handling of the fine-grained input data.
#     This feature can be toggled via "idea.true.smooth.scrolling.high.precision" option.
#
# * Enables handling of pixel-perfect scrolling events.
#     Currently this mode is available only under Mac OS with JetBrains Runtime.
#     This feature can be toggled via "idea.true.smooth.scrolling.pixel.perfect" option.
#
# * Enables interpolation of scrolling input (scrollbar, mouse wheel, touchpad, keys, etc).
#     Smooths input which lacks both spatial and temporal resolution, performs the rendering asynchronously.
#     Depends on the Editor / General / Smooth Scrolling setting, remote desktop detection and power save mode state.
#     The feature can be tweaked using the following options:
#       "idea.true.smooth.scrolling.interpolation" - the main switch
#       "idea.true.smooth.scrolling.interpolation.scrollbar" - scrollbar interpolation
#       "idea.true.smooth.scrolling.interpolation.scrollbar.delay" - initial delay for scrollbar interpolation (ms)
#       "idea.true.smooth.scrolling.interpolation.mouse.wheel" - mouse wheel / touchpad interpolation
#       "idea.true.smooth.scrolling.interpolation.mouse.wheel.delay.min" - minimum initial delay for mouse wheel interpolation (ms)
#       "idea.true.smooth.scrolling.interpolation.mouse.wheel.delay.max" - maximum initial delay for mouse wheel interpolation (ms)
#       "idea.true.smooth.scrolling.interpolation.precision.touchpad" - precision touchpad interpolation
#       "idea.true.smooth.scrolling.interpolation.precision.touchpad.delay" - initial delay for precision touchpad interpolation (ms)
#       "idea.true.smooth.scrolling.interpolation.other" - interpolation of other input sources
#       "idea.true.smooth.scrolling.interpolation.other.delay" - initial delay for other input source interpolation (ms)
#
# * Adds on-demand horizontal scrollbar in editor.
#     The horizontal scrollbar is shown only when it's actually needed for currently visible content.
#     This helps to save editor space and to prevent occasional horizontal "jitter" on vertical touchpad scrolling.
#     This feature can be toggled via "idea.true.smooth.scrolling.dynamic.scrollbars" option.
#-----------------------------------------------------------------------
#idea.true.smooth.scrolling=true

#---------------------------------------------------------------------
# IDEA can copy library .jar files to prevent their locking.
# By default this behavior is enabled on Windows and disabled on other platforms.
# Uncomment this property to override.
#---------------------------------------------------------------------
# idea.jars.nocopy=false

#---------------------------------------------------------------------
# The VM option value to be used to start a JVM in debug mode.
# Some JREs define it in a different way (-XXdebug in Oracle VM)
#---------------------------------------------------------------------
idea.xdebug.key=-Xdebug

#-----------------------------------------------------------------------
# Change to 'enabled' if you want to receive instant visual notifications
# about fatal errors that happen to an IDE or plugins installed.
#-----------------------------------------------------------------------
idea.fatal.error.notification=disabled

更新后的文本为

# Use ${idea.home.path} macro to specify location relative to IDE installation home.
# Use ${xxx} where xxx is any Java property (including defined in previous lines of this file) to refer to its value.
# Note for Windows users: please make sure you're using forward slashes (e.g. c:/idea/system).

##-----------****这里是自己加的
#禁止第一次运行AndroidStudio时,自动检查和升级AndroidSDK
#disable run android sdk at first time
disable.android.first.run=true

#下面两个是AndroidStudio的设置、插件和运行时产生的其他文件存放的目录
#不改的话,Windows中默认在C:\Users\\.AndroidStudio.2\里面
#${idea.home.path}表示AndroidStudio程序的主目录,注意目录分隔符要用正斜杠“/”
##-----------****

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE config folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
# idea.config.path=${user.home}/.AndroidStudio/config
idea.config.path=D:/WorkSoftware/Android/AndroidStudioCache/.AndroidStudio3.3/config
idea.restart.path=D:/WorkSoftware/Android/AndroidStudioCache/.AndroidStudio3.3/restart

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE system folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
# idea.system.path=${user.home}/.AndroidStudio/system
idea.system.path=D:/WorkSoftware/Android/AndroidStudioCache/.AndroidStudio3.3/system
#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to user installed plugins folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
#默认加载路径
# idea.plugins.path=${idea.config.path}/plugins
idea.plugins.path=${idea.system.path}/plugins
#idea.plugins.path=D:/WorkSoftware/Android/AndroidStudioCache/.AndroidStudio3.3/config/plugins

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE logs folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
# idea.log.path=${idea.system.path}/log

#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE should provide code assistance for.
# The larger file is the slower its editor works and higher overall system memory requirements are
# if code assistance is enabled. Remove this property or set to very large number if you need
# code assistance for any files available regardless their size.
#---------------------------------------------------------------------
idea.max.intellisense.filesize=2500

#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE is able to open.
#---------------------------------------------------------------------
idea.max.content.load.filesize=20000

#---------------------------------------------------------------------
# This option controls console cyclic buffer: keeps the console output size not higher than the specified buffer size (Kb).
# Older lines are deleted. In order to disable cycle buffer use idea.cycle.buffer.size=disabled
#---------------------------------------------------------------------
idea.cycle.buffer.size=1024

#---------------------------------------------------------------------
# Configure if a special launcher should be used when running processes from within IDE.
# Using Launcher enables "soft exit" and "thread dump" features
#---------------------------------------------------------------------
idea.no.launcher=false

#---------------------------------------------------------------------
# To avoid too long classpath
#---------------------------------------------------------------------
idea.dynamic.classpath=false

#---------------------------------------------------------------------
# Uncomment this property to prevent IDE from throwing ProcessCanceledException when user activity
# detected. This option is only useful for plugin developers, while debugging PSI related activities
# performed in background error analysis thread.
# DO NOT UNCOMMENT THIS UNLESS YOU'RE DEBUGGING IDE ITSELF. Significant slowdowns and lockups will happen otherwise.
#---------------------------------------------------------------------
#idea.ProcessCanceledException=disabled

#---------------------------------------------------------------------
# There are two possible values of idea.popup.weight property: "heavy" and "medium".
# If you have WM configured as "Focus follows mouse with Auto Raise" then you have to
# set this property to "medium". It prevents problems with popup menus on some
# configurations.
#---------------------------------------------------------------------
idea.popup.weight=heavy

#---------------------------------------------------------------------
# Disabling this property may lead to visual glitches like blinking and fail to repaint
# on certain display adapter cards.
#---------------------------------------------------------------------
sun.java2d.noddraw=true

#---------------------------------------------------------------------
# Removing this property may lead to editor performance degradation under Windows.
#---------------------------------------------------------------------
sun.java2d.d3d=false

#---------------------------------------------------------------------
# Set swing.bufferPerWindow=false to workaround a slow scrolling in JDK6 (see IDEA-35883),
# But this may lead to performance degradation in JDK8, because it disables a double buffering,
# which is needed to eliminate tearing on blit-accelerated scrolling and to restore
# a frame buffer content without the usual repainting, even when the EDT is blocked.
#---------------------------------------------------------------------
swing.bufferPerWindow=true

#---------------------------------------------------------------------
# Removing this property may lead to editor performance degradation under X Window.
#---------------------------------------------------------------------
sun.java2d.pmoffscreen=false

#---------------------------------------------------------------------
# Enables HiDPI support in JBRE
#---------------------------------------------------------------------
sun.java2d.uiScale.enabled=false

#---------------------------------------------------------------------
# Workaround to avoid long hangs while accessing clipboard under Mac OS X.
#---------------------------------------------------------------------
#ide.mac.useNativeClipboard=True

#---------------------------------------------------------------------
# Maximum size (kilobytes) IDEA will load for showing past file contents -
# in Show Diff or when calculating Digest Diff
#---------------------------------------------------------------------
#idea.max.vcs.loaded.size.kb=20480

#---------------------------------------------------------------------
# IDEA file chooser peeks inside directories to detect whether they contain a valid project
# (to mark such directories with a corresponding icon).
# Uncommenting the option prevents this behavior outside of user home directory.
#---------------------------------------------------------------------
#idea.chooser.lookup.for.project.dirs=false

#-----------------------------------------------------------------------
# Experimental option that does a number of things to make truly smooth scrolling possible:
#
# * Enables hardware-accelerated scrolling.
#     Blit-acceleration copies as much of the rendered area as possible and then repaints only newly exposed region.
#     This helps to improve scrolling performance and to reduce CPU usage (especially if drawing is compute-intensive).
#
# * Enables "true double buffering".
#     True double buffering is needed to eliminate tearing on blit-accelerated scrolling and to restore
#     frame buffer content without the usual repainting, even when the EDT is blocked.
#
# * Adds "idea.true.smooth.scrolling.debug" option.
#     Checks whether blit-accelerated scrolling is feasible, and if so, checks whether true double buffering is available.
#
# * Enables handling of high-precision mouse wheel events.
#     Although Java 7 introduced MouseWheelEven.getPreciseWheelRotation() method, JScrollPane doesn't use it so far.
#     Depends on the Editor / General / Smooth Scrolling setting, remote desktop detection and power save mode state.
#     Ideally, we need to patch the runtime (on Windows, Linux and Mac OS) to improve handling of the fine-grained input data.
#     This feature can be toggled via "idea.true.smooth.scrolling.high.precision" option.
#
# * Enables handling of pixel-perfect scrolling events.
#     Currently this mode is available only under Mac OS with JetBrains Runtime.
#     This feature can be toggled via "idea.true.smooth.scrolling.pixel.perfect" option.
#
# * Enables interpolation of scrolling input (scrollbar, mouse wheel, touchpad, keys, etc).
#     Smooths input which lacks both spatial and temporal resolution, performs the rendering asynchronously.
#     Depends on the Editor / General / Smooth Scrolling setting, remote desktop detection and power save mode state.
#     The feature can be tweaked using the following options:
#       "idea.true.smooth.scrolling.interpolation" - the main switch
#       "idea.true.smooth.scrolling.interpolation.scrollbar" - scrollbar interpolation
#       "idea.true.smooth.scrolling.interpolation.scrollbar.delay" - initial delay for scrollbar interpolation (ms)
#       "idea.true.smooth.scrolling.interpolation.mouse.wheel" - mouse wheel / touchpad interpolation
#       "idea.true.smooth.scrolling.interpolation.mouse.wheel.delay.min" - minimum initial delay for mouse wheel interpolation (ms)
#       "idea.true.smooth.scrolling.interpolation.mouse.wheel.delay.max" - maximum initial delay for mouse wheel interpolation (ms)
#       "idea.true.smooth.scrolling.interpolation.precision.touchpad" - precision touchpad interpolation
#       "idea.true.smooth.scrolling.interpolation.precision.touchpad.delay" - initial delay for precision touchpad interpolation (ms)
#       "idea.true.smooth.scrolling.interpolation.other" - interpolation of other input sources
#       "idea.true.smooth.scrolling.interpolation.other.delay" - initial delay for other input source interpolation (ms)
#
# * Adds on-demand horizontal scrollbar in editor.
#     The horizontal scrollbar is shown only when it's actually needed for currently visible content.
#     This helps to save editor space and to prevent occasional horizontal "jitter" on vertical touchpad scrolling.
#     This feature can be toggled via "idea.true.smooth.scrolling.dynamic.scrollbars" option.
#-----------------------------------------------------------------------
#idea.true.smooth.scrolling=true

#---------------------------------------------------------------------
# IDEA can copy library .jar files to prevent their locking.
# By default this behavior is enabled on Windows and disabled on other platforms.
# Uncomment this property to override.
#---------------------------------------------------------------------
# idea.jars.nocopy=false

#---------------------------------------------------------------------
# The VM option value to be used to start a JVM in debug mode.
# Some JREs define it in a different way (-XXdebug in Oracle VM)
#---------------------------------------------------------------------
idea.xdebug.key=-Xdebug

#-----------------------------------------------------------------------
# Change to 'enabled' if you want to receive instant visual notifications
# about fatal errors that happen to an IDE or plugins installed.
#-----------------------------------------------------------------------
idea.fatal.error.notification=disabled

主要修改以下几处地方

idea.config.path=D:/WorkSoftware/Android/AndroidStudioCache/.AndroidStudio3.3/config
idea.restart.path=D:/WorkSoftware/Android/AndroidStudioCache/.AndroidStudio3.3/restart
# idea.system.path=${user.home}/.AndroidStudio/system
idea.system.path=D:/WorkSoftware/Android/AndroidStudioCache/.AndroidStudio3.3/system
#默认加载路径
# idea.plugins.path=${idea.config.path}/plugins
idea.plugins.path=${idea.system.path}/plugins
#idea.plugins.path=D:/WorkSoftware/Android/AndroidStudioCache/.AndroidStudio3.3/config/plugins

2.发现修改以后在系统C盘的文件是不会修改了,但是AndroidStudio的插件更新和安装失效

参考资料

主要内容:

分析得出AS中安装插件流程

  1. 首先在${idea.system.path}/plugins目录下生成action.script和对应插件的jar或压缩包。
  2. 重启过程中根据action.script内容解压或移动插件jar到${idea.plugins.path}/目录下。
  3. 修改${idea.config.path}/options/options.xml文件中的
    <property name="PLUGIN_FILTER" value="" /> 的value字段。
  4. 删除1中产生的action.script和插件文件。

但是在更改目录后,安装插件流程1中生成的script文件正常,也能在重启后正确执行流程3,但是流程2解压或移动插件文件与流程4删除相关文件没有执行。

原因与解决

初步判断可能存在写权限的问题,导致无法创建文件和删除,估计在某个版本会修复。

临时解决办法可以在安装插件后重启下AS,再手动复制插件的相关jar或者解压插件压缩包后复制插件jar到${idea.plugins.path}/目录下之后删除 {idea.system.path}/plugins目录下文件再次重启AS即可正常使用插件。

关于Zip相关的解决方法

举例未安装插件GsonFormat,jar为GsonFormat.jar,则操作如下:
在目录(安卓根目录下的pugins目录下):         

下面建立GsonFormat/lib 的目录结构,把GsonFormat.jar复制进去。

重新启动AS,问题解决。

如果下载下来的是zip文件,则解压之后,目录格式还是:
插件名称/lib 
将整个目录复制到AS插件目录下,重启AS,问题解决。

3.尝试修改文件夹权限
 

修改之后

经验:要根据查询到的资料尝试,当文件相关的问题先考虑文件的权限

jar相关的可以了 但是新的问题是zip的无法安装了

实际证明关于ZIP类型的插件还是会失败,只能通过解压然后放到指定文件夹下入图所示:

将1文件夹解压放成2 并把里面的文件都复制出来删除空文件夹就好

希望AndroidStudio开发团队跟进,zip的插件直接install也是无效的

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值