fix(camera): drop unused expo-camera; viewfinder crash-safe on Android

- remove expo-camera dep (autolink forced CameraX 1.6.0 over vision-camera
  4.7.3's pinned 1.5.0-alpha03, breaking device enumeration on Xiaomi)
- Android: disable Skia frame processor in viewfinder - devices w/o
  hardware-buffered ImageAnalysis frames (Xiaomi 14 Ultra) crash in
  frame.getNativeBuffer(); live filter stays on iOS, filters still apply
  at capture/export
This commit is contained in:
2026-09-07 19:20:33 +07:00
parent 674fe9d1e2
commit 515f408c67
2 changed files with 5 additions and 3 deletions
-1
View File
@@ -9,7 +9,6 @@
"babel-preset-expo": "~57.0.0",
"expo": "~57.0.7",
"expo-asset": "~57.0.5",
"expo-camera": "~57.0.2",
"expo-dev-client": "~57.0.6",
"expo-file-system": "~57.0.1",
"expo-font": "~57.0.1",
+5 -2
View File
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { View, Text, StyleSheet, Dimensions, TouchableOpacity } from 'react-native';
import { View, Text, StyleSheet, Dimensions, TouchableOpacity, Platform } from 'react-native';
import { Camera, useCameraDevice, useSkiaFrameProcessor, type CameraDevice } from 'react-native-vision-camera';
import { useSharedValue } from 'react-native-reanimated';
import {
@@ -283,7 +283,10 @@ export default function Viewfinder({
style={StyleSheet.absoluteFill}
device={device}
isActive={true}
frameProcessor={frameProcessor}
// Android: Skia frame processor crashes on devices w/o hardware-buffered
// ImageAnalysis frames (e.g. Xiaomi 14 Ultra). Keep raw preview there;
// filters still apply on capture/export. iOS keeps live filtered preview.
frameProcessor={Platform.OS === 'android' ? undefined : frameProcessor}
/>
{renderCameraOverlays()}
</View>