ionic-team / ionic-cloud-angular

Angular 2 Integration for Ionic Cloud
MIT License
29 stars 23 forks source link

Cordova-custom-config plugin fails on ionic:package build (ionic.io) #26

Open BramDecuypere opened 7 years ago

BramDecuypere commented 7 years ago

Our build server has been working for a while and pushing to ionic.io. Suddenly it stopped working after adding this plugin: cordova-custom-config We currently removed this plugin and now it's working again.

The errors we get from ionic.io:

Locally this build works, we get it running on a device, so our guess is that the problem isn't something we can solve.

Any ideas are welcome! Some relevant code on how we use this plugin:

config.xml:

...
<platform name="android">
    <config-file parent="/*" target="AndroidManifest.xml">
        <uses-permission android:name="android.permission.CAMERA" />
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    </config-file>
</platform>
...

package.json:

...
"cordovaPlugins": [
   ...
    "cordova-custom-config"
  ],
...

Your system information: Cordova CLI: Not installed Gulp version: CLI version 3.9.1 Gulp local: Local version 3.9.1 Ionic Framework Version: 2.0.0-rc.1 Ionic CLI Version: 2.1.1 Ionic App Lib Version: 2.1.1 Ionic App Scripts Version: 0.0.34 OS: Distributor ID: Ubuntu Description: Ubuntu 16.04.1 LTS Node Version: v6.8.1

luckylooke commented 7 years ago

This is not going to work, because ionic cloud doesnt support hooks, which cordova-custom-config is depend on. https://github.com/dpa99c/cordova-custom-config/issues/112#issuecomment-297147332

janpio commented 7 years ago

Also this plugin/hook should probably not be required any more as Cordova supports setting config file values in config.xml itself now: https://cordova.apache.org/docs/en/dev/plugin_ref/spec.html#edit-config (Docs say plugin.xml right now, but it also works in config.xml) Much simpler and cleaner.

luckylooke commented 7 years ago

@piotrowski nice! But unfortunatelly I need to change iOS platform xxx-Info.plist where values are structured like this:

 <dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleDisplayName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>
    <key>CFBundleIcons</key>
...
 </dict>

And edit-config needs target as XPath, but there is no way in XPath I can select CFBundleDevelopmentRegion and change sibling element :/

The only option for .plist is to replace whole with edit-config mode="overwrite", but I don't know if it is good idea, if it does not break something else..

But for AndroidManifest it is very good option! šŸ‘