A
A
Andrey Sklyarov2016-07-15 13:11:58
Android
Andrey Sklyarov, 2016-07-15 13:11:58

LibGDX. The html project does not compile. What does such an error mean?

Just started to deal with LibGDX. Generated projects for Android, Desktop and Html. Compiled, launched - everything works on all platforms. Then I added some of my own code (camera and test back). And the html project stopped building! Lots and lots of errors like this:

not emitting code for accessing field SIZE in class 'java.lang.Integer.class, either in java.* or GWT related class
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java
va :209)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 68 more

My code if needed:
// create()
batch = new SpriteBatch();
sprite = new Sprite(new Texture(Gdx.files.internal("test_background.jpg")));
sprite.setPosition(0, 0);
sprite.setSize(WORLD_WIDTH, WORLD_HEIGHT);
mCamera = new OrthographicCamera();
mViewport = new FillViewport(WORLD_WIDTH, WORLD_HEIGHT, mCamera);

// render(float delta)
mCamera.update();
Gdx.gl.glClearColor(1, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.setProjectionMatrix(mCamera.combined);
batch.begin();
sprite.draw(batch);
batch.end();

// resize(int width, int height)
mViewport.update(width, height, true);

Everything I googled, a similar error occurred due to an incorrectly specified asset directory. But I'm OK with this, like:
<set-configuration-property name="gdx.assetpath" value="../android/assets" />

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Sklyarov, 2016-07-16
@coder1cv8

I must be reading the logs wrong! Looks like the original problem is this:

java.lang.StringIndexOutOfBoundsException
com.badlogic.gdx.graphics.g3d.particles.ResourceData.AssetData

But it's still not clear why this exception is happening ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question