apache / cordova-plugin-splashscreen

Apache Cordova Plugin splashscreen
Apache License 2.0
643 stars 639 forks source link

Installation on ios and android #306

Closed kzimny closed 3 years ago

kzimny commented 3 years ago

As described in supported platforms section, the iOS implementation has been moved to the core framework and the cordova-plugin-splashscreen is not needed for ios platform anymore but still needed for android platform. AFAIK the installation dependencies in package.json cannot be installed for one platform (android) and omit the other (ios). How to omit the installation for ios? With cordova plugin add cordova-plugin-splashscreen command the plugin is added and saved in cordova/plugins section of package.json file:

    "cordova": {
        "plugins": {
            "cordova-plugin-splashscreen": {}
        },
        "platforms": [
            "android",
            "ios"
        ]
    }

Installation on ios fails. Is there a way to exclude the plugin from installation on ios?

breautek commented 3 years ago

Installation on ios fails. Is there a way to exclude the plugin from installation on ios?

Use the latest version released version which has the ios platform code physically removed from this plugin. Ensure you don't have references of this plugin in your config.xml or package.json that may cause the plugin add command to install an older version of the plugin. Also ensure you're using the latest version of cordova-ios, which includes splashscreen related fixes.

kzimny commented 3 years ago

Thank you for your response. I'm using the latest version of all plugins and the last version of cordova for ios and android.

{
    "name": "xxxx",
    "displayName": "xxxxxxx",
    "version": "1.0.0",
    "description": "xxxxxxxx",
    "main": "index.js",
    "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
    },
    "keywords": [
        "ecosystem:cordova"
    ],
    "author": "xxxxxx",
    "license": "Apache-2.0",
    "dependencies": {
        "cordova-android": "9.0.0",
        "cordova-ios": "6.1.1",
        "cordova-plugin-device": "^2.0.3",
        "cordova-plugin-inappbrowser": "^4.1.0",
        "cordova-plugin-network-information": "^2.0.2",
        "cordova-plugin-statusbar": "^2.4.3"
    },
    "devDependencies": {
        "cordova-plugin-splashscreen": "^6.0.0",
        "cordova-plugin-whitelist": "^1.3.4"
    },
    "cordova": {
        "plugins": {
            "cordova-plugin-whitelist": {},
            "cordova-plugin-inappbrowser": {},
            "cordova-plugin-device": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-network-information": {},
            "cordova-plugin-splashscreen": {}
        },
        "platforms": [
            "android",
            "ios"
        ]
    }
}

The recommendation does not solve the problem because the cordova-plugin-splashscreen is needed on android os. For ios it's clear, when the plugin is removed from package.json everythings woskd fine on ios. But the plugin is needed for android installation and deployment. How to install/use cordova-plugin-splashscreen on android only?