无法打开 Android Studio Canary 15 |北极狐

时间:2021-05-17 05:22:49

标签: java android android-studio intellij-idea awt

我最近在 Android Studio 的最新 Canary 版本中遇到了一个问题。过去一周我一直在定期使用它,效果很好。但是今天我尝试像往常一样打开android studio,但它不会打开。奇怪,因为我还没有更新任何东西(?!)。检查日志,似乎 AWT 及其依赖项存在问题。

由于 Android Studio 使用自己打包的 JRE,我觉得我没有太多可尝试的。

到目前为止我已经尝试过;

  • 重新安装并运行 Android Studio(尝试下载 .zip 和 .exe)
  • 擦除 %appdata%/google/ 中的所有 android studio 缓存信息

关于如何解决这个问题的任何想法?

更多信息:

工作室构建:android-studio-2020.3.1.15

Gradle 插件版本:不适用

Gradle 版本:6.5.1

Java 版本:JDK 11 "11.0.11" 2021-04-20 LTS

操作系统:Windows 10 64 位 x86

重现步骤:

  1. 使用 Windows 10
  2. https://developer.android.com/studio/archive 下载 Canary 15 .zip 并解压缩(或 .exe 安装程序,然后安装)
  3. 运行 studio64.exe

说明:

Studio 没有打开任何东西,加载图标在鼠标上旋转几秒钟,然后什么也没有。 日志显示“UI 初始化失败。(...) ${android_studio_install_dir}\jre\bin\awt.dll:找不到依赖库”

堆栈跟踪:

2021-05-17 16:57:29,705 [      0]   INFO -        #com.intellij.idea.Main - ------------------------------------------------------ IDE STARTED ------------------------------------------------------ 
2021-05-17 16:57:29,762 [     57]   INFO -        #com.intellij.idea.Main - IDE: Android Studio (build #AI-203.7717.56.2031.7321754, 29 Apr 2021 11:10) 
2021-05-17 16:57:29,764 [     59]   INFO -        #com.intellij.idea.Main - OS: Windows 10 (10.0, amd64) 
2021-05-17 16:57:29,778 [     73]   INFO -        #com.intellij.idea.Main - JRE: 11.0.10+0-b96-7249189 (Oracle Corporation) 
2021-05-17 16:57:29,778 [     73]   INFO -        #com.intellij.idea.Main - JVM: 11.0.10+0-b96-7249189 (OpenJDK 64-Bit Server VM) 
2021-05-17 16:57:29,782 [     77]   INFO -        #com.intellij.idea.Main - JVM Args: exit -Xms256m -Xmx1280m -XX:ReservedCodeCacheSize=512m -XX:MaxJavaStackTraceDepth=10000 -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -ea -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=50 -XX:CICompilerCount=2 -Dsun.io.useCanonCaches=false -Djdk.http.auth.tunneling.disabledSchemes="" -Djdk.attach.allowAttachSelf=true -Djdk.module.illegalAccess.silent=true -Dkotlinx.coroutines.debug=off -Djna.nosys=true -Djna.boot.library.path= -Didea.vendor.name=Google -Djb.vmOptionsFile=C:\Program Files\Android\Android Studio\bin\studio64.exe.vmoptions -Djava.library.path=C:\Program Files\Android\Android Studio\jre\\bin;C:\Program Files\Android\Android Studio\jre\\bin\server -Didea.platform.prefix=AndroidStudio -Didea.jre.check=true -Dide.native.launcher=true -Didea.vendor.name=Google -Didea.paths.selector=AndroidStudioPreview2020.3 -XX:ErrorFile=C:\Users\username\java_error_in_studio64_%p.log -XX:HeapDumpPath=C:\Users\username\java_error_in_studio64.hprof 
2021-05-17 16:57:29,783 [     78]   INFO -        #com.intellij.idea.Main - library path: C:\Program Files\Android\Android Studio\jre\\bin;C:\Program Files\Android\Android Studio\jre\\bin\server 
2021-05-17 16:57:29,783 [     78]   INFO -        #com.intellij.idea.Main - boot library path: C:\Program Files\Android\Android Studio\jre\bin 
2021-05-17 16:57:29,817 [    112]   INFO -        #com.intellij.idea.Main - locale=en_NZ JNU=Cp1252 file.encoding=Cp1252
  idea.config.path=C:\Users\username\AppData\Roaming\Google\AndroidStudioPreview2020.3
  idea.system.path=C:\Users\username\AppData\Local\Google\AndroidStudioPreview2020.3
  idea.plugins.path=C:\Users\username\AppData\Roaming\Google\AndroidStudioPreview2020.3\plugins
  idea.log.path=C:\Users\username\Desktop\log 
