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

Valid Java package names are marked as invalid when trying to add android platform

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • cordova-android
    • None
    • cordova-android 3.6.4

    Description

      cordova-android 3.6.4 is reporting "com._123abc.MyApp" as invalid Java package while allowing "com.123abc.MyApp" which is an actual invalid Java package name (http://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html).

      In bin/lib/create.js, line 150:

      if (!/^[a-zA-Z]+(\.[a-zA-Z0-9][a-zA-Z0-9_]*)+$/.test(package_name)) {
          return Q.reject('Package name must look like: com.company.Name');
      }
      

      Should be changed to:

      if (!/^[a-zA-Z]+(\.[a-zA-Z_][a-zA-Z0-9_]*)+$/.test(package_name) ) {
      

      Thus allowing for valid Java package names such as:

      com._123abc.MyApp

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              steve1medix Steve Lam
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: