Closed Avtrkrb closed 4 months ago
@robertjcolley I was able to resolve this. I have to make a few change to viro package, will be submitting a pull request, please review & accept it.
The issue arises because fresco was recently updated from 2.5.0 -> 3.1.3. I believe they have made some changes as there was a similar issue in expo that affected expo sdk 49 & 50.
Thanks @Avtrkrb , @bobbyjcolley this has relation with https://github.com/NativeVision/viro/issues/245
Viro app crashes when added ViroSound/ ViroVideo/ ViroSpacialSounf or anything related to audio and/or video, here is the code snippet I was testing:
import { StyleSheet } from "react-native";
import {
ViroARScene,
ViroTrackingStateConstants,
ViroARSceneNavigator,
ViroTrackingReason,
ViroSound,
} from "@viro-community/react-viro";
const HelloWorldSceneAR = () => {
const [text, setText] = useState("Initializing AR...");
// const [showBox, setShowBox] = useState(false);
function onInitialized(state: any, reason: ViroTrackingReason) {
console.log("guncelleme", state, reason);
if (state === ViroTrackingStateConstants.TRACKING_NORMAL) {
setText("Hello World!");
} else if (state === ViroTrackingStateConstants.TRACKING_UNAVAILABLE) {
// Handle loss of tracking
}
}
return (
<ViroARScene onTrackingUpdated={onInitialized}>
<ViroSound
source={{uri: "http://192.168.0.148:9800/uploads/1705791646779-aabef5ba998a0f49.mp3"}}
/>
</ViroARScene>
);
};
export default () => {
return (
<ViroARSceneNavigator
autofocus={true}
initialScene={{
scene: HelloWorldSceneAR,
}}
style={styles.f1}
/>
);
};
var styles = StyleSheet.create({
f1: { flex: 1 },
helloWorldTextStyle: {
fontFamily: "Arial",
fontSize: 30,
color: "#ffffff",
textAlignVertical: "center",
textAlign: "center",
},
});
There are no error logs
Viro app crashes when added ViroSound/ ViroVideo/ ViroSpacialSounf or anything related to audio and/or video, here is the code snippet I was testing:
import { StyleSheet } from "react-native"; import { ViroARScene, ViroTrackingStateConstants, ViroARSceneNavigator, ViroTrackingReason, ViroSound, } from "@viro-community/react-viro"; const HelloWorldSceneAR = () => { const [text, setText] = useState("Initializing AR..."); // const [showBox, setShowBox] = useState(false); function onInitialized(state: any, reason: ViroTrackingReason) { console.log("guncelleme", state, reason); if (state === ViroTrackingStateConstants.TRACKING_NORMAL) { setText("Hello World!"); } else if (state === ViroTrackingStateConstants.TRACKING_UNAVAILABLE) { // Handle loss of tracking } } return ( <ViroARScene onTrackingUpdated={onInitialized}> <ViroSound source={{uri: "http://192.168.0.148:9800/uploads/1705791646779-aabef5ba998a0f49.mp3"}} /> </ViroARScene> ); }; export default () => { return ( <ViroARSceneNavigator autofocus={true} initialScene={{ scene: HelloWorldSceneAR, }} style={styles.f1} /> ); }; var styles = StyleSheet.create({ f1: { flex: 1 }, helloWorldTextStyle: { fontFamily: "Arial", fontSize: 30, color: "#ffffff", textAlignVertical: "center", textAlign: "center", }, });
There are no error logs
@ThuggerHacks will try this & fix it in my linked pr if I can get to the bottom of the error. Thanks for this.
Viro app crashes when added ViroSound/ ViroVideo/ ViroSpacialSounf or anything related to audio and/or video, here is the code snippet I was testing:
import { StyleSheet } from "react-native"; import { ViroARScene, ViroTrackingStateConstants, ViroARSceneNavigator, ViroTrackingReason, ViroSound, } from "@viro-community/react-viro"; const HelloWorldSceneAR = () => { const [text, setText] = useState("Initializing AR..."); // const [showBox, setShowBox] = useState(false); function onInitialized(state: any, reason: ViroTrackingReason) { console.log("guncelleme", state, reason); if (state === ViroTrackingStateConstants.TRACKING_NORMAL) { setText("Hello World!"); } else if (state === ViroTrackingStateConstants.TRACKING_UNAVAILABLE) { // Handle loss of tracking } } return ( <ViroARScene onTrackingUpdated={onInitialized}> <ViroSound source={{uri: "http://192.168.0.148:9800/uploads/1705791646779-aabef5ba998a0f49.mp3"}} /> </ViroARScene> ); }; export default () => { return ( <ViroARSceneNavigator autofocus={true} initialScene={{ scene: HelloWorldSceneAR, }} style={styles.f1} /> ); }; var styles = StyleSheet.create({ f1: { flex: 1 }, helloWorldTextStyle: { fontFamily: "Arial", fontSize: 30, color: "#ffffff", textAlignVertical: "center", textAlign: "center", }, });
There are no error logs
@ThuggerHacks will try this & fix it in my linked pr if I can get to the bottom of the error. Thanks for this.
Right, anything just update us
i have the same issue, using expo
"dependencies": { "@viro-community/react-viro": "^2.23.1", "expo": "~50.0.4", "expo-dev-client": "~3.3.8", "expo-status-bar": "~1.11.1", "react": "18.2.0", "react-native": "0.73.2", "expo-asset": "~9.0.2", "metro-config": "~0.80.4"
}
when i tried this
ARTrackingTargetsModule.createTargets
Your app just crashed. See the error below. java.lang.IncompatibleClassChangeError: Found interface com.facebook.imagepipeline.image.CloseableBitmap, but class was expected (declaration of 'com.facebook.imagepipeline.image.CloseableBitmap'
looks like a problem with old version of Fresco
i have the same issue, using expo
"dependencies": { "@viro-community/react-viro": "^2.23.1", "expo": "~50.0.4", "expo-dev-client": "~3.3.8", "expo-status-bar": "~1.11.1", "react": "18.2.0", "react-native": "0.73.2", "expo-asset": "~9.0.2", "metro-config": "~0.80.4"
}
when i tried this
ARTrackingTargetsModule.createTargets
Your app just crashed. See the error below. java.lang.IncompatibleClassChangeError: Found interface com.facebook.imagepipeline.image.CloseableBitmap, but class was expected (declaration of 'com.facebook.imagepipeline.image.CloseableBitmap'
looks like a problem with old version of Fresco
I have an open pr that resolves this. Waiting on the maintainers to review & approve.
@robertjcolley @cjmcassar
Description
App crashes with the following error when a ViroARScene is initialized with ViroImage. The function is being called properly as console prints debug statements & props being passed to the scene. App is built with expo & running in a custom dev client.
This is behaviour is observed irrespective of loading a local image or an image from a url.
Reproducible Demo
Fresh expo-create-app with just ViroARScene, ViroImage & ViroARSceneNavigator. ViroARSceneNavigator is successfully able to call the ARScene function as both print debug & tracking initialization console logs. When ViroARScene is being rendered, the app crashes. The remote image URL is valid since the image opens in browser.
Code:
Requirements:
Please go through this checklist before opening a new issue
Environment
@robertjcolley