从 Android Studio 安装应用程序已超时

Installing an app from Android Studio has timed out

自从我们迁移到模块后,我们开始在第二次安装应用程序时遇到超时。只有当我们第二次 运行 应用程序时才会发生。如果我们清除项目 (Build->Clean Project),它会正常启动,但下次我们尝试 运行 时,它会超时。 我查看了 Android Studio 日志,发现在启动应用程序时抛出一个错误,但我不确定会出现什么问题以及如何解释这些日志。这是日志的快照:

    2021-01-19 12:26:15,790 [413000061]   INFO - ools.idea.run.tasks.DeployTask - Installing application: ***** 
2021-01-19 12:26:15,792 [413000063]  ERROR - intellij.openapi.progress.Task - entry 
java.lang.NullPointerException: entry
    at java.util.zip.ZipFile.getInputStream(ZipFile.java:361)
    at com.android.tools.deployer.ApkParser.getApkDetails(ApkParser.java:88)
    at com.android.tools.deployer.ApkParser.parse(ApkParser.java:107)
    at com.android.tools.deployer.ApkParser.parsePaths(ApkParser.java:76)
    at com.android.tools.deployer.ApkInstaller.deltaInstall(ApkInstaller.java:244)
    at com.android.tools.deployer.ApkInstaller.install(ApkInstaller.java:91)
    at com.android.tools.deployer.Deployer.install(Deployer.java:145)
    at com.android.tools.idea.run.tasks.DeployTask.perform(DeployTask.java:119)
    at com.android.tools.idea.run.tasks.AbstractDeployTask.run(AbstractDeployTask.java:119)
    at com.android.tools.idea.run.LaunchTaskRunner.run(LaunchTaskRunner.java:191)
    at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:932)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync(CoreProgressManager.java:434)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$null(ProgressRunner.java:233)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess(CoreProgressManager.java:166)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:627)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:572)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:153)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit(ProgressRunner.java:233)
    at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2021-01-19 12:26:15,798 [413000069]  ERROR - intellij.openapi.progress.Task - Android Studio 4.1.1  Build #AI-201.8743.12.41.6953283 
2021-01-19 12:26:15,799 [413000070]  ERROR - intellij.openapi.progress.Task - JDK: 1.8.0_242-release; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o 
2021-01-19 12:26:15,799 [413000070]  ERROR - intellij.openapi.progress.Task - OS: Windows 10 
2021-01-19 12:26:15,799 [413000070]  ERROR - intellij.openapi.progress.Task - Last Action: Run 
2021-01-19 12:26:46,303 [413030574]   INFO - j.ide.actions.RevealFileAction - Exit code 1

拜托,帮忙。

此问题与 Android Studio 和 Android Gradle 插件的不同版本有关。当我将 Android Gradle 插件版本更新为最新可用版本时,问题就消失了。有关详细信息,请参阅 issue tracker 中发布的问题。