Stuck at the first hurdle


#1

I’m trying to emulate android using ionic framework’s “ionic emulate android” command.

But it throws an exception…

 [aapt] Generating resource IDs...
 [echo] ----------
 [echo] Handling BuildConfig class...
 [buildconfig] Generating BuildConfig class.

 -pre-compile:

 -compile:

 BUILD FAILED
 C:\adt-bundle-windows-x86-20131030\sdk\tools\ant\build.xml:601: The following er
 ror occurred while executing this line:
 C:\adt-bundle-windows-x86-20131030\sdk\tools\ant\build.xml:720: The following er
 ror occurred while executing this line:
 C:\adt-bundle-windows-x86-20131030\sdk\tools\ant\build.xml:734: Class not found:
  javac1.8

 Total time: 1 second

 C:\PhoneApps2\myApp2\platforms\android\cordova\node_modules\q\q.js:126
                throw e;
                      ^
 Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,C:\PhoneApps2\myApp2
 \platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
 Error: cmd: Command failed with exit code 8
     at ChildProcess.whenDone (C:\Users\Colin\AppData\Roaming\npm\node_modules\co
 rdova\src\superspawn.js:112:23)
     at ChildProcess.EventEmitter.emit (events.js:98:17)
     at maybeClose (child_process.js:730:16)
     at Process.ChildProcess._handle.onexit (child_process.js:797:5)
 Unable to emulate app on platform android. Please see console for more info.

I have the latest versions of JRE and JDK installed… in my System Variables;

JRE_HOME:  C:\Program Files (x86)\Java\jre8
JAVA_HOME: C:\Program Files (x86)\Java\jdk1.8.0
ANT_HOME: C:\Users\Colin\AppData\Roaming\npm\node_modules\ant\ant
PATH: ...;%ANT_HOME%\bin;%PATH%\tools;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%JAVA_HOME%\bin;%JRE_HOME%\bin

Does anybody have a clue as to what could be causing this issue? Thank you


#2

Sorry, no Android skills here.

Have you tried it on a non-Ionic app just to see if your development environment is setup properly? I think these are the right steps:

cordova create fakeApp com.me.fakeApp "FakeApp"
cd fakeApp
cordova add platform android
cordova build android
cordova emulate android

#3

The equivalent command is just ‘cordova build’, this replicates the error above… unfortunately knowing this isn’t helping me google the error either :confused:


#4

Hey,

My ant was in need of an update. So that issue is now resolved but it just opened up another one…

 debug:

 BUILD SUCCESSFUL
 Total time: 8 seconds
 
 C:\PhoneApps2\myApp2\platforms\android\cordova\node_modules\q\q.js:126
                     throw e;
                           ^
 ERROR : No emulator images (avds) found, if you would like to create an
  avd follow the instructions provided here:
  http://developer.android.com/tools/devices/index.html
  Or run 'android create avd --name <name> --target <targetID>'
  in on the command line.

edit::

nevermind; Android Emulator Error