Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

duplicate symbol _kCDVFilesystemURLPrefix when adding cordova file plugin to existing ios project

Tags:

ios

cordova

I have an existing ios project and I want to use a cordova web view (with plugins). I've followed the instructions in the phonegap docs and my project successfully compiles.

However, when I want to add the file plugin to my project, I get the following error:

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)

What's odd about this though is that every other plugin I have added successfully compiles (CDVSplashScreen for instance). This problem only occurs when I add CDVFile.m, CDVLocalFilesystem.m, and CDVAssetLibraryFilesystem.m to my project.

Any help would be greatly appreciated.

like image 771
jasonaibrahim Avatar asked Jun 17 '15 04:06

jasonaibrahim


1 Answers

Click on your Project Navigator from XCode.

Click on BuildSettings from it.

Find No Common Blocks in it and set it to No.

It works for me.

like image 150
Sweet.Shi Avatar answered Oct 13 '22 15:10

Sweet.Shi