google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://mediapipe.dev
Apache License 2.0
25.94k stars 5.02k forks source link

Build error when adding mediapipe via cocoapods to the framework project (iOS) #5403

Open kers97 opened 1 month ago

kers97 commented 1 month ago

OS Platform and Distribution

macOs Sonoma 14.4.1, iOS 17.2, M1 MacBook Pro

Compiler version

No response

Programming Language and version

swift 5.9

Installed using virtualenv? pip? Conda?(if python)

No response

MediaPipe version

0.10.14

Bazel version

No response

XCode and Tulsi versions (if iOS)

XCode 15.3

Android SDK and NDK versions (if android)

No response

Android AAR (if android)

None

OpenCV version (if running on desktop)

No response

Describe the problem

Adding mediapipe as a dependency to a framework project

Complete Logs

Steps:
- Fresh "Framework" type project created via Xcode 15.3
- pod init
- pod install
- build with anything, arm64 device or any simulator; result is same
- 72 issues (undefined symbols)

You can re-create this error with this easy steps.
Extra info: There is no error when adding to an "App" type project.

My pod file:
# Uncomment the next line to define a global platform for your project
platform :ios, '16.0'
target 'DigitalKYC' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!
  pod 'MediaPipeTasksVision', '0.10.14'
  # Pods for DigitalKYC
end

Error logs: (I couldn't add them all because it exceeded the number of characters.)

Showing All Issues
Undefined symbol: _MTLCreateSystemDefaultDevice

Undefined symbol: _OBJC_CLASS_$_EAGLContext

Undefined symbol: _OBJC_CLASS_$_MTLCompileOptions

Undefined symbol: _OBJC_CLASS_$_MTLComputePipelineDescriptor

Undefined symbol: _OBJC_CLASS_$_MTLRenderPassDescriptor

Undefined symbol: _OBJC_CLASS_$_MTLRenderPipelineDescriptor

Undefined symbol: _OBJC_CLASS_$_MTLTextureDescriptor

Undefined symbol: _OBJC_CLASS_$_UIImage

Undefined symbol: _glActiveTexture

Undefined symbol: _glAttachShader

Undefined symbol: _glBindAttribLocation

Undefined symbol: _glBindBuffer

Undefined symbol: _glBindFramebuffer

Undefined symbol: _glBindTexture

Undefined symbol: _glBindVertexArray

Undefined symbol: _glBufferData

Undefined symbol: _glClear

Undefined symbol: _glClearColor

Undefined symbol: _glClientWaitSync

Undefined symbol: _glCompileShader

Undefined symbol: _glCopyTexSubImage2D

Undefined symbol: _glCreateProgram

Undefined symbol: _glCreateShader

Undefined symbol: _glDeleteBuffers

Undefined symbol: _glDeleteFramebuffers

Undefined symbol: _glDeleteProgram

Undefined symbol: _glDeleteShader

Undefined symbol: _glDeleteSync

Undefined symbol: _glDeleteTextures

Undefined symbol: _glDeleteVertexArrays

Undefined symbol: _glDetachShader

Undefined symbol: _glDisable

Undefined symbol: _glDisableVertexAttribArray

Undefined symbol: _glDrawArrays

Undefined symbol: _glEnableVertexAttribArray

Undefined symbol: _glFenceSync

Undefined symbol: _glFinish

Undefined symbol: _glFlush

Undefined symbol: _glFramebufferTexture2D

Undefined symbol: _glGenBuffers

Undefined symbol: _glGenFramebuffers

Undefined symbol: _glGenTextures

Undefined symbol: _glGenVertexArrays

Undefined symbol: _glGetError

Undefined symbol: _glGetIntegerv

Undefined symbol: _glGetProgramiv

Undefined symbol: _glGetShaderInfoLog

Undefined symbol: _glGetShaderiv

Undefined symbol: _glGetString

Undefined symbol: _glGetStringi

Undefined symbol: _glGetUniformLocation

Undefined symbol: _glLinkProgram

Undefined symbol: _glPixelStorei

Undefined symbol: _glReadPixels

Undefined symbol: _glShaderSource

Undefined symbol: _glTexImage2D

Undefined symbol: _glTexParameterf

Undefined symbol: _glTexParameteri

Undefined symbol: _glTexStorage2D

Undefined symbol: _glTexSubImage2D

Undefined symbol: _glUniform1f

Undefined symbol: _glUniform1i

Undefined symbol: _glUniform2f

Undefined symbol: _glUniform3f

Undefined symbol: _glUniform4fv

Undefined symbol: _glUniformMatrix4fv

Undefined symbol: _glUseProgram

Undefined symbol: _glValidateProgram

Undefined symbol: _glVertexAttribPointer

Undefined symbol: _glViewport

Undefined symbol: _glWaitSync

Linker command failed with exit code 1 (use -v to see invocation)
kuaashish commented 4 weeks ago

Hi @kers97,

We need few more details, Could you please provide the complete details from the documentation that you are following to help us reproduce and understand the issue better?

Thank you!!

kers97 commented 4 weeks ago

Hi @kers97,

We need few more details, Could you please provide the complete details from the documentation that you are following to help us reproduce and understand the issue better?

Thank you!!

Hi @kuaashish , actually I wrote all the steps in the beginning but let me try to write it more clear. 1- Open Xcode, File -> New -> Project 2- In the opened tab Select "Framework" for the type of the project and create an empty framework project. 3- Pod init to the project and add 'MediaPipeTasksVision', '0.10.14' to the pod file and pod install. ( I also provide the pod file in the Complete Logs part above) 4- And just build for the any simulator or any iOS Device (arm64) and it fails.

You can re-create it in 2 minutes.

schmidt-sebastian commented 4 weeks ago

Can you try to manually add MediaPipeTasksCore as a dependency?

kers97 commented 4 weeks ago

Can you try to manually add MediaPipeTasksCore as a dependency?

hi @schmidt-sebastian There is no dependency named MediaPipeTasksCore in Cocoapods or in downloaded dependencies. MediaPipeTasksVision has dependency named MediaPipeTasksCommon. Could you please explain more ?

schmidt-sebastian commented 4 weeks ago

Sorry - I indeed meant MediaPipeTasksCommon.

kers97 commented 4 weeks ago

Sorry - I indeed meant MediaPipeTasksCommon.

@schmidt-sebastian I tried it nothing change ..

kers97 commented 2 weeks ago

Any fixes / recommendations for this issue ? , I couldn't find anything.

kers97 commented 1 day ago

@schmidt-sebastian Any fixes for this issue ?