ios - Cocoapod "error: could not build module 'UIKit'" -


i'm trying fit mupdf podspec. that's not going want though...

error: not build module 'uikit' 

this error every time try pod lib lint. in 2 flavours though, depending on exact contents of podspec. before that, context!

tl;dr: brain can't process mupdf , static library dependencies make nice podspec out of it. can help?


file layout

so library mupdf (http://mupdf.com); cloned git repository. comes bunch of .m files, main library written in c , has several dependencies. end few static libraries (.a files). file layout looks this:

mupdf/   # objc files   platform/ios/common.{h,m}   platform/ios/classes/*.{h,m}    # headers , static libraries   include/**/*.h   platform/ios/thirdparty/*.a 

the include folder contains headers required libraries in platform/ios/thirdparty. these headers included platform/ios/common.h.

podspec

and podspec looks this:

pod::spec.new |s|   # <enter usual podspec yada yada here>    s.source_files  = "platform/ios/classes/**/*.{h,m}", "platform/ios/common.{h,m}", "include/**/*.h"   s.public_header_files = "platform/ios/classes/**/*.h"   s.header_mappings_dir = "include"    s.libraries = "z"   s.vendored_libraries = "platform/ios/thirdparty/*" end 

based on (and variation of podspec), 2 different errors.

symbol redefinition error

with exact podspec configuration, following errors:

- error |  /<path>/mupdf/include/mupdf/fitz/math.h:97:8:            error: redefinition of 'fz_point_s' - note  |  /<path>/mupdf/include/mupdf/fitz/math.h:97:8:            note: previous definition here - error |  /<path>/mupdf/include/mupdf/fitz/math.h:121:8:             error: redefinition of 'fz_rect_s' - note  |  /<path>/mupdf/include/mupdf/fitz/math.h:121:8:            note: previous definition here  # etc. etc.  - note  |  target support files/pods-mupdf/pods-mupdf-prefix.pch:2:9:            fatal error: not build module 'uikit' 

circular dependency error

if comment out s.public_header_files line, end circular dependency error. weird!

- note  |  /privatetarget support files/pods-mupdf/pods-mupdf-umbrella.h:1:9:            fatal error: cyclic dependency in module 'uikit':            uikit -> foundation -> corefoundation -> mupdf -> uikit 

conclusion

my brain hurts, please help!

i not sure going on podspec, sorry. how resolved math.h header file conflict - annoyingly tricky right in pod spec.

i have created cocoapod mupdf, , created example application based on pod, , seems work fine.

for reference here pod spec (note out of date; please refer published mupdf pod spec 1 compatible latest version of mupdf , latest cocoapods):

# podspec mupdf # # copyright (c) 2015 joseph heenan <joseph@heenan.me.uk>  pod::spec.new |s|   s.name             = "mupdf"   s.version          = "1.7"   s.summary          = "a lightweight pdf , xps viewer."   s.description      = <<-desc                        mupdf small, fast, , yet complete pdf viewer.                         supports pdf 1.7 transparency, encryption,                         hyperlinks, annotations, searching , more.                        reads xps , openxps documents.                        desc   s.homepage         = "http://www.mupdf.com/"   s.license          = { :type => "affero gnu gpl v3", :file => 'copying' }   s.author           = "artifex software inc"   s.source           = { :git => "https://github.com/artifexsoftware/mupdf.git", :tag => s.version.to_s }    s.platform     = :ios, '6.1'   s.requires_arc = false    s.source_files = 'platform/ios/classes/**/*.[mh]', 'platform/ios/common.[mh]'   s.resources = 'platform/ios/*.png', 'platform/android/res/drawable-ldpi/*.png'    s.public_header_files = "platform/ios/classes/**/*.h", "platform/ios/common.h"    # see https://github.com/cocoapods/cocoapods/issues/1437   s.preserve_paths = "include/*", "include/**/*"    s.prepare_command = <<-cmd       # tried --depth 1 here failed git error "fatal: reference not tree:"       git submodule update --init       cd platform/ios        # build various .a files       # release armv7 + arm64       xcodebuild -scheme mupdf -configuration release code_sign_identity="" code_signing_required=no       # release i386 + x86_64       xcodebuild -scheme mupdf -configuration release -sdk iphonesimulator only_active_arch=no code_sign_identity="" code_signing_required=no        # combine fat libraries       cd ../../build/       in curl freetype jbig2dec jpeg mujs mupdf openjpeg z;           lib=lib${i}.a           lipo -create -output $lib release-ios-i386-x86_64/$lib release-ios-armv7-arm64/$lib       done cmd    s.vendored_libraries = "build/*.a"    s.xcconfig = {     # have math.h conflicts system math.h unless     # disable header maps     'use_headermap' => 'no',     'header_search_paths' => '"$(pods_root)/target support files/pods"',      'user_header_search_paths' => '"${pods_root}/mupdf/include"',      'always_search_user_paths' => 'no'   }  end 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -