Error:(232) Error: This class should be public (cc.openframeworks.OFGLSurfaceView) [Instantiatable]

I am attempting to compile a release version of my Android app and come across this error:

 Error:(232) Error: This class should be public (cc.openframeworks.OFGLSurfaceView) [Instantiatable]

Which points to this constructor:

 public OFGLSurfaceView(Context context,AttributeSet attributes) {
    mRenderer = new OFAndroidWindow(getWidth(),getHeight());
    getHolder().setFormat( PixelFormat.OPAQUE );
    OFEGLConfigChooser configChooser = new OFEGLConfigChooser(8,8,8,0,16,0);

Any ideas?

1 Like

Iā€™m having the same problem. Did you fix this?
For me, it is only problematic when building in release.

I fixed it by adding the following code into build.gradle in OF project.

lintOptions {
    abortOnError false
    disable "Instantiatable"

Add the code inside android{}, then it should work.