Дубликат символа _kCDVFilesystemURLPrefix при добавлении плагина файла cordova в существующий проект ios

У меня есть существующий проект ios, и я хочу использовать веб-представление cordova (с плагинами). Я следил за инструкциями в документах phonegap, и мой проект успешно компилируется.

Однако, когда я хочу добавить плагин к моему проекту, я получаю следующую ошибку:

Ld /Users/jibrahim/Library/Developer/Xcode/DerivedData/appworks-ios-bvhgmyzzslupqsbrfkdduticdqik/Build/Products/Debug-iphonesimulator/appworks-ios.app/appworks-ios normal i386
cd /Users/jibrahim/workspace/appworks-ios
export IPHONEOS_DEPLOYMENT_TARGET=8.3
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk -L/Users/jibrahim/Library/Developer/Xcode/DerivedData/appworks-ios-bvhgmyzzslupqsbrfkdduticdqik/Build/Products/Debug-iphonesimulator -L/Users/jibrahim/workspace/appworks-ios/Pods/GGLInstanceID/Libraries -L/Users/jibrahim/workspace/appworks-ios/Pods/Google/Libraries -L/Users/jibrahim/workspace/appworks-ios/Pods/GoogleCloudMessaging/Libraries -L/Users/jibrahim/workspace/appworks-ios/Pods/GoogleInterchangeUtilities/Libraries -L/Users/jibrahim/workspace/appworks-ios/Pods/GoogleNetworkingUtilities/Libraries -L/Users/jibrahim/workspace/appworks-ios/Pods/GoogleSymbolUtilities/Libraries -L/Users/jibrahim/workspace/appworks-ios/Pods/GoogleUtilities/Libraries -L/Users/jibrahim/Library/Developer/Xcode/DerivedData/appworks-ios-bvhgmyzzslupqsbrfkdduticdqik/Build/Products/Debug-iphoneos -F/Users/jibrahim/Library/Developer/Xcode/DerivedData/appworks-ios-bvhgmyzzslupqsbrfkdduticdqik/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/jibrahim/Library/Developer/Xcode/DerivedData/appworks-ios-bvhgmyzzslupqsbrfkdduticdqik/Build/Intermediates/appworks-ios.build/Debug-iphonesimulator/appworks-ios.build/Objects-normal/i386/appworks-ios.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lGGLCloudMessaging -lGGLCore -lGGLInstanceIDLib -lGSDK_Overload -lGTMSessionFetcher_core -lGTMSessionFetcher_full -lGTMStackTrace -lGTM_AddressBook -lGTM_DebugUtils -lGTM_GTMURLBuilder -lGTM_KVO -lGTM_NSDictionary+URLArguments -lGTM_NSScannerJSON -lGTM_NSStringHTML -lGTM_NSStringXML -lGTM_Regex -lGTM_RoundedRectPath -lGTM_StringEncoding -lGTM_SystemVersion -lGTM_UIFont+LineHeight -lGTM_core -lGTM_iPhone -lGcmLib -lPods-AFNetworking -lPods-CocoaLumberjack -lPods-ZipArchive -lProtocolBuffers -lsqlite3 -lz -framework AddressBook -framework CoreGraphics -framework MobileCoreServices -framework Security -framework SystemConfiguration -ObjC -lGGLCloudMessaging -lGGLCore -lGGLInstanceIDLib -lGSDK_Overload -lGTMSessionFetcher_core -lGTMSessionFetcher_full -lGTMStackTrace -lGTM_AddressBook -lGTM_DebugUtils -lGTM_GTMURLBuilder -lGTM_KVO -lGTM_NSDictionary+URLArguments -lGTM_NSScannerJSON -lGTM_NSStringHTML -lGTM_NSStringXML -lGTM_Regex -lGTM_RoundedRectPath -lGTM_StringEncoding -lGTM_SystemVersion -lGTM_UIFont+LineHeight -lGTM_core -lGTM_iPhone -lGcmLib -lPods-AFNetworking -lPods-CocoaLumberjack -lPods-ZipArchive -lProtocolBuffers -lsqlite3 -lz -framework AddressBook -framework CoreGraphics -framework MobileCoreServices -framework Security -framework SystemConfiguration -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=8.3 /Users/jibrahim/Library/Developer/Xcode/DerivedData/appworks-ios-bvhgmyzzslupqsbrfkdduticdqik/Build/Products/Debug-iphonesimulator/libCordova.a -framework AddressBook -framework AddressBookUI -framework AudioToolbox -framework AVFoundation -framework CoreLocation -framework CoreMedia -framework MediaPlayer -framework MobileCoreServices -framework QuartzCore -framework SystemConfiguration -framework CoreGraphics -lPods -framework AssetsLibrary -Xlinker -dependency_info -Xlinker /Users/jibrahim/Library/Developer/Xcode/DerivedData/appworks-ios-bvhgmyzzslupqsbrfkdduticdqik/Build/Intermediates/appworks-ios.build/Debug-iphonesimulator/appworks-ios.build/Objects-normal/i386/appworks-ios_dependency_info.dat -o /Users/jibrahim/Library/Developer/Xcode/DerivedData/appworks-ios-bvhgmyzzslupqsbrfkdduticdqik/Build/Products/Debug-iphonesimulator/appworks-ios.app/appworks-ios

