Hi I tried extending the OSCamera Plugin for ODC and am now getting this error when trying to generate the mobile package. I am trying to extend it to allow me to set a flash preference when the camera opens inside the app on iOS devices. There was an issue generating the app. The Cordova plugin cordova-plugin-camera is not compatible with the "Swift Language Version" build setting that was defined. Check your plugin configurations and try again. (OS-MABS-GEN-40014)I'll attach the oml of the extension below. I can't attach the error build log, but I'll paste as much of the error as I can see.
[2024-09-19T17:03:27.151Z] [ERROR] [Build] Reason: There was an issue generating the app. The Cordova plugin cordova-plugin-camera is not compatible with the "Swift Language Version" build setting that was defined. Check your plugin configurations and try again.
[2024-09-19T17:03:27.151Z] [ERROR] [Build] Additional information:
[2024-09-19T17:03:27.151Z] [ERROR] [Build] [!] The `Servizio Patrol [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-Servizio Patrol/Pods-Servizio Patrol.debug.xcconfig'. This can lead to problems with the CocoaPods installation
[2024-09-19T17:03:27.151Z] [ERROR] [Build] [!] The `Servizio Patrol [Debug]` target overrides the `LD_RUNPATH_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-Servizio Patrol/Pods-Servizio Patrol.debug.xcconfig'. This can lead to problems with the CocoaPods installation
[2024-09-19T17:03:27.151Z] [ERROR] [Build] [!] The `Servizio Patrol [Release]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-Servizio Patrol/Pods-Servizio Patrol.release.xcconfig'. This can lead to problems with the CocoaPods installation
[2024-09-19T17:03:27.151Z] [ERROR] [Build] [!] The `Servizio Patrol [Release]` target overrides the `LD_RUNPATH_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-Servizio Patrol/Pods-Servizio Patrol.release.xcconfig'. This can lead to problems with the CocoaPods installation
[2024-09-19T17:03:27.151Z] [ERROR] [Build] .swift:36:24: error:
[2024-09-19T17:03:27.151Z] [ERROR] [Build] /Plugins/cordova-plugin-camera/OSCAMRTakePictureParameters.swift:36:24: error:
[2024-09-19T17:03:27.151Z] [ERROR] [Build] .swift:42:21: error:
[2024-09-19T17:03:27.151Z] [ERROR] [Build] /Plugins/cordova-plugin-camera/OSCAMRTakePictureParameters.swift:42:21: error:
[2024-09-19T17:03:27.151Z] [ERROR] [Build] ** ARCHIVE FAILED **
[2024-09-19T17:03:27.151Z] [ERROR] [Build] The following build commands failed:
[2024-09-19T17:03:27.151Z] [ERROR] [Build] SwiftCompile normal arm64 Compiling\ OSCAMRTakePictureParameters.swift source/platforms/ios/Servizio\ Patrol/Plugins/cordova-plugin-camera/OSCAMRTakePictureParameters.swift (in target 'Servizio Patrol' from project 'Servizio Patrol')
[2024-09-19T17:03:27.151Z] [ERROR] [Build] SwiftCompile normal arm64 source/platforms/ios/Servizio\ Patrol/Plugins/cordova-plugin-camera/OSCAMRTakePictureParameters.swift (in target 'Servizio Patrol' from project 'Servizio Patrol')
[2024-09-19T17:03:27.151Z] [ERROR] [Build] SwiftCompile normal arm64 Compiling\ OSCAMRPlayVideoParameters.swift source/platforms/ios/Servizio\ Patrol/Plugins/cordova-plugin-camera/OSCAMRPlayVideoParameters.swift (in target 'Servizio Patrol' from project 'Servizio Patrol')
[2024-09-19T17:03:27.151Z] [ERROR] [Build] (3 failures)
[2024-09-19T17:03:27.151Z] [ERROR] [Build] Command failed with exit code 65: xcodebuild -workspace Servizio Patrol.xcworkspace -scheme Servizio Patrol -configuration Debug -destination generic/platform=iOS -archivePath Servizio Patrol.xcarchive archive OTHER_CODE_SIGN_FLAGS=--options runtime --keychain "keys/keychain.keychain-db"
[2024-09-19T17:03:27.151Z] [ERROR] [Build] -- ^ --
[2024-09-19T17:03:27.151Z] [INFO] [Build] Application was not successfully generated!
[2024-09-19T17:03:41.876Z] [INFO] [Build] Execution time: 168170 ms
Hi @Spencer Buhler,
The error messages indicate that the Cordova plugin cordova-plugin-camera is not compatible with the Swift language version specified in your OutSystems mobile application. The issue arises during the build process, particularly around Swift-related settings in Xcode that the Cordova plugin cannot accommodate.
Here’s a step-by-step guide to potentially resolve this issue:
If these steps do not resolve the issue, you may need to post more details about your configuration and the exact steps you have taken so far in the OutSystems community forum to receive more specific guidance.
In plugin's most of the time the versioning problem occurred. Please check the version of the code and check working information in the cordova.
Hey @Spencer Buhler,
Are you inserting the `cordova-plugin-add-swift-support` plugin into your app directly or through a custom plugin? What's happening is that the Camera plugin is expecting this plugin with a specific version, but there's another plugin introducing another, and clashing, version.
BR.
The problem was some code in the swift files that I changed. It's fixed now and builds successfully, but I still can't get the flash to be off on default even with the swift code not causing a build failure. I can get the function I want by just extending cordova's camera plugin, but I want to extend Outsystems plugin because of all the features it has and it will be easier for me to maintain and keep up to date with their updates.
The plugin does not use the camera you're setting the flash. The plugin uses `UIImagePickerController`.
So would this self.viewController be the instance of the UIImagePickerController? Or would I need to make a new instance?
Nope, that view controller is Cordova related. It's the view controller into which all plugin's screens are added on top.
As you've seen, the Cordova plugin uses an xcframework for iOS. The code you're looking for belongs to that xcframework.
So any ideas of how I can accomplish what I'm trying to accomplish?