Closed NickDelfino closed 6 years ago
This error changes on second load to:
EXGL: Invalid pixel data argument for gl.textImage2D()!
This is all I have in my App.js.
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import Expo from 'expo';
import ExpoPhaser from 'expo-phaser';
export default class App extends React.Component {
state = { loading: true };
async componentWillMount() {
this.setState({ loading: false });
}
render() {
if (this.state.loading) {
return <Expo.AppLoading />;
}
return (
<Expo.GLView
style={{ flex: 1 }}
onContextCreate={context => startGame({ context })}
/>
);
}
}
function startGame({ context }) {
const game = ExpoPhaser.game({ context });
}
Right, I've tracked the issue down to a problem with base64 image conversion. lol apparently in Android ImageStore.addImageFromBase64
isn't available. We need an alternative to this in @expo/browser-polyfill
to proceed.
Ok, how can we apply fix ?
Native code would need to be added to the android build, there is currently no way to parse base64 on Android
Is there any ETA on this?
@axedre nothing definitive right now. I'm working on ARCore for android atm. This is phaser-ce (~2.7) which is a little outdated now. I think it might make sense to add support for the newer versions of Phaser with Android. We still need the FileSystem
updates either way. It also might make sense to support a simpler game engine like melon.js as well. If you have any input on any of this lemme know.
Nothing much really, apart from a quick SO search (which I'm sure you've already attempted) that yields https://stackoverflow.com/questions/42294821/convert-base64-string-to-image-in-android I'm no Java developer though so I wouldn't know where to start... :-/
Can a new version be published to npm? I am getting bit by this issue and the last version published was 10 months ago
How is this going? If it's still not working on Android, please add a note on README so that other people intending to use it for Android app could avoid to take time for this. Thank you!
Not working for me either, I made a new issue https://github.com/expo/expo-phaser/issues/11
Same issue on expo-pixi.
Trying to add ExpoPhaser to my Expo Android app and just making a game object causes the app to error. I am using a Galaxy S8.
undefined is not an object (evaluating window.emitter.emit
Not sure what to make of the error. Seems to build okay on the iOS simulator.
Can provide more details if needed. Thanks for library! Really like the idea!