DevEco studio 5.1 启动报错

DevEco studio 5.1 启动报错 报错信息:

Internal error. Please refer to https://jb.gg/ide/critical-startup-errors

com.intellij.diagnostic.PluginException: java.io.IOException: /Volumes/LenovoY910/Applications/DevEco-Studio.app/Contents/plugins/openharmony/lib/._javassist-3.30.2-GA.jar [Plugin: com.huawei.ohos]
    at com.intellij.serviceContainer.ComponentManagerImpl.registerComponents2(ComponentManagerImpl.kt:556)
    at com.intellij.serviceContainer.ComponentManagerImpl.registerComponents(ComponentManagerImpl.kt:499)
    at com.intellij.serviceContainer.ComponentManagerImpl.access$registerComponents(ComponentManagerImpl.kt:93)
    at com.intellij.serviceContainer.ComponentManagerImpl.registerComponents(ComponentManagerImpl.kt:404)
    at com.intellij.openapi.client.ClientAwareComponentManager.registerComponents(ClientAwareComponentManager.kt:58)
    at com.intellij.platform.ide.bootstrap.ApplicationLoader$initServiceContainer$2.invokeSuspend(ApplicationLoader.kt:197)
    at com.intellij.platform.ide.bootstrap.ApplicationLoader$initServiceContainer$2.invoke(ApplicationLoader.kt)
    at com.intellij.platform.ide.bootstrap.ApplicationLoader$initServiceContainer$2.invoke(ApplicationLoader.kt)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
    at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
    at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span(tracer.kt:56)
    at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span$default(tracer.kt:49)
    at com.intellij.platform.ide.bootstrap.ApplicationLoader.initServiceContainer(ApplicationLoader.kt:196)
    at com.intellij.platform.ide.bootstrap.ApplicationLoader.access$initServiceContainer(ApplicationLoader.kt:1)
    at com.intellij.platform.ide.bootstrap.ApplicationLoader$initServiceContainer$1.invokeSuspend(ApplicationLoader.kt)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:270)
    at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Caused by: java.io.UncheckedIOException: java.io.IOException: /Volumes/LenovoY910/Applications/DevEco-Studio.app/Contents/plugins/openharmony/lib/._javassist-3.30.2-GA.jar
    at com.intellij.util.lang.ZipResourceFile.<init>(ZipResourceFile.java:40)
    at com.intellij.util.lang.PathClassLoader.lambda$static$1(PathClassLoader.java:33)
    at com.intellij.util.lang.ClassPath.createLoader(ClassPath.java:397)
    at com.intellij.util.lang.ClassPath.getLoaderSlowPath(ClassPath.java:349)
    at com.intellij.util.lang.ClassPath.findClassWithoutCache(ClassPath.java:224)
    at com.intellij.util.lang.ClassPath.findClass(ClassPath.java:212)
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.kt:326)
    at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.kt:178)
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.kt:151)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
    at com.intellij.serviceContainer.ComponentManagerImpl.registerComponents2Inner(ComponentManagerImpl.kt:590)
    at com.intellij.serviceContainer.ComponentManagerImpl.registerComponents2(ComponentManagerImpl.kt:549)
    ... 24 more
Caused by: java.io.IOException: /Volumes/LenovoY910/Applications/DevEco-Studio.app/Contents/plugins/openharmony/lib/._javassist-3.30.2-GA.jar
    at com.intellij.util.lang.ImmutableZipFile.load(ImmutableZipFile.java:77)
    at com.intellij.util.lang.ImmutableZipFile.load(ImmutableZipFile.java:47)
    at com.intellij.platform.ide.bootstrap.ZipFilePoolImpl.loadZipFile(ZipFilePoolImpl.kt:31)
    at com.intellij.platform.ide.bootstrap.ZipFilePoolImpl.loadZipFile(ZipFilePoolImpl.kt:17)
    at com.intellij.util.lang.ZipResourceFile.<init>(ZipResourceFile.java:35)
    ... 35 more
Caused by: java.util.zip.ZipException: Archive is not a ZIP archive
    at com.intellij.util.lang.ImmutableZipFile.populateFromCentralDirectory(ImmutableZipFile.java:202)
    at com.intellij.util.lang.ImmutableZipFile.load(ImmutableZipFile.java:74)
    ... 39 more

