Cordova platform update ios issue

I must always run “cordova platform update ios” after I add the platform because I would get a swift version issue if I didn’t. i’ve recently just noticed when I do this it deleted my plugins/resources in the platform/ios/appname folder which has lead to a plugin does not exist error for all of my plugins. I believe it was working fine before today when I added the safariviewer plugin but Im not sure. I’ve tried updating everything deleting and readding everything and sudoing everything, I don’t know what else to do at the moment.

heres are my versions

    <engine name="android" spec="^6.2.3" />
    <engine name="ios" spec="^4.4.0" />
    <plugin name="cordova-plugin-console" spec="^1.0.7" />
    <plugin name="cordova-plugin-customurlscheme" spec="^4.3.0">
        <variable name="URL_SCHEME" value="{io.ionic.starter}" />
        <variable name="ANDROID_SCHEME" value="{io.ionic.starter}" />
        <variable name="ANDROID_HOST" value="{akaraali.auth0.com}" />
        <variable name="ANDROID_PATHPREFIX" value="/cordova/{io.ionic.starter}/callback" />
    </plugin>
    <plugin name="cordova-plugin-device" spec="^1.1.6" />
    <plugin name="cordova-plugin-fetch" spec="git+https://github.com/aporat/cordova-plugin-fetch.git" />
    <plugin name="cordova-plugin-iosrtc" spec="^4.0.2" />
    <plugin name="cordova-plugin-ms-adal" spec="^0.8.1" />
    <plugin name="cordova-plugin-safariviewcontroller" spec="^1.4.7" />
    <plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
    <plugin name="cordova-plugin-statusbar" spec="^2.2.3" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
    <plugin name="cordova-sqlite-storage" spec="^2.0.4" />
    <plugin name="ionic-plugin-keyboard" spec="^2.2.1" />

Elaborate please. This sounds fishy.

I cannot build my app in iOS without using the cordova platform update command after I add the platform because it says that the swift must be converted until i update. But when I do the cordova platform update it deletes the plugins within the plugin folder inside platform/ios/appname/plugins. It will build now but no plugins work and xcode shows that the plugins are not found. Its working perfectly fine on android though.

here is my package.json as well:

{
    "name": "mddeas",
    "version": "0.0.1",
    "author": "Ionic Framework",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve"
    },
    "dependencies": {
        "@angular/animations": "^4.1.3",
        "@angular/common": "4.0.0",
        "@angular/compiler": "4.0.0",
        "@angular/compiler-cli": "4.0.0",
        "@angular/core": "4.0.0",
        "@angular/forms": "4.0.0",
        "@angular/http": "4.0.0",
        "@angular/platform-browser": "4.0.0",
        "@angular/platform-browser-dynamic": "4.0.0",
        "@auth0/cordova": "^0.2.0",
        "@ionic-native/core": "^3.14.0",
        "@ionic-native/in-app-browser": "^3.12.1",
        "@ionic-native/native-page-transitions": "^4.0.1",
        "@ionic-native/safari-view-controller": "^4.1.0",
        "@ionic-native/splash-screen": "3.4.2",
        "@ionic-native/sqlite": "^3.4.4",
        "@ionic-native/status-bar": "3.4.2",
        "@ionic/app-scripts": "2.0.2",
        "@ionic/storage": "2.0.1",
        "@types/cordova-plugin-ms-adal": "0.0.18",
        "angular2-jwt": "^0.2.3",
        "angular2-uuid": "^1.1.1",
        "auth0-js": "^8.8.0",
        "chart.js": "^2.5.0",
        "cordova-android": "^6.2.3",
        "cordova-ios": "^4.4.0",
        "cordova-plugin-compat": "^1.1.0",
        "cordova-plugin-console": "^1.0.7",
        "cordova-plugin-customurlscheme": "^4.3.0",
        "cordova-plugin-device": "^1.1.6",
        "cordova-plugin-fetch": "git+https://github.com/aporat/cordova-plugin-fetch.git",
        "cordova-plugin-iosrtc": "^4.0.2",
        "cordova-plugin-ms-adal": "^0.8.1",
        "cordova-plugin-safariviewcontroller": "^1.4.7",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-statusbar": "^2.2.3",
        "cordova-plugin-whitelist": "^1.3.2",
        "cordova-sqlite-storage": "^2.0.4",
        "idea": "^2.0.7",
        "ionic-angular": "3.5.3",
        "ionic-plugin-keyboard": "^2.2.1",
        "ionicons": "3.0.0",
        "rxjs": "5.1.1",
        "socket.io-client": "^2.0.3",
        "sw-toolbox": "3.4.0",
        "web-animations-js": "^2.3.1",
        "zone.js": "^0.8.16"
    },
    "devDependencies": {
        "@ionic/app-scripts": "1.3.0",
        "@ionic/cli-plugin-cordova": "1.4.1",
        "@ionic/cli-plugin-ionic-angular": "1.3.2",
        "ionic": "3.7.0",
        "typescript": "~2.2.1"
    },
    "cordovaPlugins": [
        "cordova-plugin-splashscreen",
        "cordova-plugin-whitelist",
        "ionic-plugin-keyboard",
        "cordova-plugin-console",
        "cordova-plugin-statusbar",
        "cordova-plugin-device"
    ],
    "cordovaPlatforms": [
        "ios",
        {
            "platform": "ios",
            "version": "",
            "locator": "ios"
        }
    ],
    "description": "myApp: An Ionic project",
    "cordova": {
        "plugins": {
            "cordova-plugin-console": {},
            "cordova-plugin-device": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {},
            "cordova-plugin-fetch": {},
            "cordova-plugin-iosrtc": {},
            "cordova-sqlite-storage": {},
            "cordova-plugin-ms-adal": {},
            "cordova-plugin-customurlscheme": {
                "URL_SCHEME": "{io.ionic.starter}",
                "ANDROID_SCHEME": "{io.ionic.starter}",
                "ANDROID_HOST": "{akaraali.auth0.com}",
                "ANDROID_PATHPREFIX": "/cordova/{io.ionic.starter}/callback"
            },
            "cordova-plugin-safariviewcontroller": {}
        },
        "platforms": [
            "android",
            "ios"
        ]
    },
    "main": "index.js",
    "license": "ISC"
}

