HarmonyOS 鸿蒙模拟器启动不起来,报错,哪位大佬帮忙看下

发布于 1周前 作者 yibo5220 来自 鸿蒙OS

HarmonyOS 鸿蒙模拟器启动不起来,报错,哪位大佬帮忙看下

java.lang.NoClassDefFoundError: Could not initialize class com.huawei.bitfun.search.bootstrap.Bootstrap

    at com.huawei.ohos.infocenter.service.search.SearchService.setSearchReadType(SearchService.java:211)

    at com.huawei.ohos.infocenter.service.update.DocUpdateService.initUpdateDocStatus(DocUpdateService.java:562)

    at com.huawei.ohos.infocenter.service.update.DocUpdateService.initDocUpdateStatus(DocUpdateService.java:361)

    at com.huawei.ohos.infocenter.component.FirstStartInitialization.lambda$runActivity$0(FirstStartInitialization.java:73)

    at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:250)

    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)

    at com.intellij.util.concurrency.ContextCallable.call(ContextCallable.java:32)

    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

    at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)

    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)

    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)

    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)

    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)

    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)

    at java.base/java.lang.Thread.run(Thread.java:840)

Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.ExceptionInInitializerError [in thread “ApplicationImpl pooled thread 3”]

    at com.huawei.bitfun.search.bootstrap.Bootstrap.<clinit>(Bootstrap.java:49)

    at com.huawei.ohos.infocenter.service.search.SearchService.lambda$createIndexByCacheType$3(SearchService.java:128)

    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178)

    at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)

    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)

    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)

    at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)

    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)

    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)

    at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)

    at com.huawei.ohos.infocenter.service.search.SearchService.createIndexByCacheType(SearchService.java:129)

    at com.huawei.ohos.infocenter.component.FirstStartInitialization.initSearchService(FirstStartInitialization.java:195)

    at com.huawei.ohos.infocenter.component.FirstStartInitialization.lambda$runActivity$0(FirstStartInitialization.java:66)

    … 12 more

1 回复

针对您提到的HarmonyOS鸿蒙模拟器启动不起来并报错的问题,这里提供一些可能的解决方案:

  1. 检查开发环境:请确保您的Java JDK、Android Studio及其插件等版本符合模拟器运行要求,并检查是否有可用的更新,特别是HarmonyOS插件和SDK。
  2. 清理模拟器数据:在模拟器设备列表窗口,尝试点击“Wipe User Data”清理模拟器用户数据,然后重新启动模拟器。
  3. 重置模拟器设置:在Android Studio的设置中,找到SDKs下的HarmonyOS界面,尝试卸载并重新下载模拟器镜像文件或应用,然后重新启动模拟器。
  4. 检查日志信息:如果模拟器报错,请查看详细的错误日志,根据日志中的错误信息进行针对性解决。

另外,这套HarmonyOS Next 纯血鸿蒙教程前几讲也有详细讲解,学学就会了https://www.bilibili.com/video/BV1fw2ZYSEk2

回到顶部