Android crashing - compilation error
farazirfan47 opened this issue · 5 comments
farazirfan47 commented
BUG
library version
├── gl-react@4.0.1
└── gl-react-expo@4.0.1
Expected behavior
Should see blue shaded view in android
Actual behavior
Always crashing and getting this error:
gl-shader: Error compiling shader:
Compile failed.
ERROR: 0:1: '' : Invalid directive 5
1 compilation errors. No code generated.
Steps to reproduce the behavior
Anytime I run code I got compilation error, see sample code below
import React from "react";
import { Shaders, Node, GLSL } from "gl-react";
import { Surface } from "gl-react-expo"; // for React Native via Expo GLView
const shaders = Shaders.create({
helloBlue: {
frag: GLSL`
precision highp float;
varying vec2 uv;
uniform float blue;
void main() {
gl_FragColor = vec4(uv.x, uv.y, blue, 1.0);
}`
}
});
class HelloBlue extends React.Component {
render() {
const { blue } = this.props;
return <Node shader={shaders.helloBlue} uniforms={{ blue }} />;
}
}
export default class GLTest extends React.Component{
render(){
return(
<Surface style={{width: 300, height: 500}}>
<HelloBlue blue={0.5} />
</Surface>
)
}
}
gre commented
what is the error?
farazirfan47 commented
@gre just updated bug info
farazirfan47 commented
@gre here is full screenshot
MuZeQiu commented
error: Error: Unable to resolve module buffer
from node_modules/typedarray-pool/pool.js
: buffer could not be found within the project.
gre commented
I'm not exactly sure but you could try to remove the "precision highp float;" @farazirfan47