blakgeek / cordova-plugin-cocoapods-support

A Cordova/PhoneGap plugin to add support for CocoaPods dependencies.
MIT License
72 stars 71 forks source link

Imported type swift framework using `cordova run ios` running error #41

Open kainonly opened 6 years ago

kainonly commented 6 years ago

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.

haemi commented 6 years ago

did you find a solution for this?

alexkiri commented 6 years ago

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 ios@5.0.0-nightly.2018.9.10.004b8300

geoffliddiard commented 5 years ago

@alexkiri thanks - updating cordova-ios to version 5.0.0 also resolved a similar issue I was experiencing which led me here...