-----
Your JRE: 17.0.12+1-b1087.25 x86_64 (JetBrains s.r.o.)
/Volumes/LenovoY910/Applications/DevEco-Studio.app/Contents/jbr/Contents/Home

操作系统:MacOS 14.6(Sonoma)

CPU: Intel

复现前置条件/步骤:

  1. 官网下载 zip 安装包,解压得到 dmg
  2. 将 dmg 拖动安装到移动硬盘
  3. 安装完成之后,双击启动

4 回复

你这个问题可能是由于安装包损坏或文件系统兼容性导致的

解决方案

1/从开发者官网重新下载安装包,并通过终端校验文件完整性:

shasum -a 256 下载的zip包路径

2/修改安装路径

将DMG文件直接挂载到系统盘(而非移动硬盘);拖动DevEco-Studio图标到 /Applications 目录完成安装;若必须使用移动硬盘,需确保其格式化为MacOS原生支持的APFS/HFS+格式

3/清理残留文件

# 彻底卸载旧版本

rm -rf /Applications/DevEco-Studio.app

rm -rf ~/Library/Application\ Support/Huawei/DevEco-Studio

rm -rf ~/Library/Caches/Huawei/DevEco-Studio

4/修复文件权限

# 针对已安装到移动硬盘的情况

sudo chmod -R 755 /Volumes/LenovoY910/Applications/DevEco-Studio.app

sudo xattr -rd com.apple.quarantine /Volumes/LenovoY910/Applications/DevEco-Studio.app

移动硬盘格式化为 APFS 之后,重新安装正常了! 感谢!一朵小花花,

DevEco Studio 5.1启动报错通常由环境配置问题引起。常见原因包括:JDK版本不兼容(需使用OpenJDK 17)、Node.js版本未安装或版本过低、系统环境变量配置错误、IDE配置文件损坏或与现有项目冲突。可尝试检查并确保OpenJDK 17已正确安装并配置环境变量,或尝试以管理员身份运行IDE。

根据报错信息,核心问题是IDE在启动时无法加载一个关键的JAR文件,具体是 /Volumes/LenovoY910/Applications/DevEco-Studio.app/Contents/plugins/openharmony/lib/._javassist-3.30.2-GA.jar。错误 Archive is not a ZIP archive 表明系统(或IDE)将该文件识别为损坏或无效的ZIP压缩包。

这个以 ._ 开头的文件通常是macOS系统在向非HFS+/APFS格式的磁盘(如你的移动硬盘)拷贝文件时自动生成的资源派生文件(Resource Fork),用于存储一些额外属性。对于应用程序来说,这个文件是无效且多余的,干扰了正常的类加载过程。

根本原因:将DevEco Studio安装到移动硬盘(非Mac原生格式卷宗)导致macOS生成了不必要的 ._ 前缀文件,IDE在扫描插件目录时尝试将其作为有效的JAR包加载,从而引发崩溃。

解决方案

  1. 直接删除问题文件: 打开终端,执行以下命令:

    rm "/Volumes/LenovoY910/Applications/DevEco-Studio.app/Contents/plugins/openharmony/lib/._javassist-3.30.2-GA.jar"
    

    执行后尝试重新启动DevEco Studio。这是最直接有效的解决方法。

  2. 预防性清理(如果问题复发或其他文件导致类似错误): 可以删除该插件目录下所有以 ._ 开头的派生文件:

    find "/Volumes/LenovoY910/Applications/DevEco-Studio.app/Contents/plugins" -name "._*" -type f -delete
    

    注意:此命令会递归删除DevEco Studio应用包内所有插件目录下的此类文件,请谨慎确认路径。

  3. 安装位置建议: 长期来看,建议将DevEco Studio安装到Mac的内置硬盘(通常是APFS格式)的 Applications 文件夹中。这可以避免macOS在外部磁盘上创建资源派生文件,确保应用稳定运行。如果必须使用移动硬盘,请确保其格式化为APFS或HFS+(Mac OS扩展)格式,以减少此类问题。

总结:问题源于macOS在非原生格式磁盘上创建的派生文件与IDE的类加载机制冲突。删除指定的 ._javassist-3.30.2-GA.jar 文件即可解决启动报错。

回到顶部