Error with package name when adding android platform


#1

I run meteor add-platform android and get:

=> Errors executing Cordova commands:

   While adding platform Android to Cordova project:
   Error validating package name. Package name must look like: com.company.Name
   at validatePackageName
   (C:\Users\gatsu\.cordova\lib\npm_cache\cordova-android\6.2.3\package\bin\lib\create.js:173:25)
   at Object.exports.create
   (C:\Users\gatsu\.cordova\lib\npm_cache\cordova-android\6.2.3\package\bin\lib\create.js:246:12)
   at Api.createPlatform
   (C:\Users\gatsu\.cordova\lib\npm_cache\cordova-android\6.2.3\package\bin\templates\cordova\Api.js:116:10)
   at
   C:\Users\gatsu\AppData\Local\.meteor\packages\meteor-tool\1.6.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\cordova-lib\src\cordova\platform.js:198:24
   at _fulfilled
   (C:\Users\gatsu\AppData\Local\.meteor\packages\meteor-tool\1.6.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\q\q.js:787:54)
   at self.promiseDispatch.done
   (C:\Users\gatsu\AppData\Local\.meteor\packages\meteor-tool\1.6.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\q\q.js:816:30)
   at Promise.promise.promiseDispatch
   (C:\Users\gatsu\AppData\Local\.meteor\packages\meteor-tool\1.6.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\q\q.js:749:13)
   at
   C:\Users\gatsu\AppData\Local\.meteor\packages\meteor-tool\1.6.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\q\q.js:557:44
   at flush
   (C:\Users\gatsu\AppData\Local\.meteor\packages\meteor-tool\1.6.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\q\q.js:108:17)
   at _combinedTickCallback (internal/process/next_tick.js:131:7)
   at process._tickCallback (internal/process/next_tick.js:180:9)
   => awaited here:
   at Function.Promise.await
   (C:\Users\gatsu\AppData\Local\.meteor\packages\meteor-tool\1.6.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\promise_server.js:56:12)
   at Promise.asyncApply (C:\tools\cordova\project.js:384:7)
   at
   C:\Users\gatsu\AppData\Local\.meteor\packages\meteor-tool\1.6.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\fiber_pool.js:43:40
   => awaited here:
   at Function.Promise.await
   (C:\Users\gatsu\AppData\Local\.meteor\packages\meteor-tool\1.6.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\promise_server.js:56:12)
   at CordovaProject.runCommands (C:\tools\cordova\project.js:725:14)
   at CordovaProject.addPlatform (C:\tools\cordova\project.js:380:10)
   at CordovaProject.ensurePlatformsAreSynchronized (C:\tools\cordova\project.js:411:12)
   at main.captureAndExit (C:\tools\cli\commands-cordova.js:54:20)
   at C:\tools\utils\buildmessage.js:271:13
   at exports.EnvironmentVariable.withValue (C:\tools\utils\fiber-helpers.js:89:14)
   at C:\tools\utils\buildmessage.js:264:29
   at exports.EnvironmentVariable.withValue (C:\tools\utils\fiber-helpers.js:89:14)
   at C:\tools\utils\buildmessage.js:262:18
   at exports.EnvironmentVariable.withValue (C:\tools\utils\fiber-helpers.js:89:14)
   at C:\tools\utils\buildmessage.js:253:23
   at exports.EnvironmentVariable.withValue (C:\tools\utils\fiber-helpers.js:89:14)
   at Object.capture (C:\tools\utils\buildmessage.js:252:19)
   at Object.main.captureAndExit (C:\tools\cli\main.js:272:29)
   at doAddPlatform (C:\tools\cli\commands-cordova.js:36:8)
   at Command.func (C:\tools\cli\commands-cordova.js:125:3)
   at C:\tools\cli\main.js:1522:15

Any idea on how to fix this?


#2

Do you have mobile-config.js at the root of your project already? If so, you may want to check and ensure the id field of App.info( matches what it’s telling you the package name should look like (com.company.Name).


#3

I do have that file in the root and it already follows that pattern.


#4

Hello, you can try this

rm -Rf .meteor/local/
meteor add-platform android

It worked for me