I’m trying to build my app with the latest cordova-ios version 6.1.1 to include the latest status-bar plugin to overcome the issue where the status bar overlays the cordova app after returning from the camera, however I am getting a build error due to what appears to be old plugin code for the file transfer plugin:
[12:34:24]: ▸ Compiling CDVFileTransfer.m
[12:34:24]: ▸ /Users/ionic/builds/schlackl/MyFieldApp/platforms/ios/My Field App/Plugins/cordova-plugin-file-transfer/CDVFileTransfer.m:98:36: ‘stringByAddingPercentEscapesUsingEncoding:’ is deprecated: first deprecated in iOS 9.0 - Use -stringByAddingPercentEncodingWithAllowedCharacters: instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent since each URL component or subcomponent has different rules for what characters are valid. [-Wdeprecated-declarations]
[12:34:24]: ▸ pathComponent = [pathComponent stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[12:34:24]: ▸ ^
[12:34:24]: ▸ /Users/ionic/builds/schlackl/MyFieldApp/platforms/ios/My Field App/Plugins/cordova-plugin-file-transfer/CDVFileTransfer.m:107:49: no known instance method for selector ‘userAgent’
[12:34:24]: ▸ NSString* userAgent = [self.commandDelegate userAgent];
I have found posts online stating this issue was fixed in a plugin update however I am not sure how to force appflow to use the latest plugin version during the build.
I’ve tried with latest build stack in AppFlow:
| Node.js version | v12.18.3 |
| Cordova CLI version | 10.0.0 |
| npm version | 6.14.6 |
| macOS version | 10.15.6 |
| Xcode version | Xcode 12.0 |
However, no luck as I get the same build error regardless of what build stack I use. Any thoughts on how to ensure the latest plugins are fetched and used for my build? Can I force this in config.xml perhaps?
Appflow will use the versions of your plugins that are specified in your package.json and config.xml (for Cordova). To make sure you are using the latest, check those files and ensure they are pointing to the latest version numbers of the plugin.
Hi there - thanks for this response - in the end I was able to remove that plugin as I’m not using it however the issue I’m really facing is in the statusbar plugin - it loses its overlay state after returning from the camera app even though the plugin docs suggest this issue was fixed in the latest version of the plugin however it still behaves the same for me and overlays my app after returning from the camera. Would love to know how to resolve this issue…holding me back on my next version release
OK but how will Ionic Appflow know to pull that plugin from GitHub when I build from my latest commit? My plugins are not included in my project source, they are references in my config.xml file and are pulled via npm. How do I specify a github location for my plugin?
And based on your previous comment about best practice, it seems odd that the plugin was fixed but not released in npm - doesn’t that mean I’d be using a development version of the plugin?
Thanks again for all your comments - trying to understand
Thanks for the tip - in the end I found a manual “work-around” for my issue - it’s silly but it works…I just hide() and then show() the statusbar after returning from the camera - works like a charm and I can just use the distributed plugin from NPM so that makes me happier!
Wow. I can’t believe this worked. This was my problem.
** BUILD FAILED **
The following build commands failed: CompileC /Users/stephenmonro/Library/Developer/Xcode/DerivedData/AppName-dkgqzlaztjythbaawmdqxxnhjikl/Build/Intermediates.noindex/AppName.build/Release-iphonesimulator/AppName.build/Objects-normal/x86_64/CDVFileTransfer.o /Users/me/ionicApps/c4i2021/c4i2021/platforms/ios/AppName/Plugins/cordova-plugin-file-transfer/CDVFileTransfer.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 failure) Command finished with error code 65: xcodebuild -workspace,AppName.xcworkspace,-scheme,App Name,-configuration,Release,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone 12 Pro Max,build,CONFIGURATION_BUILD_DIR=/Users/me/ionicApps/app/app/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/me/ionicApps/app/app/platforms/ios/build/sharedpch xcodebuild: Command failed with exit code 65 Error: xcodebuild: Command failed with exit code 65 at ChildProcess.whenDone (/Users/me/ionicApps/app/app/node_modules/cordova-common/src/superspawn.js:136:25) at ChildProcess.emit (events.js:189:13) at maybeClose (internal/child_process.js:970:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) [ERROR] An error occurred while running subprocess cordova.
cordova build ios --release --verbose exited with exit code 65.
Re-running this command with the --verbose flag may provide more information.