Cordova command fails when trying to "run android"

Hi,

I am trying to run a meteor app on my android device via meteor run android-device. I keep getting this error though:

kristis@kristis-UX32LN:~/Projects/listingapp$ meteor run android-device
[[[[[ ~/Projects/listingapp ]]]]]             

=> Started proxy.                             
=> Started MongoDB.                           
                                              
WARNING: You are testing your app on a remote device. For the mobile app to be able to connect to the local server, make sure your device is on the same network, and that the network configuration allows clients to talk to each other (no client
         isolation).
=> Started your app.                          
                                              
=> App running at: http://localhost:3000/     
=> Errors executing Cordova commands:         
                                              
   While running Cordova app for platform Android with options --device:
   Error: Command failed: /home/kristis/Projects/listingapp/.meteor/local/cordova-build/platforms/android/cordova/run --device
   /home/kristis/Projects/listingapp/.meteor/local/cordova-build/platforms/android/src/12qesd/MainActivity.java:20: error: <identifier> expected
   package 12qesd;
   ^
   /home/kristis/Projects/listingapp/.meteor/local/cordova-build/platforms/android/src/12qesd/MainActivity.java:20: error: class, interface, or enum expected
   package 12qesd;
   ^
   /home/kristis/Projects/listingapp/.meteor/local/cordova-build/platforms/android/build/generated/source/r/debug/12qesd/R.java:8: error: <identifier> expected
   package 12qesd;
   ^
   /home/kristis/Projects/listingapp/.meteor/local/cordova-build/platforms/android/build/generated/source/r/debug/12qesd/R.java:8: error: class, interface, or enum expected
   package 12qesd;
   ^
   /home/kristis/Projects/listingapp/.meteor/local/cordova-build/platforms/android/build/generated/source/buildConfig/debug/12qesd/BuildConfig.java:4: error: <identifier> expected
   package 12qesd;
   ^
   /home/kristis/Projects/listingapp/.meteor/local/cordova-build/platforms/android/build/generated/source/buildConfig/debug/12qesd/BuildConfig.java:4: error: class, interface, or enum expected
   package 12qesd;
   ^
   6 errors
   
   FAILURE: Build failed with an exception.
   
   * What went wrong:
   Execution failed for task ':compileDebugJava'.
   > Compilation failed; see the compiler error output for details.
   
   * Try:
   Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
   
   /home/kristis/Projects/listingapp/.meteor/local/cordova-build/platforms/android/cordova/node_modules/q/q.js:126
   throw e;
   ^
   Error code 1 for command: /home/kristis/Projects/listingapp/.meteor/local/cordova-build/platforms/android/gradlew with args:
   cdvBuildDebug,-b,/home/kristis/Projects/listingapp/.meteor/local/cordova-build/platforms/android/build.gradle,-PcdvBuildArch=arm,-Dorg.gradle.daemon=true
   at ChildProcess.exitCallback (/tools/utils/processes.js:137:23)
   at ChildProcess.emit (events.js:98:17)
   at Process.ChildProcess._handle.onexit (child_process.js:820:12)
                                              
ExitWithCode:1

This error occurs on both android emulator and android device. I tried launching a newly created project though (the basic clicker from the tutorials) and it launches fine.

Also - the app that is now getting an error was working fine a week ago from another location.

Can this be related to the network i’m connected to? If not - what other things should I look at?

It seems the error occurs because 12qesd is used as a package name, which is illegal in Java (package names can’t start with a number). The package name is based on the Cordova app id, which starts with com. by default. Did you use App.info to set id yourself by any chance?

Hello, thanks for the answer!

You’re right - i was assigning the ID myself. The app was not building even after removing wrong id from mobile-config - i had to delete cordova-build folder from project’s ./meteor folder to make it work.

Thanks for the help!