tpneumat opened a new issue #1380:
URL: https://github.com/apache/cordova-android/issues/1380


   # Bug Report
   
   ## Problem
   
   Can not include `& ` in the cordova app name without causing a build 
failure to occur when strings.xml is created.
   
   ### What is expected to happen?
   
   If I have properly escaped the & in the config.xml, it should also apply to 
the strings.xml.  
   
   
   ### What does actually happen?
   It seems the `&` is converted back to `&` when strings xml is created, 
perhaps in prepare.js.  This causes the cordova add command to fail.
   
   
   ## Information
   
   Given the following config.xml
   ```
   <?xml version='1.0' encoding='utf-8'?>
   <widget id="xxx.xxx.xxxx" version="6.2.2" android-versionCode="622000062" 
versionCode="62" xmlns="http://www.w3.org/ns/widgets"; 
xmlns:android="http://schemas.android.com/apk/res/android"; 
xmlns:gap="http://phonegap.com/ns/1.0";>
   
       <name>TIMING &amp; TRACKING</name>
       <description>
           Timing APP
       </description>
   ```
   
   
   ### Command or Code
   Run the command to create the cordova project
   
   ```
   cordova platform add [email protected]
   Using cordova-fetch for [email protected]
   Adding android project...
   Creating Cordova project for the Android platform:
        Path: platforms/android
        Package: me.rtrt.app.tsa
        Name: TIMING & TRACKING
        Activity: MainActivity
        Android target: android-30
   Subproject Path: CordovaLib
   Subproject Path: app
   Android project created with [email protected]
   Invalid character in entity name
   Line: 3
   Column: 37
   Char:
   ```
   
   Then, checking the strings.xml that was created, you can find there is a 
non-escaped & 
   
   /platforms/android/app/src/main/res/values/strings.xml
   
   
   ```
   <?xml version="1.0" encoding="utf-8"?>
   <resources>
       <!-- App label shown within list of installed apps, battery & network 
usage screens. -->
       <string name="app_name">TIMING & TRACKING</string>
       <!-- App label shown on the launcher. -->
       <string name="launcher_name">@string/app_name</string>
       <!-- App label shown on the task switcher. -->
       <string name="activity_name">@string/launcher_name</string>
   </resources>
   ```
   
   
   ### Environment, Platform, Device
   N/A
   
   ### Version information
   
   Android  Cordova 10.1.1 
   MacOs 10.15.7 (catalina)
   
   
   
   
   ## Checklist
   
   
   - [X] I searched for existing GitHub issues
   - [X] I updated all Cordova tooling to most recent version
   - [X] I included all the necessary information above
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to