2021-05-17 16:57:29,875 [    170]   INFO -        #com.intellij.idea.Main - JNA library (64-bit) loaded in 57 ms 
2021-05-17 16:57:29,947 [    242]   INFO - penapi.util.io.win32.IdeaWin32 - Native filesystem for Windows is operational 
2021-05-17 16:57:29,949 [    244]   INFO -                         STDERR -  
2021-05-17 16:57:29,949 [    244]   INFO -                         STDERR - Start Failed 
2021-05-17 16:57:29,950 [    245]   INFO -                         STDERR - Internal error. Please refer to https://code.google.com/p/android/issues 
2021-05-17 16:57:29,950 [    245]   INFO -                         STDERR -  
2021-05-17 16:57:29,950 [    245]   INFO -                         STDERR - com.intellij.ide.plugins.StartupAbortedException: UI initialization failed 
2021-05-17 16:57:29,950 [    245]   INFO -                         STDERR -     at com.intellij.idea.StartupUtil.lambda$prepareApp$3(StartupUtil.java:194) 
2021-05-17 16:57:29,950 [    245]   INFO -                         STDERR -     at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:986) 
2021-05-17 16:57:29,950 [    245]   INFO -                         STDERR -     at java.base/java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(CompletableFuture.java:970) 
2021-05-17 16:57:29,950 [    245]   INFO -                         STDERR -     at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) 
2021-05-17 16:57:29,950 [    245]   INFO -                         STDERR -     at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088) 
2021-05-17 16:57:29,950 [    245]   INFO -                         STDERR -     at com.intellij.idea.StartupUtil.lambda$scheduleInitUi$9(StartupUtil.java:375) 
2021-05-17 16:57:29,950 [    245]   INFO -                         STDERR -     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 
2021-05-17 16:57:29,950 [    245]   INFO -                         STDERR -     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 
2021-05-17 16:57:29,950 [    245]   INFO -                         STDERR -     at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668) 
2021-05-17 16:57:29,950 [    245]   INFO -                         STDERR -     at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665) 
2021-05-17 16:57:29,950 [    245]   INFO -                         STDERR -     at java.base/java.security.AccessController.doPrivileged(Native Method) 
2021-05-17 16:57:29,950 [    245]   INFO -                         STDERR -     at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665) 
2021-05-17 16:57:29,950 [    245]   INFO -                         STDERR -     at java.base/java.lang.Thread.run(Thread.java:834) 
2021-05-17 16:57:29,950 [    245]   INFO -                         STDERR - Caused by: java.util.concurrent.CompletionException: java.lang.UnsatisfiedLinkError: C:\Program Files\Android\Android Studio\jre\bin\awt.dll: Can't find dependent libraries 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331) 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:346) 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     at java.base/java.util.concurrent.CompletableFuture$BiRelay.tryFire(CompletableFuture.java:1423) 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     ... 10 more 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR - Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\Android\Android Studio\jre\bin\awt.dll: Can't find dependent libraries 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method) 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442) 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498) 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694) 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2648) 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830) 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     at java.base/java.lang.System.loadLibrary(System.java:1873) 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1395) 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1393) 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     at java.base/java.security.AccessController.doPrivileged(Native Method) 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1392) 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1430) 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     at java.desktop/java.awt.EventQueue.invokeLater(EventQueue.java:1318) 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     at com.intellij.idea.StartupUtil.lambda$scheduleInitUi$9(StartupUtil.java:326) 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -     ... 7 more 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR -  
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR - ----- 
2021-05-17 16:57:29,951 [    246]   INFO -                         STDERR - Your JRE: 11.0.10+0-b96-7249189 amd64 (Oracle Corporation) 
2021-05-17 16:57:29,952 [    247]   INFO -                         STDERR - C:\Program Files\Android\Android Studio\jre 
2021-05-17 16:57:29,969 [    264]   INFO -                         STDERR -  
2021-05-17 16:57:29,970 [    265]   INFO -                         STDERR - Also, a UI exception occurred on an attempt to show the above message 
2021-05-17 16:57:29,970 [    265]   INFO -                         STDERR - java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit 
2021-05-17 16:57:29,970 [    265]   INFO -                         STDERR -     at java.desktop/java.awt.Component.<clinit>(Component.java:626) 
2021-05-17 16:57:29,970 [    265]   INFO -                         STDERR -     at com.intellij.idea.Main.showMessage(Main.java:317) 
2021-05-17 16:57:29,970 [    265]   INFO -                         STDERR -     at com.intellij.idea.Main.showMessage(Main.java:270) 
2021-05-17 16:57:29,971 [    266]   INFO -                         STDERR -     at com.intellij.ide.plugins.StartupAbortedException.logAndExit(StartupAbortedException.java:86) 
2021-05-17 16:57:29,971 [    266]   INFO -                         STDERR -     at com.intellij.ide.plugins.StartupAbortedException.processException(StartupAbortedException.java:34) 
2021-05-17 16:57:29,971 [    266]   INFO -                         STDERR -     at com.intellij.idea.StartupUtil.lambda$prepareApp$3(StartupUtil.java:194) 
2021-05-17 16:57:29,971 [    266]   INFO -                         STDERR -     at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:986) 
2021-05-17 16:57:29,971 [    266]   INFO -                         STDERR -     at java.base/java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(CompletableFuture.java:970) 
2021-05-17 16:57:29,971 [    266]   INFO -                         STDERR -     at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) 
2021-05-17 16:57:29,971 [    266]   INFO -                         STDERR -     at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088) 
2021-05-17 16:57:29,972 [    267]   INFO -                         STDERR -     at com.intellij.idea.StartupUtil.lambda$scheduleInitUi$9(StartupUtil.java:375) 
2021-05-17 16:57:29,972 [    267]   INFO -                         STDERR -     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 
2021-05-17 16:57:29,972 [    267]   INFO -                         STDERR -     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 
2021-05-17 16:57:29,972 [    267]   INFO -                         STDERR -     at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668) 
2021-05-17 16:57:29,973 [    268]   INFO -                         STDERR -     at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665) 
2021-05-17 16:57:29,973 [    268]   INFO -                         STDERR -     at java.base/java.security.AccessController.doPrivileged(Native Method) 
2021-05-17 16:57:29,973 [    268]   INFO -                         STDERR -     at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665) 
2021-05-17 16:57:29,973 [    268]   INFO -                         STDERR -     at java.base/java.lang.Thread.run(Thread.java:834) 
2021-05-17 16:57:29,975 [    270]   INFO -        #com.intellij.idea.Main - ------------------------------------------------------ IDE SHUTDOWN ------------------------------------------------------ 
2021-05-17 16:57:30,251 [    546]   INFO - llij.ide.plugins.PluginManager - Plugin PluginDescriptor(name=Database Navigator, id=DBN, path=C:\Users\username\AppData\Roaming\Google\AndroidStudioPreview2020.3\plugins\DBNavigator, version=3.2.3225.0) misses optional descriptor JavaPlugin.xml 
2021-05-17 16:57:30,286 [    581]   INFO - org.jetbrains.io.BuiltInServer - web server stopped 

1 个答案:

答案 0 :(得分:0)

安装 aka.ms/vs/16/release/vc_redist.x64.exe 解决了这个问题。

编辑:替代下载:visualstudio.microsoft.com/downloads/

感谢@y.bedrov