Cordova error code 8 (environment or OS problem) when following the official tutorial


I followed the official tutorial and created to example todo app. running fine on my browser.
When i get to the mobile part, running ‘meteor run android’ ends with android emulator but with no app.
‘meteor run android --verbose’ gives the following error (i’m not pasting it all, just from where i think there is a problem:

 Wrote out Android package name to "com.idfpsa9n1167zixnzrawc"
Running command: /home/avig/my_app_02/.meteor/local/cordova-build/platforms/android/cordova/run --emulator
                    throw e;
Error: ENOENT, no such file or directory '/opt/android-sdk/tools/lib/build.template'
    at Object.fs.openSync (fs.js:439:18)
    at Object.fs.readFileSync (fs.js:290:15)
    at /home/avig/my_app_02/.meteor/local/cordova-build/platforms/android/cordova/lib/build.js:120:40
    at _fulfilled (/home/avig/my_app_02/.meteor/local/cordova-build/platforms/android/cordova/node_modules/q/q.js:798:54)
    at self.promiseDispatch.done (/home/avig/my_app_02/.meteor/local/cordova-build/platforms/android/cordova/node_modules/q/q.js:827:30)
    at Promise.promise.promiseDispatch (/home/avig/my_app_02/.meteor/local/cordova-build/platforms/android/cordova/node_modules/q/q.js:760:13)
    at /home/avig/my_app_02/.meteor/local/cordova-build/platforms/android/cordova/node_modules/q/q.js:574:44
    at flush (/home/avig/my_app_02/.meteor/local/cordova-build/platforms/android/cordova/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:442:13)
Command finished with error code 8: /home/avig/my_app_02/.meteor/local/cordova-build/platforms/android/cordova/run --emulator
ERROR running one or more of the platforms: Error: /home/avig/my_app_02/.meteor/local/cordova-build/platforms/android/cordova/run: Command failed with exit code 8
You may not have the required environment or OS to run this project
=> Started MongoDB.                           
=> Started your app.                          

=> App running at: http://localhost:3000/

What is it looking for in /opt/android-sdk/tools ? I’m using the built-in android SDK !
maybe it’s left from previues install of android-sdk and there is a way to reset it? (meteor reset helps, I reinstalled meteor and still dosn’t work)

Any idea? (running on linux if thats related)


I had the same problem on OSX (at least the same result: emulator running but not the app).
I retried it a couple of times and at the third try the app did appear…


Hi Avi

Yes I had somewhat same problem.

Ubuntu 14.04 - had an Android SDK installed at /usr/local/android-sdk-linux/ and environment variables set for ANDROID_HOME etc in ~/.profile.

After I removed the lines in ~/.profile, and deleted the android-sdk-linux foldfer from /usr/local, and re-installed the android-sdk via meteor, I was able to build for Android.

Hope that helps!