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

Unexplained Android build failure when drawables added.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 7.0.0, 7.1.0
    • None
    • cordova-android
    • None
    • cordova 8.0.8

      cordova-android 7.0.0

    Description

      If you create an Android project with version 7.0.0 or 7.1.0 and create a res directory in platforms/android/res the build fails with a confusing message. Some plugins create this directory and or have instructions are to copy drawables into this directory.

      Potential solutions could be

      1. More descriptive error
      2. Better detection that is a Android Studio project would allow for better diagnoses of this failure
      3. Suggest to user to move the drawables to the Android Studio project format indicating the presence of the res directory and the app directory

      To reproduce 

      1. cordova create test9 com.Test.Test9
      2. cordova platform add android
      3. mkdir -p platforms/android/res/drawable
      4. cp image.png platforms/android/res/drawable
      5. cordova build --verbose

      The error

      Generating platform-specific config.xml from defaults for android at /tmp/test9/platforms/android/res/xml/config.xml
      cp: copyFileSync: could not write to dest file (code=ENOENT):/tmp/test9/platforms/android/res/xml/config.xmlMerging project's config.xml into platform-specific android config.xml
      Parsing /tmp/test9/platforms/android/res/xml/config.xml failed
      (node:20148) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, open '/tmp/test9/platforms/android/res/xml/config.xml'

      Attachments

        Activity

          People

            Unassigned Unassigned
            robertb Robert Brenton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: