Config.xml changes do not take affect in iOS 7.1


#1

hey everybody,

it doesn’t matter what i am changing in the config.xml (preferences, features, …) it does not take any affect. what can that be? it is annoying as i have still the problems with header moving when virtual keyboard is shown. in my previous project it worked perfect.

many thanks,
michael


#2

Need a little more information (e.g. are you using phonegap build with hydration turned on)

If you are, then you need to delete the app and add again (download from QR code), for config.xml changes to take effect. Hydration only (in my experience) tends to update the HTML / CSS etc - not the config.xml changes.


#3

hey,

yes i updated last time over the cli with the command. “cordova build iOS”. then i am emulate from xcode. what do you mean by delete the app and add again? create a complete new cordova project and copy the files back in there? and what is the best way to avoid this behavior? what is hydration on?

many thanks in advance
michael


#4

The hydration here is referring to is a feature of PhoneGap Build. If you are using Adobe’s build system for you app, you could use hydration.

I am assuming this issue started for you after updating cordova on your machine. Is this right? On older versions of cordova, the Config.xml was in your WWW folder. Now, it is in the root of your app. So, make sure you are making config.xml changes in /path/to/my/app/config.xml instead of /path/to/my/app/www/config.xml


#5

yeah that can be. now i am running the latest 3.3.4 version. ok so that means if i have the platform iOS i put the config.xml in …/platforms/ios/config.xml instead of …/platforms/ios/www/config.xml. is that right? so i just can put it there and then run a build on it using the cli?

but the phone gap build is not the same then the cli right?


#6

Now, you should almost never touch anything inside ../platforms/....

Your work should all be done in the /path/to/my/app/www folder and /path/to/my/app/ folder for the config.xml.

When you run cordova build xxxx, it takes the content of your root path and puts into the platform paths. Anything you put in the platform paths is going to be overridden by the build process.


#7

ok i will give it a try. hopefully it works. thx


#8

ok but the config.xml from the /path/to/my/app is not copied in the specific platform directory? is this normal?


#9

Did you recently upgrade to cordova 3.4.0? It moved the config.xml file to the root of your project and not inside the www/ dir.

@calendee is sorta right about not touching platforms, but if you’re not using Adobe Build and are building your apps yourself locally you’re going to have to fiddle around in Xcode and to a lesser extent, in the Android source if you’re going to want to add a custom icon or splash screen for your app (the res/ folder that Phonegap makes is ONLY for Build - if you’re just using vanilla cordova then you’ll need to update the app icons yourself, and there are some other Xcode settings that you can only set in Xcode (depending on what you’re doing - it’s possible that you never need to launch Xcode again until you’re ready to push your app to the App Store).

If you’re still having problems after moving your config.xml file, and the build process doesn’t throw any errors, you can post it here and I’m sure someone can help diagnose.


#10

ok. so actually i have a config.xml file in my root folder of my project (xxx/config.xml) and in the folder of the xxx/platforms/ios/. and it is not working. i have no clue what i am doing wrong. :frowning:


#11

If it’s in the platforms folder then it’s there because Cordova is copying it there - so it’s reading the file correctly.

There’s probably some issue with the contents of the file itself. Can you post it here? Or give us more details about what it is that doesn’t take effect?


#12

i copied it in the xxx/platforms/ios/ directory. but i can delete it there again.

here is how my config.xml does look like:

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.ionic.HandFuss" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>HandFuss</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <access origin="*" />

    <preference name="EnableViewportScale" value="false"/>
    <preference name="KeyboardShrinksView" value="false" />
    <preference name="orientation" value="portrait" />
    <preference name="fullscreen" value="true" />
    <preference name="webviewbounce" value="false" />
    <preference name="UIWebViewBounce" value="false" />
    <preference name="DisallowOverscroll" value="true" />
</widget>

#13

That looks good. You don’t need to manually copy it into the platforms folder as Cordova will wipe out everything in platforms/ios/www every time you build your app anyway.

Try cordova build ios from the root of your project. That will copy the right files and then compile your project for iOS. You can alternately run it in the emulator with cordova emulate ios (although I think you need to install ios-sim first? - npm install ios-sim -g) which will run build first.

What do you think is supposed to happen that isn’t happening? What changes aren’t taking effect?


#14

for example the DisallowOverscroll true because if i want to type something in a input field the header moves out on top. so it seems the whole thing does not take effect. if i delete the whole preference settings i don’t get a different behavior. that tells me that something is not working correct


#15

What version of cordova are you using? > cordova -v

After you do cordova build ios, what are the contents of config.xml inside Xcode - not when opening from the file system.


#16

3.4.0-0.1.2 is the cordova version. The config.xml does not change after the build. That is what i dont understand. Is this normal behavior?


#17

this is the content right out of xcode after build iOS with cordova.

<?xml version='1.0' encoding='utf-8'?>
 <widget id="com.ionic.HandFuss" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>HandFuss</name>
<description>
    A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
    Apache Cordova Team
</author>
<content src="index.html" />
<access origin="*" />

<preference name="EnableViewportScale" value="false"/>
<preference name="KeyboardShrinksView" value="false" />
<preference name="orientation" value="portrait" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />

#18

Can you post your directory structure (event just a screenshot). Do you have some Grunt or Gulp build process? If so, does it do anything with Config.xml?


#19

hey,

first of all thx for helping me in that issue. very much appreciated.
no i don’t have any other build processes. all i do is call through the cli the cordova build.

here is my structure


#20

I’m not sure what the problem is. The best I can suggest it to start from scratch. Then, copy over the html and js files if you need to.

Up above, you mentiond 3.3.5 and 3.4.0 of Cordova, I’d make sure you are on 3.4.0 with cordova -v.

If you are just doing a simple Cordova build :

  • cordova create name-you-want-for-the-directory com.something.myappname “MyAppName”
  • cordova platform add ios