Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-1235

Android create script on Windows fails to copy config.xml

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0, Master
    • Master, 2.1.0
    • cordova-android
    • None
    • Windows

    Description

      The "create" script for Android on Windows still refers to the old cordova.xml and plugins.xml files instead of config.xml, and fails to copy the later to the newly created project. This prevents the new app from initializing properly, creating a very poor experience for new users especially. Patch for fix:

      diff --git a/bin/create.js b/bin/create.js
      index bec182b..e0886f6 100644
      — a/bin/create.js
      +++ b/bin/create.js
      @@ -154,8 +154,7 @@ if(fso.FolderExists(ROOT + '
      framework'))

      { exec('%comspec% /c copy '+ROOT+'\\framework\\assets\\www\\cordova-'+VERSION+'.js '+PROJECT_PATH+'\\assets\\www\\cordova-'+VERSION+'.js /Y'); exec('%comspec% /c copy '+ROOT+'\\framework\\cordova-'+VERSION+'.jar '+PROJECT_PATH+'\\libs\\cordova-'+VERSION+'.jar /Y'); fso.CreateFolder(PROJECT_PATH + '\\res\\xml'); - exec('%comspec% /c copy '+ROOT+'\\framework\\res\\xml\\cordova.xml ' + PROJECT_PATH + '\\res\\xml\\cordova.xml /Y'); - exec('%comspec% /c copy '+ROOT+'\\framework\\res\\xml\\plugins.xml ' + PROJECT_PATH + '\\res\\xml\\plugins.xml /Y'); + exec('%comspec% /c copy '+ROOT+'\\framework\\res\\xml\\config.xml ' + PROJECT_PATH + '\\res\\xml\\config.xml /Y'); }

      else {
      // copy in cordova.js
      exec('%comspec% /c copy 'ROOT'
      cordova-'VERSION'.js 'PROJECT_PATH'\\assets\\www
      cordova-'VERSION'.js /Y');
      @@ -163,8 +162,7 @@ if(fso.FolderExists(ROOT + '
      framework'))

      { exec('%comspec% /c copy '+ROOT+'\\cordova-'+VERSION+'.jar '+PROJECT_PATH+'\\libs\\cordova-'+VERSION+'.jar /Y'); // copy in xml fso.CreateFolder(PROJECT_PATH + '\\res\\xml'); - exec('%comspec% /c copy '+ROOT+'\\xml\\cordova.xml ' + PROJECT_PATH + '\\res\\xml\\cordova.xml /Y'); - exec('%comspec% /c copy '+ROOT+'\\xml\\plugins.xml ' + PROJECT_PATH + '\\res\\xml\\plugins.xml /Y'); + exec('%comspec% /c copy '+ROOT+'\\xml\\config.xml ' + PROJECT_PATH + '\\res\\xml\\config.xml /Y'); }

      // copy cordova scripts

      Attachments

        1. create.js.patch
          2 kB
          Josh Pettett

        Activity

          People

            anis Anis Kadri
            jpettettledet Josh Pettett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: