尝试在Android Studio中运行项目时,InstantRunNotificationTask中的NullPointerException
满堂花醉三千客,一剑霜寒十四州。这篇文章主要讲述尝试在Android Studio中运行项目时,InstantRunNotificationTask中的NullPointerException相关的知识,希望能为你提供帮助。
每当我运行带有这些细节的项目时,我在android Studio中收到错误:
null
java.lang.NullPointerException
at com.android.tools.idea.run.tasks.InstantRunNotificationTask.<
init>
(InstantRunNotificationTask.java:63)
at com.android.tools.idea.fd.InstantRunBuildAnalyzer.getNotificationTask(InstantRunBuildAnalyzer.java:178)
at com.android.tools.idea.run.AndroidLaunchTasksProvider.getTasks(AndroidLaunchTasksProvider.java:120)
at com.android.tools.idea.run.LaunchTaskRunner.run(LaunchTaskRunner.java:102)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:726)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:176)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:556)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:137)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334)
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)
【尝试在Android Studio中运行项目时,InstantRunNotificationTask中的NullPointerException】我已经尝试重新安装SDK,插件并重新启动所有内容。不确定还有什么可能出错。
答案
- 去
Preferences
。 - 然后在
Build, Execution, Deployment
部分,你将有Instant Run
部分。 - 取消选中
Enable Instant Run...
复选框,然后再次尝试构建项目。
推荐阅读
- android在java.util.Objects.requireNonNull中获取空指针异常(Objects.java:203)
- 将列表添加到Cloud Firebase - Android
- getApplicationContext给出空指针异常[重复]
- Android Studio。 AddRule Null指针异常
- 设置Textview时的Android java.lang.NullPointerException [重复]
- 尝试在空对象引用[duplicate]上调用虚方法'java.io.File android.content.Context.getCacheDir()'
- android.os.Looper对空对象引用的android.content.Context.getMainLooper()
- Android事物(在Raspberry PI 3上通过USB UART接收数据时出现NullPointerException)
- Android NullPointerException(println需要一条消息)