我刚刚使用libgdx设置创建了我的项目并将其导入android studio但是当我添加桌面运行/调试配置并尝试运行项目时,我收到以下错误:
Information:Gradle: Executing tasks: [:core:assemble, :desktop:assemble]
Information:8/4/2016 10:53 PM - Compilation completed with 2 errors and 1 warning in 3s 871ms
Error:Gradle: Execution failed for task ':core:compileJava'.
> Compilation failed; see the compiler error output for details.
Warning:Gradle: [options] bootstrap class path not set in conjunction with -source 1.6
D:\android projects\project\core\src\com\roaingstudios\project\project.java
Error:(8, 18) Gradle: error: '{' expected
我没有对导入android studio的文件做任何事情。这些文件是libgdx生成的文件
package com.roaingstudios.project;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
public class project extends ApplicationAdapter {
SpriteBatch batch;
Texture img;
@Override
public void create () {
batch = new SpriteBatch();
img = new Texture("badlogic.jpg");
}
@Override
public void render () {
Gdx.gl.glClearColor(1, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
batch.draw(img, 0, 0);
batch.end();
}
@Override
public void dispose () {
batch.dispose();
img.dispose();
}
}
导致错误的原因是什么,我该如何解决?
指向build.gradle文件的链接:https://puu.sh/qr2Uf/448c47ff9c.txt