Open wenji-my opened 5 years ago
I'm also having the same issue. When I run the following command I get the same error message as above.
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
My ionic info
:
Ionic:
Ionic CLI : 5.0.3 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.4.2
@angular-devkit/build-angular : 0.13.8
@angular-devkit/schematics : 0.7.5
@angular/cli : 7.3.8
@ionic/angular-toolkit : not installed
Cordova:
Cordova CLI : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 8.0.0, browser 5.0.4, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.0, (and 16 other plugins)
Utility:
cordova-res : not installed
native-run : not installed
System:
Android SDK Tools : 26.1.1 (/Users/ireaderinokun/Library/Android/sdk)
NodeJS : v10.16.0 (/usr/local/bin/node)
npm : 6.9.0
OS : macOS Mojave
Xcode : Xcode 10.2.1 Build version 10E1001
I'm also using Swift language version 5, as set in my config.xml
<preference name="UseSwiftLanguageVersion" value="5" />
@ireade have you found any solution yet, i have the same issue.
@itismelito Yes! I don't remember exactly which of these things worked, but here's my current setup:
My ionic info
:
Ionic:
Ionic CLI : 5.0.3 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.4.2
@angular-devkit/build-angular : 0.13.8
@angular-devkit/schematics : 0.7.5
@angular/cli : 7.3.8
@ionic/angular-toolkit : not installed
Cordova:
Cordova CLI : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 8.0.0, browser 5.0.4, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.5.1, (and 16 other plugins)
Utility:
cordova-res : not installed
native-run : not installed
System:
Android SDK Tools : 26.1.1 (/Users/ireaderinokun/Library/Android/sdk)
ios-deploy : 1.9.4
NodeJS : v10.16.0 (/usr/local/bin/node)
npm : 6.9.0
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61
Also:
cordova-plugin-qrscanner
version 3.0.1cordova-ios
version 4.5.5Hope that helps!
I had the same problem... to use this plugin with the most recent version of XCode, you have to replace a method on the QRScanner.swift file, located at Users/arsa/projects/gitlab/sz-game/wallet-app/src-cordova/platforms/ios/qianbao/Plugins/cordova-plugin-qrscanner/QRScanner.swift
Just replace
@objc func openSettings(_ command: CDVInvokedUrlCommand) {
if #available(iOS 10.0, *) {
guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else {
return
}
if UIApplication.shared.canOpenURL(settingsUrl) {
UIApplication.shared.open(settingsUrl, completionHandler: { (success) in
self.getStatus(command)
})
} else {
self.sendErrorCode(command: command, error: QRScannerError.open_settings_unavailable)
}
} else {
// pre iOS 10.0
if #available(iOS 8.0, *) {
UIApplication.shared.openURL(NSURL(string: UIApplication.openSettingsURLString)! as URL)
self.getStatus(command)
} else {
self.sendErrorCode(command: command, error: QRScannerError.open_settings_unavailable)
}
}
}
With this:
@objc func openSettings(_ command: CDVInvokedUrlCommand) {
if #available(iOS 10.0, *) {
guard let settingsUrl = URL(string: UIApplicationOpenSettingsURLString) else {
return
}
if UIApplication.shared.canOpenURL(settingsUrl) {
UIApplication.shared.open(settingsUrl, completionHandler: { (success) in
self.getStatus(command)
})
} else {
self.sendErrorCode(command: command, error: QRScannerError.open_settings_unavailable)
}
} else {
// pre iOS 10.0
if #available(iOS 8.0, *) {
UIApplication.shared.openURL(NSURL(string: UIApplicationOpenSettingsURLString)! as URL)
self.getStatus(command)
} else {
self.sendErrorCode(command: command, error: QRScannerError.open_settings_unavailable)
}
}
}
Try it and see if it helps
Hello, I can't compile this cordova plugin on Swift 4.1.
please help, Thanks!