gpt4 book ai didi

android-studio - 升级 Android Studio 到 3.4.1 和 gradle 问题

转载 作者:行者123 更新时间:2023-12-03 17:14:34 25 4
gpt4 key购买 nike

我已经将一个 Android 项目从 3.2 升级到 3.4.1,现在我遇到了 gradle 问题。

唯一的指示是顶部的栏

enter image description here

以及事件日志中的一条消息。

Gradle sync failed: EventQueue.isDispatchThread()=false Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue@34e0424
Current thread: Thread[ApplicationImpl pooled thread 19,4,Idea Thread Group] 388194366
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,Idea Thread Group] 847161915 (1 s 526 ms)

我已经清理了重建项目。

单击 Open Build View -> 没有任何反应。

日志文件包含:

INFO - e.project.sync.GradleSyncState - Finished source generation of project 'Chronica'. 
2019-05-26 10:04:57,336 [thread 126] INFO - ule.android.SdkModuleSetupStep - Set Android SDK 'Android API 26 Platform' (C:\Users\andreas\AppData\Local\Android\Sdk) to module 'LVLLibrary'
2019-05-26 10:04:57,340 [thread 126] INFO - ule.android.SdkModuleSetupStep - Set Android SDK 'Android API 28 Platform' (C:\Users\andreas\AppData\Local\Android\Sdk) to module 'app'
2019-05-26 10:04:57,425 [thread 126] INFO - e.project.sync.GradleSyncState - Gradle sync failed: EventQueue.isDispatchThread()=false Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue@34e0424
Current thread: Thread[ApplicationImpl pooled thread 126,4,Idea Thread Group] 812028699
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,Idea Thread Group] 847161915 (852 ms)
2019-05-26 10:04:57,425 [thread 126] WARN - ject.sync.ng.SyncResultHandler - Gradle sync failed
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: EventQueue.isDispatchThread()=false Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue@34e0424
Current thread: Thread[ApplicationImpl pooled thread 126,4,Idea Thread Group] 812028699
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,Idea Thread Group] 847161915
at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1133)
at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1122)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:289)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:282)
at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl.tryStartReloadWithProgress(EncodingProjectManagerImpl.java:361)
at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl.reloadAllFilesUnder(EncodingProjectManagerImpl.java:366)
at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl.setEncoding(EncodingProjectManagerImpl.java:180)
at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl.setDefaultCharsetName(EncodingProjectManagerImpl.java:408)
at com.android.tools.idea.gradle.project.sync.validation.android.EncodingValidationStrategy.fixAndReportFoundIssues(EncodingValidationStrategy.java:83)
at com.android.tools.idea.gradle.project.sync.validation.android.AndroidModuleValidator$AndroidModuleValidatorImpl.fixAndReportFoundIssues(AndroidModuleValidator.java:63)
at com.android.tools.idea.gradle.project.sync.ng.AndroidModuleProcessor.processAndroidModels(AndroidModuleProcessor.java:63)
at com.android.tools.idea.gradle.project.sync.ng.SyncProjectModelsSetup.setUpModules(SyncProjectModelsSetup.java:143)
at com.android.tools.idea.gradle.project.sync.ng.ProjectSetup$ProjectSetupImpl.setUpProject(ProjectSetup.java:69)
at com.android.tools.idea.gradle.project.sync.ng.SyncResultHandler.setUpProject(SyncResultHandler.java:136)
at com.android.tools.idea.gradle.project.sync.ng.SyncResultHandler.onSyncFinished(SyncResultHandler.java:88)
at com.android.tools.idea.gradle.project.sync.ng.SyncResultHandler.lambda$onCompoundSyncModels$6(SyncResultHandler.java:268)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

如何分析这个,如何获得有意义的信息。每次升级 Androidstudio 时都失明,这非常令人沮丧。有没有办法通过控制台/终端执行同步?

更新我可以限制这个案子。我发现只有在添加 android 库(模块)时才会发生这种情况。我不明白为什么会这样。

更新 2我为我找到了解决方案。升级过程将以下内容添加到我的 gradle 脚本中,这导致了问题。删除后它起作用了:

compileOptions.encoding = 'ISO-8859-1'产品 flavor {}

问题仍然悬而未决。我们如何才能以专业的方式分析这种问题。我不得不在没有任何上下文路径的情况下比较文件。

最佳答案

这对我有好处。下载一些组件:

enter image description here

关于android-studio - 升级 Android Studio 到 3.4.1 和 gradle 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56311758/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com