small medium large xlarge

20 May 2014, 05:19
A Duval (2 posts)

First thank you for this interesting and complete book.

I actually having some problem with the code p38.

    String vertexShaderSource = TextResourceReader
        .readTextFileFromResource(context, R.raw.**simple_vertex_shader**);

String fragmentShaderSource = TextResourceReader

        .readTextFileFromResource(context, R.raw.**simple_fragment_shader**);

The ** ** part are underline in red saying that it “cannot be resolved or is not a field”, I have go on the project until I have to test the project, but now I can’t with this problem. I have also donwload the source code but I am facing the same problem. What can I do?

Thank you for your help.

22 May 2014, 19:27
Kevin Brothaler (41 posts)

Hi Duval,

One cause of this might be if you have a “import android.R” at the top of the file; if that’s there, try removing it and re-importing the R file from the project.

This link might also help:

Please let me know if that helps out.

22 May 2014, 19:28
Kevin Brothaler (41 posts)

You could also try deleting from the project’s gen folder, and clean / rebuild the project.

17 Jun 2014, 07:07
A Duval (2 posts)

My problem came from this import:

import android.R;

in the AirHockeyRender

By removing it, my problem is solved, thank you Mr. Kevin Brothaler.

18 Jun 2014, 23:55
Kevin Brothaler (41 posts)

Those pesky android.R’s; don’t worry, it still happens to me quite often in my daily development. ;) Glad that it worked out.

You must be logged in to comment