Gradle sync失败:原因:java.lang.NullPointerException

时间:2016-11-03 12:05:43

标签: java android android-studio

我更新了android studio.After,当我尝试创建新项目时,我收到一个错误。我在下面列出了错误。 这是android studio的Message选项卡。

Error:Cause: java.lang.NullPointerException
    at java.util.Objects.requireNonNull(Objects.java:203)
    at java.util.Arrays$ArrayList.<init>(Arrays.java:3813)
    at java.util.Arrays.asList(Arrays.java:3800)
    at com.intellij.openapi.util.io.FileUtilRt.doCreateTempFile(FileUtilRt.java:399)
    at com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:361)
    at com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:341)
    at com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:334)
    at com.intellij.openapi.util.io.FileUtil.createTempFile(FileUtil.java:1479)
    at com.android.tools.idea.gradle.util.GradleUtil.addInitScriptCommandLineOption(GradleUtil.java:1064)
    at com.android.tools.idea.gradle.util.GradleUtil.addLocalMavenRepoInitScriptCommandLineOption(GradleUtil.java:1057)
    at com.android.tools.idea.gradle.util.GradleUtil.addLocalMavenRepoInitScriptCommandLineOption(GradleUtil.java:1023)
    at com.android.tools.idea.gradle.project.AndroidGradleProjectResolver.getExtraCommandLineArgs(AndroidGradleProjectResolver.java:345)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.doResolveProjectInfo(GradleProjectResolver.java:175)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.access$300(GradleProjectResolver.java:73)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:768)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:752)
    at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:238)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:112)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:73)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
    at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:51)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:138)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:124)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:419)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4$2.run(ExternalSystemUtil.java:500)
    at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563)
    at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:126)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:369)
    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的事件日志选项卡。它显示出这样的错误。

11:37:07 AM Gradle sync started
11:37:07 AM Gradle sync failed: Cause: java.lang.NullPointerException
    at java.util.Objects.requireNonNull(Objects.java:203)
    at java.util.Arrays$ArrayList.(Arrays.java:3813)
    at java.util.Arrays.asList(Arrays.java:3800)
    at com.intellij.openapi.util.io.FileUtilRt.doCreateTempFile(FileUtilRt.java:399)
    at com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:361)
    at com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:341)
    at com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:334)
    at com.intellij.openapi.util.io.FileUtil.createTempFile(FileUtil.java:1479)
    at com.android.tools.idea.gradle.util.GradleUtil.addInitScriptCommandLineOption(GradleUtil.java:1064)
    at com.android.tools.idea.gradle.util.GradleUtil.addLocalMavenRepoInitScriptCommandLineOption(GradleUtil.java:1057)
    at com.android.tools.idea.gradle.util.GradleUtil.addLocalMavenRepoInitScriptCommandLineOption(GradleUtil.java:1023)
    at com.android.tools.idea.gradle.pro... (show balloon)
11:37:08 AM Gradle sync started
11:37:08 AM Gradle sync failed: Cause: java.lang.NullPointerException
    at java.util.Objects.requireNonNull(Objects.java:203)
    at java.util.Arrays$ArrayList.(Arrays.java:3813)
    at java.util.Arrays.asList(Arrays.java:3800)
    at com.intellij.openapi.util.io.FileUtilRt.doCreateTempFile(FileUtilRt.java:399)
    at com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:361)
    at com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:341)
    at com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:334)
    at com.intellij.openapi.util.io.FileUtil.createTempFile(FileUtil.java:1479)
    at com.android.tools.idea.gradle.util.GradleUtil.addInitScriptCommandLineOption(GradleUtil.java:1064)
    at com.android.tools.idea.gradle.util.GradleUtil.addLocalMavenRepoInitScriptCommandLineOption(GradleUtil.java:1057)
    at com.android.tools.idea.gradle.util.GradleUtil.addLocalMavenRepoInitScriptCommandLineOption(GradleUtil.java:1023)
    at com.android.tools.idea.gradle.pro... (show balloon)
11:39:02 AM Gradle sync started
11:39:02 AM Gradle sync failed: Cause: java.lang.NullPointerException
    at java.util.Objects.requireNonNull(Objects.java:203)
    at java.util.Arrays$ArrayList.(Arrays.java:3813)
    at java.util.Arrays.asList(Arrays.java:3800)
    at com.intellij.openapi.util.io.FileUtilRt.doCreateTempFile(FileUtilRt.java:399)
    at com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:361)
    at com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:341)
    at com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:334)
    at com.intellij.openapi.util.io.FileUtil.createTempFile(FileUtil.java:1479)
    at com.android.tools.idea.gradle.util.GradleUtil.addInitScriptCommandLineOption(GradleUtil.java:1064)
    at com.android.tools.idea.gradle.util.GradleUtil.addLocalMavenRepoInitScriptCommandLineOption(GradleUtil.java:1057)
    at com.android.tools.idea.gradle.util.GradleUtil.addLocalMavenRepoInitScriptCommandLineOption(GradleUtil.java:1023)
    at com.android.tools.idea.gradle.pro... (show balloon)
11:39:22 AM Gradle sync started
11:39:22 AM Gradle sync failed: Cause: java.lang.NullPointerException
    at java.util.Objects.requireNonNull(Objects.java:203)
    at java.util.Arrays$ArrayList.(Arrays.java:3813)
    at java.util.Arrays.asList(Arrays.java:3800)
    at com.intellij.openapi.util.io.FileUtilRt.doCreateTempFile(FileUtilRt.java:399)
    at com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:361)
    at com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:341)
    at com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:334)
    at com.intellij.openapi.util.io.FileUtil.createTempFile(FileUtil.java:1479)
    at com.android.tools.idea.gradle.util.GradleUtil.addInitScriptCommandLineOption(GradleUtil.java:1064)
    at com.android.tools.idea.gradle.util.GradleUtil.addLocalMavenRepoInitScriptCommandLineOption(GradleUtil.java:1057)
    at com.android.tools.idea.gradle.util.GradleUtil.addLocalMavenRepoInitScriptCommandLineOption(GradleUtil.java:1023)
    at com.android.tools.idea.gradle.pro... (show balloon)

0 个答案:

没有答案