2016-07-27 69 views
1

在我的React Native项目的链接阶段存在问题。库libRCTMapboxGL.a正在导致此问题。Libtool:找不到以下文件:-lPods-RCTMapboxGL

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lPods-RCTMapboxGL

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lPods-RCTMapboxGL is not an object file (not allowed in a library)

文件libRCTMapboxGL.a未在/Users/user/Developer/RNProject/ios/build/Build/Products/Debug-iphonesimulator/创建与-lPods-RCTMapboxGL错误的后果。然而,文件似乎存在:

/Users/user/Developer/RNProject/node_modules/react-native-mapbox-gl/ios/Pods/Target Support Files/Pods-RCTMapboxGL/Pods-RCTMapboxGL.debug.xcconfig

/Users/user/Developer/RNProject/node_modules/react-native-mapbox-gl/ios/Pods/Target Support Files/Pods-RCTMapboxGL/Pods-RCTMapboxGL.release.xcconfig

豆荚,RCTMapboxGL不是一个对象文件看起来错误消息奇怪,这些文件的内容是:

GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" 
OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" 
OTHER_LDFLAGS = $(inherited) -ObjC 
PODS_BUILD_DIR = $BUILD_DIR 
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 
PODS_ROOT = ${SRCROOT}/Pods 

的设置已完成根据这个tutorial。首先使用CocoaPods,然后手动验证是否所有的设置和文件都已就位。

完整的错误日志:

Libtool /Users/user/Developer/RNProject/ios/build/Build/Products/Debug-iphonesimulator/libRCTMapboxGL.a normal x86_64 
    cd /Users/user/Developer/RNProject/node_modules/react-native-mapbox-gl/ios 
    export IPHONEOS_DEPLOYMENT_TARGET=8.0 
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" 
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk -L/Users/user/Developer/RNProject/ios/build/Build/Products/Debug-iphonesimulator -L/Users/bobby/Downloads/mapbox-gl-ios-0.2.17 -L/Users/user/Developer/RNProject/node_modules/react-native-mapbox-gl/ios/RCTMapboxGL -filelist /Users/user/Developer/RNProject/ios/build/Build/Intermediates/RCTMapboxGL.build/Debug-iphonesimulator/RCTMapboxGL.build/Objects-normal/x86_64/RCTMapboxGL.LinkFileList -lPods-RCTMapboxGL -o /Users/user/Developer/RNProject/ios/build/Build/Products/Debug-iphonesimulator/libRCTMapboxGL.a 

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lPods-RCTMapboxGL 
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lPods-RCTMapboxGL is not an object file (not allowed in a library) 
+0

你在你的项目目录里试过'pod install'吗? –

+0

是的,它安装正确...我手动检查了设置 –

回答

0

问题是,我用pod init的MapboxGL目录,该目录中创建额外的文件内。删除生成的文件解决了问题。