Android Studio 2.2.3 Libgdx Gradle项目刷新失败

时间:2017-02-19 22:24:03

标签: android android-studio gradle nullpointerexception libgdx

自从我将Android Studio更新为2.2.3后,我甚至无法创建新的空项目而不会出现相同的Gradle构建错误。 我之前尝试过这里提到的所有解决方案。

  1. 我检查并重新写了我的JAVA_HOME路径
  2. 删除.gradle文件,删除.idea文件,删除与gradle相关的所有内容
  3. 我删除了所有内容,并从两次开始重新构建了Android Studio
  4. 我重新组织了build.gradle文件和依赖项等。 最后我找到了一个声称与Android Studio和Libgdx的最新版本一起工作的代码,但我又遇到了同样的错误。
  5. 这是gradle同步消息;

      

    错误:原因: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)   在   com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:361)   在   com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:341)   在   com.intellij.openapi.util.io.FileUtilRt.createTempFile(FileUtilRt.java:334)   在   com.intellij.openapi.util.io.FileUtil.createTempFile(FileUtil.java:1479)   在   com.android.tools.idea.gradle.util.GradleUtil.addInitScriptCommandLineOption(GradleUtil.java:1064)   在   com.android.tools.idea.gradle.util.GradleUtil.addLocalMavenRepoInitScriptCommandLineOption(GradleUtil.java:1057)   在   com.android.tools.idea.gradle.util.GradleUtil.addLocalMavenRepoInitScriptCommandLineOption(GradleUtil.java:1023)   在   com.android.tools.idea.gradle.project.AndroidGradleProjectResolver.getExtraCommandLineArgs(AndroidGradleProjectResolver.java:345)   在   org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.doResolveProjectInfo(GradleProjectResolver.java:175)   在   org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.access $ 300(GradleProjectResolver.java:73)   在   org.jetbrains.plugins.gradle.service.project.GradleProjectResolver $ ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:768)   在   org.jetbrains.plugins.gradle.service.project.GradleProjectResolver $ ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:752)   在   org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:238)   在   org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:112)   在   org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:73)   在   com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl $ 1.produce(RemoteExternalSystemProjectResolverImpl.java:41)   在   com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl $ 1.produce(RemoteExternalSystemProjectResolverImpl.java:37)   在   com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)   在   com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)   在   com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)   在   com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:51)   在   com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:138)   在   com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:124)   在   com.intellij.openapi.externalSystem.util.ExternalSystemUtil $ 3.execute(ExternalSystemUtil.java:419)   在   com.intellij.openapi.externalSystem.util.ExternalSystemUtil $ 4 $ 2.run(ExternalSystemUtil.java:500)   在   com.intellij.openapi.progress.impl.CoreProgressManager $ TaskRunnable.run(CoreProgressManager.java:563)   在   com.intellij.openapi.progress.impl.CoreProgressManager $ 2.run(CoreProgressManager.java:142)   在   com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)   在   com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)   在   com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)   在   com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)   在   com.intellij.openapi.progress.impl.ProgressManagerImpl $ 1.run(ProgressManagerImpl.java:126)   在   com.intellij.openapi.application.impl.ApplicationImpl $ 8.run(ApplicationImpl.java:369)   在   java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)   在java.util.concurrent.FutureTask.run(FutureTask.java:266)at   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)   在   java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:617)   在java.lang.Thread.run(Thread.java:745)

    这是我的build.gradle文件;

    buildscript {
    repositories {
        jcenter()
        // maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.1'
        classpath 'me.tatarka:gradle-retrolambda:3.3.0-beta4'
        classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
        classpath 'de.aaschmid:gradle-cpd-plugin:1.0'
        // classpath 'io.fabric.tools:gradle:1.22.0'
        // classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
    
    configurations.classpath.exclude group: 'com.android.tools.external.lombok'} allprojects {
    buildscript {
        ext {
            gdxVersion = '1.9.4'
            box2DLightsVersion = '1.4'
            ashleyVersion = '1.7.2'
            aiVersion = '1.8.0'
            roboVMVersion = '1.14.0'
        }
    }
    repositories {
        jcenter()
        // maven { url 'https://maven.fabric.io/public' }
    }
    

    您可以从这里查看整个代码; https://github.com/Deepscorn/libgdx-gradle-template

    正如我之前说过的,我甚至无法创建一个空白的新项目而没有得到相同的错误。你能帮我吗?

    注意:   这是我的设置jar文件:http://www.filedropper.com/settings_19

    UPDATE!:我下载并安装了android studio 2.0,然后使用了Gradle版本2.10和Android插件版本2.0.0。现在我没有得到任何错误。

0 个答案:

没有答案