ld: warning: directory not found for option '-L/Users/jibrahim/Library/Developer/Xcode/DerivedData/appworks-ios-bvhgmyzzslupqsbrfkdduticdqik/Build/Products/Debug-iphoneos'
duplicate symbol _kCDVFilesystemURLPrefix in:
    /Users/jibrahim/Library/Developer/Xcode/DerivedData/appworks-ios-bvhgmyzzslupqsbrfkdduticdqik/Build/Intermediates/appworks-ios.build/Debug-iphonesimulator/appworks-ios.build/Objects-normal/i386/CDVAssetLibraryFilesystem.o
    /Users/jibrahim/Library/Developer/Xcode/DerivedData/appworks-ios-bvhgmyzzslupqsbrfkdduticdqik/Build/Intermediates/appworks-ios.build/Debug-iphonesimulator/appworks-ios.build/Objects-normal/i386/CDVFile.o
duplicate symbol _kCDVAssetsLibraryPrefix in:
    /Users/jibrahim/Library/Developer/Xcode/DerivedData/appworks-ios-bvhgmyzzslupqsbrfkdduticdqik/Build/Intermediates/appworks-ios.build/Debug-iphonesimulator/appworks-ios.build/Objects-normal/i386/CDVAssetLibraryFilesystem.o
    /Users/jibrahim/Library/Developer/Xcode/DerivedData/appworks-ios-bvhgmyzzslupqsbrfkdduticdqik/Build/Intermediates/appworks-ios.build/Debug-iphonesimulator/appworks-ios.build/Objects-normal/i386/CDVFile.o
duplicate symbol _kCDVFilesystemURLPrefix in:
    /Users/jibrahim/Library/Developer/Xcode/DerivedData/appworks-ios-bvhgmyzzslupqsbrfkdduticdqik/Build/Intermediates/appworks-ios.build/Debug-iphonesimulator/appworks-ios.build/Objects-normal/i386/CDVAssetLibraryFilesystem.o
    /Users/jibrahim/Library/Developer/Xcode/DerivedData/appworks-ios-bvhgmyzzslupqsbrfkdduticdqik/Build/Intermediates/appworks-ios.build/Debug-iphonesimulator/appworks-ios.build/Objects-normal/i386/CDVLocalFilesystem.o
duplicate symbol _kCDVAssetsLibraryPrefix in:
    /Users/jibrahim/Library/Developer/Xcode/DerivedData/appworks-ios-bvhgmyzzslupqsbrfkdduticdqik/Build/Intermediates/appworks-ios.build/Debug-iphonesimulator/appworks-ios.build/Objects-normal/i386/CDVAssetLibraryFilesystem.o
    /Users/jibrahim/Library/Developer/Xcode/DerivedData/appworks-ios-bvhgmyzzslupqsbrfkdduticdqik/Build/Intermediates/appworks-ios.build/Debug-iphonesimulator/appworks-ios.build/Objects-normal/i386/CDVLocalFilesystem.o
ld: 4 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Что странно об этом, так это то, что каждый добавленный мной плагин успешно компилируется (например, CDVSplashScreen). Эта проблема возникает только при добавлении CDVFile.m, CDVLocalFilesystem.m и CDVAssetLibraryFilesystem.m в мой проект.

Любая помощь будет принята с благодарностью.

Ответ 1

Нажмите на свой Навигатор проектов с XCode.

Нажмите на BuildSettings из него.

Найдите Нет общих блоков и установите для него значение Нет.

Это работает для меня.

Ответ 2

то же самое произошло в последнее время, даже используя cocoaPods

решенный в CDVFile.h

изменить

NSString* const kCDVFilesystemURLPrefix;

к

extern NSString* const kCDVFilesystemURLPrefix;

Ответ 3

Я не так, как и если вы решили это, но я столкнулся с той же проблемой и решил ее, просто заменив каждое появление на @ "cdvfile".