cordova-plugin-cocoapods-support
cordova-plugin-cocoapods-support copied to clipboard
Imported type swift framework using `cordova run ios` running error
My project file config.xml was introduced
<platform name="ios">
<preference name="deployment-target" value="9.0" />
<preference name="pods_use_frameworks" value="true" />
<preference name="UseSwiftLanguageVersion" value="4" />
<pod name="RxSwift" />
<pod name="RxCocoa" />
</platform>
<plugin name="cordova-plugin-cocoapod-support" spec="^1.5.0" />
<plugin name="cordova-plugin-add-swift-support" spec="^1.7.2" />
Xcode 9.2
cordova 8.0.0
cordova-ios 4.5.4
ios target 9.0
I set my own termId and set the Swift Language Version
to Swift 4.0
in the Pods project, and it can run successfully in Xcode, but I used cordova run ios
and I got some errors.
ld: warning: directory not found for option '-F/Users/kain/Library/Developer/Xcode/DerivedData/map-fvvjdyiqslzkzzelbljbiknglydw/Build/Intermediates.noindex/ArchiveIntermediates/map/BuildProductsPath/Debug-iphoneos/RxCocoa'
ld: warning: directory not found for option '-F/Users/kain/Library/Developer/Xcode/DerivedData/map-fvvjdyiqslzkzzelbljbiknglydw/Build/Intermediates.noindex/ArchiveIntermediates/map/BuildProductsPath/Debug-iphoneos/RxSwift'
ld: framework not found RxCocoa
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** ARCHIVE FAILED **
The following build commands failed:
Ld /Users/kain/Library/Developer/Xcode/DerivedData/map-fvvjdyiqslzkzzelbljbiknglydw/Build/Intermediates.noindex/ArchiveIntermediates/map/IntermediateBuildFilesPath/Pods.build/Debug-iphoneos/RxSwift.build/Objects-normal/armv7/RxSwift normal armv7
Ld /Users/kain/Library/Developer/Xcode/DerivedData/map-fvvjdyiqslzkzzelbljbiknglydw/Build/Intermediates.noindex/ArchiveIntermediates/map/IntermediateBuildFilesPath/Pods.build/Debug-iphoneos/RxSwift.build/Objects-normal/arm64/RxSwift normal arm64
(2 failures)
(node:7029) UnhandledPromiseRejectionWarning: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/kain/workspace/AppProjects/map/platforms/ios/cordova/build-debug.xcconfig,-workspace,map.xcworkspace,-scheme,map,-configuration,Debug,-destination,generic/platform=iOS,-archivePath,map.xcarchive,archive,CONFIGURATION_BUILD_DIR=/Users/kain/workspace/AppProjects/map/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/kain/workspace/AppProjects/map/platforms/ios/build/sharedpch
(node:7029) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7029) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I searched for google and tested some methods, but still can't solve the problem, I don't know why.
did you find a solution for this?
I think the problem is not the plugin, but the cordova-ios platfrom.
Try using a nightly platform. I had a similar problem, and for me, this nightly worked:
cordova platform add [email protected]
@alexkiri thanks - updating cordova-ios to version 5.0.0 also resolved a similar issue I was experiencing which led me here...