That is what I mean. Describe that more, with the exact commands, error message etc.

sorry for the late response here are the xcode and errors and the console errors I get if I dont do platform update.

xcode (while app is running):

2017-08-10 17:36:43.772 MDDEAS[6737:961941] CDVPlugin class CDVDevice (pluginName: Device) does not exist.
2017-08-10 17:36:43.772 MDDEAS[6737:961941] ERROR: Plugin ‘Device’ not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2017-08-10 17:36:43.773 MDDEAS[6737:961941] -[CDVCommandQueue executePending] [Line 142] FAILED pluginJSON = [“Device1203952113”,“Device”,“getDeviceInfo”,[]]
2017-08-10 17:36:43.774 MDDEAS[6737:961941] CDVPlugin class CDVStatusBar (pluginName: StatusBar) does not exist.
2017-08-10 17:36:43.775 MDDEAS[6737:961941] ERROR: Plugin ‘StatusBar’ not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2017-08-10 17:36:43.775 MDDEAS[6737:961941] -[CDVCommandQueue executePending] [Line 142] FAILED pluginJSON = [“StatusBar1203952114”,“StatusBar”,"_ready",[]]
2017-08-10 17:36:45.013 MDDEAS[6737:961941] Finished load of: file:///Users/adamkaraali/Library/Developer/CoreSimulator/Devices/FEE7AB1C-E09B-41F6-8099-E71699AEF244/data/Containers/Bundle/Application/1B726771-DFFE-454A-B53B-51B220B6C37A/MDDEAS.app/www/index.html
2017-08-10 17:36:46.770 MDDEAS[6737:961941] CDVPlugin class GooglePlus (pluginName: GooglePlus) does not exist.
2017-08-10 17:36:46.770 MDDEAS[6737:961941] ERROR: Plugin ‘GooglePlus’ not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2017-08-10 17:36:46.770 MDDEAS[6737:961941] -[CDVCommandQueue executePending] [Line 142] FAILED pluginJSON = [“GooglePlus1203952115”,“GooglePlus”,“login”,[{}]]
2017-08-10 17:36:59.094 MDDEAS[6737:961941] CDVPlugin class GooglePlus (pluginName: GooglePlus) does not exist.
2017-08-10 17:36:59.094 MDDEAS[6737:961941] ERROR: Plugin ‘GooglePlus’ not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2017-08-10 17:36:59.094 MDDEAS[6737:961941] -[CDVCommandQueue executePending] [Line 142] FAILED pluginJSON = [“GooglePlus1203952116”,“GooglePlus”,“login”,[{}]]

node console (when “cordova build ios” right after ive removed and re-added the platform):

Check dependencies
“Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

** BUILD FAILED **

The following build commands failed:
Check dependencies
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/adamkaraali/Desktop/smartMDDEAS/mddeas/platforms/ios/cordova/build-debug.xcconfig,-workspace,MDDEAS.xcworkspace,-scheme,MDDEAS,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone SE,build,CONFIGURATION_BUILD_DIR=/Users/adamkaraali/Desktop/smartMDDEAS/mddeas/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/adamkaraali/Desktop/smartMDDEAS/mddeas/platforms/ios/build/sharedpch
Support-D25RXOLKGG7Fs-iMac:mddeas adamkaraali$

Ah, are you using a Cordova plugin written in Swift instead of Objective-C?

Acutally ended up having two old cordova plugins that I wasn’t using and they only had android in their src and deleting them fixed it. Thank you!

1 Like