react native - Including FFmpeg.framework Into My IOS App - Stack Overflow

I'm trying to manually integrate ffmpegkit.framework into my Expo Bare Workflow iOS app (built wit

I'm trying to manually integrate ffmpegkit.framework into my Expo Bare Workflow iOS app (built with React Native + native modules via Xcode) because the ffmpegkit will be deprecated and the binaries will be deleted.

So far

  • I've downloaded the latest LTS release of FFmpegkit from here.
  • I've created 3 files: FFmpegModule.m , FFmpegModule.swift and SoundBud-Bridging-Header.
  • Added the frameworks to my projectDir/ios manually, which shows in my XCode under projectDir/Frameworks
  • Added all the frameworks into "Frameworks, Libraries and Embedded Content" and make them "Embed and Sign"
  • As Framework Search Path in Project Settings, I've set it to "$(PROJECT_DIR)" and recursive
  • In "Build Phases" I've added all the frameworks under "Embed Frameworks",set the destination to "Frameworks" and checked "Code Sign on Copy" to all of them and unchecked "Copy Only When Installing"
  • Also under "Link Binary With Libraries" I've added all the frameworks and marked them "Required"

Here are the errors I'm getting:

  • The framework is not recognized by Swift (No such module 'ffmpegkit')
  • A build cycle error: Cycle inside SoundBud; building could produce unreliable results. Target 'SoundBud' has copy command from '.../Frameworks/ffmpegkit.framework' ...

Below you can see my swift file and the ffmpegkit module file: Swift:

import Foundation
import ffmpegkit
import React

@objc(FFmpegModule)
class FFmpegModule: NSObject, RCTBridgeModule {

static func moduleName() -> String {
return "FFmpegModule"
}

@objc
func runCommand(_ command: String, resolver resolve: @escaping RCTPromiseResolveBlock, 
rejecter reject: @escaping RCTPromiseRejectBlock) {
FFmpegKit.executeAsync(command) { session in
  let returnCode = session?.getReturnCode()
  resolve(returnCode?.getValue())
}
}

@objc
static func requiresMainQueueSetup() -> Bool {
return false
}
}

and the module:

framework module ffmpegkit {

header "AbstractSession.h"
header "ArchDetect.h"
header "AtomicLong.h"
header "Chapter.h"
header "FFmpegKit.h"
header "FFmpegKitConfig.h"
header "FFmpegSession.h"
header "FFmpegSessionCompleteCallback.h"
header "FFprobeKit.h"
header "FFprobeSession.h"
header "FFprobeSessionCompleteCallback.h"
header "Level.h"
header "Log.h"
header "LogCallback.h"
header "LogRedirectionStrategy.h"
header "MediaInformation.h"
header "MediaInformationJsonParser.h"
header "MediaInformationSession.h"
header "MediaInformationSessionCompleteCallback.h"
header "Packages.h"
header "ReturnCode.h"
header "Session.h"
header "SessionState.h"
header "Statistics.h"
header "StatisticsCallback.h"
header "StreamInformation.h"
header "ffmpegkit_exception.h"

export *
}

I can provide you with more info if you need it. I've been trying non stop for 7 days and it's driving me crazy. I would appreciate any help greatly

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744046776a4549321.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信