forcedotcom / SalesforceMobileSDK-iOS

iOS SDK for Salesforce
Other
538 stars 420 forks source link

Failed to build hybird local ios app. Multiple commands produce 'Cordova.framework/Cordova': #3361

Closed ftfeiteng closed 3 years ago

ftfeiteng commented 3 years ago

I am trying to create a hybird local cordova app for both Android and iOS with SalesforceMobileSDK. I managed to get Android wroking, but I ran into some issue when building the iOS app

  1. Version of Mobile SDK Used: 9.0.0
  2. Issue found in Native App or Hybrid App: Hybird App
  3. OS Version: Cordova iOS 6.1.1 Cordova 10.0.0
  4. Device:
  5. Steps to reproduce: 1) Create hybird local app followed by this guide, added iOS platform https://trailhead.salesforce.com/content/learn/modules/mobile_sdk_hybrid/mobilesdk_hybrid_sample_app 2) Verify the Pods folder has salesforce pods. 3) Run the project on the iOS cordova run ios
  6. Actual behavior: Failed to build for iOS
  7. Expected Behavior: Build successful for iOS
  8. Error Log: using command cordova run ios
    
    note: Using new build system
    note: Planning build
    note: Constructing build description
    Build system information
    warning: Multiple targets match implicit dependency for linker flags '-framework Cordova'. Consider adding an explicit dependency on the intended target to resolve this ambiguity. (in target 'contactsApp' from project 'contactsApp')

Build system information error: Multiple commands produce '/Users/feiteng/workspace/sideproject/salesforce-sdk-poc/contactsApp/platforms/ios/build/emulator/Cordova.framework/Cordova': 1) Target 'Cordova' has link command with output '/Users/feiteng/workspace/sideproject/salesforce-sdk-poc/contactsApp/platforms/ios/build/emulator/Cordova.framework/Cordova' 2) Target 'Cordova' has link command with output '/Users/feiteng/workspace/sideproject/salesforce-sdk-poc/contactsApp/platforms/ios/build/emulator/Cordova.framework/Cordova'

...... some similar logs

warning: duplicate output file '' on task: Touch /Users/feiteng/workspace/sideproject/salesforce-sdk-poc/contactsApp/platforms/ios/build/emulator/Cordova.framework (in target 'Cordova' from project 'Pods')

...... some similar logs

BUILD FAILED


I also tried to build in the xcode and got an error.

Build input file cannot be found: '/Users/feiteng/workspace/sideproject/salesforce-sdk-poc/contactsApp/platforms/ios/CordovaLib/Cordova/Info.plist'

![image](https://user-images.githubusercontent.com/43196214/113507664-48d96200-958f-11eb-8935-c991b0bfaa55.png)

9. More details
Podfile

DO NOT MODIFY -- auto-generated by Apache Cordova

source 'https://cdn.cocoapods.org' platform :ios, '13.0' use_frameworks! target 'contactsApp' do project 'contactsApp.xcodeproj' pod 'SalesforceHybridSDK', :branch => 'dev', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Hybrid' pod 'MobileSync', :branch => 'dev', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS' pod 'SmartStore', :branch => 'dev', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS' pod 'FMDB/SQLCipher', :tag => '2.7.5', :git => 'https://github.com/ccgus/fmdb' pod 'SQLCipher/fts', :tag => 'v4.4.2', :git => 'https://github.com/sqlcipher/sqlcipher' pod 'SalesforceSDKCore', :branch => 'dev', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS' pod 'SalesforceAnalytics', :branch => 'dev', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS' pod 'SalesforceSDKCommon', :branch => 'dev', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS' end

wmathurin commented 3 years ago

Something looks off. It should pulling in the v9.0.0 versions of the various libs. See https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin/blob/v9.0.0/plugin.xml#L97

How did you generate the application?

ftfeiteng commented 3 years ago

I followed this document to generate the applicateion https://trailhead.salesforce.com/content/learn/modules/mobile_sdk_hybrid/mobilesdk_hybrid_sample_app

Here is the commands that I used. git clone https://github.com/forcedotcom/SalesforceMobileSDK-Shared.git forcehybrid create cd contactsApp cordova plugin add cordova-plugin-contacts cordova plugin add cordova-plugin-statusbar cordova plugin remove com.salesforce instead of adding from the github, I cloned the SalesforceMobileSDK locally because it is way faster. cordova plugin add <local path to SalesforceMobileSDK-CordovaPlugin> --force cp -RL <local path to SalesforceMobileSDK-Shared>/samples/contactexplorer/* www/ cordova run ios

wmathurin commented 3 years ago

Make sur you clone SalesforceMobileSDK at the v9.0.0 tag then.

ftfeiteng commented 3 years ago

Thanks wmathurin. After I checked out at v9.0.0 tag. It works as expected. Sorry, I can't believe that I overlooked it.