Android Studio 3.1-插件Android支持中的异常 [英] Android Studio 3.1 - Exception in plugin Android Support
问题描述
我已经更新到最新版本的Android Studio(3.1),并且在尝试运行我的应用程序时出现以下错误.更新之前,它没有任何问题.我还卸载了Android Studio,并从官方网站下载了最新版本.什么都没改变.
I have updated to the latest version of Android Studio (3.1) and I get the following error when I try to run my app. It was working with no problems before the update. I have also uninstalled Android Studio and downloaded the latest version from the official website. Nothing has changed.
null java.lang.NullPointerException
at com.android.tools.idea.run.tasks.InstantRunNotificationTask.<init>(InstantRunNotificationTask.java:64)
at com.android.tools.idea.fd.InstantRunBuildAnalyzer.getNotificationTask(InstantRunBuildAnalyzer.java:188)
at com.android.tools.idea.run.AndroidLaunchTasksProvider.getTasks(AndroidLaunchTasksProvider.java:122)
at com.android.tools.idea.run.LaunchTaskRunner.run(LaunchTaskRunner.java:102)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:713)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:543)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:488)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:165)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:315)
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)
推荐答案
我遇到了完全相同的问题,我担心会损坏某些东西...我通过清理和重建项目来修复它(我已按照建议禁用即时运行在此之前,但是我想那是没有必要的,因为我在清理和重建项目后再次启用了它,并且工作得很好...).
I faced the exact same problem, I was afraid I broke something... I fixed it by cleaning and rebuilding the project (I had disabled instant run as suggested here before but I guess that was not necessary as I enabled it again after cleaning and rebuilding the project and worked just fine...).
构建->清洁项目
构建->重建项目
我不确定是否需要重建,我完成了两个步骤,都工作正常,也许只是清理项目就足够了.
I am not sure if rebuilding would be necessary, I did both steps and it worked fine, maybe just cleaning the project would have been sufficient.
希望有帮助!
编辑
很好,还有一件事.当我解决了此处描述的问题时,我发现了另一个问题,当我单击运行时,未创建apk,而是在另一个线程上用我的答案解决了该问题:
Nice, one more thing. When I solved the problem depicted here I found another problem, when I clicked run the apk was not being created and I solved it with my answer on that other thread:
这篇关于Android Studio 3.1-插件Android支持中的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!