Просто чтобы вы знали, в App.tsx я использую процессор кадров следующим образом:
Код: Выделить всё
//[...]
const frameProcessor = useFrameProcessor((frame: any) => {
'worklet';
const poseObject = objectDetect(frame);
//[...]
Код: Выделить всё
return (
//[...]
Все сделал как описано в направлениях React-Native-Vision-Camera и -Worklets-core и сборка всегда успешен, но приложение выдает следующий код ошибки в эмуляторе:
Код: Выделить всё
Uncaught Error
Frame Processors are not available, react-native-worklets-core is not installed! Error: TurboModuleRegistry.getEnforcing(...): 'Worklets' could not be found. Verify that a module by this name is registered in the native binary.
Bridgeless mode: false. TurboModule interop: false. Modules loaded:
{"NativeModules":["PlatformConstants","LogBox","Timing","AppState","SourceCode","BlobModule","WebSocketModule","DevSettings","DevToolsSettingsManager","Networking","Appearance","DevLoadingView","HeadlessJsTaskSupport","UIManager","DeviceInfo","ImageLoader","SoundManager","IntentAndroid","DeviceEventManager","RNGestureHandlerModule","I18nManager","ReanimatedModule"],"TurboModules":[],"NotFound":["NativePerformanceCxx","NativePerformanceObserverCxx","RedBox","BugReporting","LinkingManager","Worklets"]}
Мои зависимости в package.json:
Код: Выделить всё
"dependencies": {
"metro-react-native-babel-preset": "^0.77.0",
"react": "18.2.0",
"react-native": "0.73.6",
"react-native-gesture-handler": "^2.14.0",
"react-native-reanimated": "^3.6.2",
"react-native-svg": "^15.3.0",
"react-native-vision-camera": "^4.0.5",
"react-native-worklets-core": "^1.3.3"
},
Код: Выделить всё
dependencies {
implementation("com.facebook.react:react-android")
implementation("com.facebook.react:react-native:+")
implementation("com.facebook.soloader:soloader:0.10.3")
implementation 'com.google.mlkit:pose-detection:18.0.0-beta4'
implementation 'com.google.mlkit:pose-detection-accurate:18.0.0-beta4'
implementation 'com.google.mlkit:vision-common:17.0.0'
implementation 'com.google.mlkit:vision-interfaces:16.0.0'
implementation 'com.google.mlkit:camera:16.0.0-beta3'
implementation 'androidx.annotation:annotation:1.3.0'
implementation 'com.google.android.gms:play-services-tasks:18.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation project(':react-native-gesture-handler')
implementation project(':react-native-vision-camera')
implementation project(':react-native-svg')
implementation project(':react-native-worklets-core')
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
}
Код: Выделить всё
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-transform-private-methods',
'@babel/plugin-transform-flow-strip-types',
'@babel/plugin-transform-runtime',
'@babel/plugin-transform-arrow-functions',
['react-native-worklets-core/plugin'],
['react-native-reanimated/plugin', { globals: ['__poseDetection'] }],
],
};
- Я уже удалил node_modules и снова установил зависимости несколько раз, но все равно та же ошибка
- Я проверил другие версии Vision-Camera и Worklets-Core, но ничего кроме V4 для Vision-Camera и V1 для Worklets -core приводит к проблемам совместимости с другими зависимостями. Для всего остального: та же ошибка.
- Я пробовал вручную связать Worklets-Core с Vision-Camera, но для версии 1.x.x связывание отключено. потому что, по словам разработчиков, он делает это автоматически.
- Я попробовал использовать worklets-core в качестве одноранговой зависимости вместо стандартной зависимости. На самом деле это приводит к тому, что gradle не может создать приложение
Я получаю сообщение об ошибке:
Код: Выделить всё
> Could not resolve all task dependencies for configuration ':classpath'.
> Could not find com.facebook.react:react-native-gradle-plugin:.
Required by:
project :
- Я включил worklets-core в settings.gradle:
Код: Выделить всё
include ':react-native-worklets-core'
project(':react-native-worklets-core').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-worklets-core/android')
- Я проверил GitHub на предмет той же проблемы, но ни одна из проблем не была точно такой же . Стратегии их устранения я только что перечислил здесь
Подробнее здесь: https://stackoverflow.com/questions/786 ... stalled-it