Closed sinothomasAppno closed 1 year ago
Are you generating your application with forcehybrid?
yes @wmathurin, project was created with forcehybrid.
We found the cause of this error.
The cause of this issue is that the generated platforms/ios/podfile
is different when given target platform ios
vs ios,android
during forcehybrid create
prompt Enter the target platform(s) separated by commas (ios, android):
when project created with target platform is ios
, Podfile contains
# DO NOT MODIFY -- auto-generated by Apache Cordova
source 'https://cdn.cocoapods.org'
platform :ios, '14.0'
target 'forcehybrid_Local_ios' do
project 'forcehybrid_Local_ios.xcodeproj'
pod 'SalesforceHybridSDK', :tag => 'v10.2.0', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Hybrid'
pod 'MobileSync', :tag => 'v10.2.0', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS'
pod 'SmartStore', :tag => 'v10.2.0', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS'
pod 'FMDB/SQLCipher', :tag => '2.7.5', :git => 'https://github.com/ccgus/fmdb'
pod 'SQLCipher', :tag => 'v4.5.2', :git => 'https://github.com/sqlcipher/sqlcipher'
pod 'SalesforceSDKCore', :tag => 'v10.2.0', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS'
pod 'SalesforceAnalytics', :tag => 'v10.2.0', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS'
pod 'SalesforceSDKCommon', :tag => 'v10.2.0', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS'
pod 'Cordova', :tag => '6.2.0', :git => 'https://github.com/apache/cordova-ios'
end
$dynamic_framework = ['SalesforceAnalytics', 'SalesforceSDKCore', 'SalesforceSDKCommon', 'SmartStore', 'FMDB', 'SQLCipher', 'MobileSync']
pre_install do |installer|
installer.pod_targets.each do |pod|
if $dynamic_framework.include?(pod.name)
def pod.build_type
Pod::BuildType.dynamic_framework
end
end
end
end
Where as, when project created with target platform is ios,android
, Podfile is different
# DO NOT MODIFY -- auto-generated by Apache Cordova
source 'https://cdn.cocoapods.org'
platform :ios, '14.0'
use_frameworks!
target 'forcehybird_Local_ios_android' do
project 'forcehybird_Local_ios_android.xcodeproj'
pod 'SalesforceHybridSDK', :tag => 'v10.2.0', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Hybrid'
pod 'MobileSync', :tag => 'v10.2.0', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS'
pod 'SmartStore', :tag => 'v10.2.0', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS'
pod 'FMDB/SQLCipher', :tag => '2.7.5', :git => 'https://github.com/ccgus/fmdb'
pod 'SQLCipher', :tag => 'v4.5.2', :git => 'https://github.com/sqlcipher/sqlcipher'
pod 'SalesforceSDKCore', :tag => 'v10.2.0', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS'
pod 'SalesforceAnalytics', :tag => 'v10.2.0', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS'
pod 'SalesforceSDKCommon', :tag => 'v10.2.0', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS'
pod 'Cordova', :tag => '6.2.0', :git => 'https://github.com/apache/cordova-ios'
end
After using Podfile generated with target platform is ios
. Xcode build is passing, but cordova build ios
is falling with error:
note: Building targets in dependency order
error: Multiple commands produce '/Users/.../Development/tests/forcehybrid_Local_ios/platforms/ios/build/emulator/libCordova.a'
note: Target 'Cordova' (project 'Pods'): Libtool /Users/.../Development/tests/forcehybrid_Local_ios/platforms/ios/build/emulator/libCordova.a normal
note: Target 'CordovaLib' (project 'CordovaLib'): Libtool /Users/.../Development/tests/forcehybrid_Local_ios/platforms/ios/build/emulator/libCordova.a normal
error: Multiple commands produce '<Linked Binary /Users/.../Development/tests/forcehybrid_Local_ios/platforms/ios/build/emulator/libCordova.a>'
note: Target 'Cordova' (project 'Pods'): Libtool /Users/.../Development/tests/forcehybrid_Local_ios/platforms/ios/build/emulator/libCordova.a normal
note: Target 'CordovaLib' (project 'CordovaLib'): Libtool /Users/.../Development/tests/forcehybrid_Local_ios/platforms/ios/build/emulator/libCordova.a normal
/Users/.../Development/tests/forcehybrid_Local_ios/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 4.3, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'FMDB' from project 'Pods')
The first podfile is the right one. We will investigate why the generated pod file are different. For now could you edit your podfile. Make sure to remove the line
use_frameworks!
And add the following at the end
$dynamic_framework = ['SalesforceAnalytics', 'SalesforceSDKCore', 'SalesforceSDKCommon', 'SmartStore', 'FMDB', 'SQLCipher', 'MobileSync']
pre_install do |installer|
installer.pod_targets.each do |pod|
if $dynamic_framework.include?(pod.name)
def pod.build_type
Pod::BuildType.dynamic_framework
end
end
end
end
The fix for forcehybrid will be in the next release (see https://github.com/forcedotcom/SalesforceMobileSDK-Package/pull/272). The problem is that that when doing platform=ios,android the post-install fixes to the ios project were not happening.
One thing you could do for now is run forcehybrid twice, once for ios and once for android and then merge the two (basically copy platforms/ios under platforms of the other one or vice-versa).
issue solved closing issue.
Legacy build option was used with 13.4 for build to pass. After updating Xcode from 13.4 to 14.0.1.
This is related to https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin/issues/577
cordova build ios is throwing Error:
Xcode build error:
System Info
iOS build only throws this error when SalesforceMobileSDK-CordovaPlugin is added. Without it build is passing.