I created an application using ionic:
ionic start MyFirstApp blank
cd MyFirstApp
ionic serve
ionic platform add android
ionic build android
ionic emulate android
Everything is successful except the emulator step. The emulator boots up, but I get "Unfortunately, MyFirstApp has stopped". Everything brand new straight out of the box, no changes to code.
What next? How do I debug what has gone wrong?
EDIT
This is the output displayed when I call ionic build android:
C:\Users\Colin\Documents\Ionic\MyFirstApp>ionic build android
add to body class: platform-android
Running command: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\cordova\build.bat
Buildfile: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 23.0.2
[checkenv] Installed at C:\Program Files\Eclipse\adt-bundle-windows-x86_64-20140702\sdk
-setup:
[echo] Project Name: MyFirstApp
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 20.0.0
[echo] Resolving Build Target for MyFirstApp...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for MyFirstApp...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
nodeps:
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 23.0.2
[checkenv] Installed at C:\Program Files\Eclipse\adt-bundle-windows-x86_64-20140702\sdk
-setup:
[echo] Project Name: MyFirstApp
[gettype] Project Type: Android Library
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 20.0.0
[echo] Resolving Build Target for MyFirstApp...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for MyFirstApp...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found new input file
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
-compile:
[echo] Creating library output jar file...
-post-compile:
-obfuscate:
-dex:
[echo] Library project: do not convert bytecode...
-crunch:
[crunch] Crunching PNG Files in source dir: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\res
[crunch] To destination dir: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build\res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[echo] Library project: do not package resources...
-package:
[echo] Library project: do not package apk...
-post-package:
-do-debug:
[echo] Library project: do not create apk...
[propertyfile] Updating property file: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build\build.prop
-post-build:
debug:
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found Deleted Target File
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
[echo] Set jars path to: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build\classes.jar
-compile:
[javac] Compiling 2 source files to C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\classes
-post-compile:
-obfuscate:
-dex:
[dex] input: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\classes
[dex] input: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build\classes.jar
[dex] Using Pre-Dexed classes-3a52ec06bbf9dc987d551c9695e3393a.jar <- C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build\classes.jar
[dex] Found Deleted Target File
[dex] Converting compiled files and external libraries into C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\classes.dex...
[dx] Merged dex A (12 defs/8.7KiB) with dex B (209 defs/317.1KiB). Result is 221 defs/396.2KiB. Took 0.2s
-crunch:
[crunch] Crunching PNG Files in source dir: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\res
[crunch] To destination dir: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[aapt] Found Deleted Target File
[aapt] Creating full resource package...
-package:
[apkbuilder] Found Deleted Target File
[apkbuilder] Creating MyFirstApp-debug-unaligned.apk and signing it with a debug key...
-post-package:
-do-debug:
[zipalign] Running zip align on final apk...
[echo] Debug Package: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\MyFirstApp-debug.apk
[propertyfile] Updating property file: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\build.prop
-post-build:
[move] Moving 1 file to C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build
[move] Moving 1 file to C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build
debug:
BUILD SUCCESSFUL
Total time: 4 seconds
Using apk: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\MyFirstApp-debug-unaligned.apk
EDIT 2 This is the output from android list avd
Available Android Virtual Devices:
Name: Nexus7
Device: Nexus 7 (Google)
Path: C:\Users\Colin\.android\avd\Nexus7.avd
Target: Android 4.4W (API level 20)
Tag/ABI: android-wear/armeabi-v7a
Skin: WVGA800
A much easier/better solution in my opinion is to use the chrome://inspect tool on chrome.
Launch the app on your Android using
ionic run android
Open Chrome and go to: chrome://inspect - this will list your connected devices.
Inspect the app using chrome dev tools as if you were inspecting any other web page.
Please make sure you created the right avd configuration for the emulator.
type android list avd and see the output. What is the first avd listed there ? If it shows older API level (for eg: 7)
API level 9 and higher is required, API level 15 and high preferred. You cannot use API 20 Android Wear AVD, as it is only for testing wear devices.
You can delete the existing avd with android delete avd -n Name (replace Name with yours).
create one with android create avd --name test15 --target android-15 --abi x86
make sure android list avd shows your avd is the first listed.
I followed the same steps, i use windows, my ionic build android output is similar to yours; I was able to get ionic emulate android working with API-15, please see below:
Related
I am very new to Cordova and tried to a sample application by following this guide:
http://cordova.apache.org/docs/en/3.5.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide
Unfortunately, I get the following error in the command-line:
Running command: G:\CordovaTest\hello\platforms\android\cordova\build.bat
Buildfile: G:\CordovaTest\hello\platforms\android\build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 23.0.2
[checkenv] Installed at D:\adt-bundle-windows-x86_64-20140702\sdk
-setup:
[echo] Project Name: HelloWorld
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 20.0.0
[echo] Resolving Build Target for HelloWorld...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: G:\CordovaTest\hello\platforms\android\ant-build\rsObj
[mkdir] Created dir: G:\CordovaTest\hello\platforms\android\ant-build\rsLibs
[echo] ----------
[echo] Resolving Dependencies for HelloWorld...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
nodeps:
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 23.0.2
[checkenv] Installed at D:\adt-bundle-windows-x86_64-20140702\sdk
-setup:
[echo] Project Name: CordovaLib
[gettype] Project Type: Android Library
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 20.0.0
[echo] Resolving Build Target for CordovaLib...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for CordovaLib...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found new input file
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
-compile:
[echo] Creating library output jar file...
-post-compile:
-obfuscate:
-dex:
[echo] Library project: do not convert bytecode...
-crunch:
[crunch] Crunching PNG Files in source dir: G:\CordovaTest\hello\platforms\android\CordovaLib\res
[crunch] To destination dir: G:\CordovaTest\hello\platforms\android\CordovaLib\ant-build\res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[echo] Library project: do not package resources...
-package:
[echo] Library project: do not package apk...
-post-package:
-do-debug:
[echo] Library project: do not create apk...
[propertyfile] Updating property file: G:\CordovaTest\hello\platforms\android\CordovaLib\ant-build\build.prop
[propertyfile] Updating property file: G:\CordovaTest\hello\platforms\android\CordovaLib\ant-build\build.prop
[propertyfile] Updating property file: G:\CordovaTest\hello\platforms\android\CordovaLib\ant-build\build.prop
[propertyfile] Updating property file: G:\CordovaTest\hello\platforms\android\CordovaLib\ant-build\build.prop
-post-build:
debug:
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found Deleted Target File
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.
-pre-compile:
[echo] Set jars path to: G:\CordovaTest\hello\platforms\android\CordovaLib\ant-build\classes.jar
-compile:
[javac] Compiling 3 source files to G:\CordovaTest\hello\platforms\android\ant-build\classes
-post-compile:
-obfuscate:
-dex:
[dex] input: G:\CordovaTest\hello\platforms\android\ant-build\classes
[dex] input: G:\CordovaTest\hello\platforms\android\CordovaLib\ant-build\classes.jar
[dex] Pre-Dexing G:\CordovaTest\hello\platforms\android\CordovaLib\ant-build\classes.jar -> classes-c7d3e986ff339bb9d7b4b67df549a8b8.jar
[dx]
[dx] trouble writing output: java.security.NoSuchAlgorithmException: SHA-1 MessageDigest not available
BUILD FAILED
D:\adt-bundle-windows-x86_64-20140702\sdk\tools\ant\build.xml:892: The following error occurred whil
e executing this line:
D:\adt-bundle-windows-x86_64-20140702\sdk\tools\ant\build.xml:894: The following error occurred whil
e executing this line:
D:\adt-bundle-windows-x86_64-20140702\sdk\tools\ant\build.xml:906: The following error occurred whil
e executing this line:
D:\adt-bundle-windows-x86_64-20140702\sdk\tools\ant\build.xml:283: null returned: 2
Total time: 10 seconds
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,G:\CordovaTest\hello\platforms\android\b
uild.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Command finished with error code 2: G:\CordovaTest\hello\platforms\android\cordova\build.bat
Error: G:\CordovaTest\hello\platforms\android\cordova\build.bat: Command failed with exit code 2
at ChildProcess.whenDone (C:\Users\IBM_ADMIN\AppData\Roaming\npm\node_modules\cordova\node_modul
es\cordova-lib\src\cordova\superspawn.js:135:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
I use windows7 64bit. My env variables are as bellow!
D:\SDK7_64\bin;D:\SDK7_64\jre\bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows
\System32\WindowsPowerShell\v1.0\;C:\Program Files\IBM\Infoprint Select;C:\Program Files\ThinkPad\Bl
uetooth Software\;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;C:\Program Files\Intel\WiFi\
bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Lenovo\Access Connec
tions\;C:\Program Files (x86)\IBM\Personal Communications\;C:\Program Files (x86)\IBM\Trace Facility
\;D:\Program Files\IDM Computer Solutions\UltraEdit-32;D:\Program Files\nodejs\;D:\Program Files\Clo
udFoundry;D:\Program Files\cURL\bin;D:\jq;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common F
iles\Intel\WirelessCommon\;D:\Program Files\SSH Communications Security\SSH Secure Shell;C:\Users\IB
M_ADMIN\AppData\Roaming\npm;D:\apache-ant-1.9.4\bin;D:\AndroidSDK\sdk\platform-tools;D:\AndroidSDK\s
dk\tools
Can anyone help me on this ? Thank you very much!
Do you have ever read the build output you copied into your question?
It contains near the end where error messages are usually output:
[dx] trouble writing output: java.security.NoSuchAlgorithmException: SHA-1 MessageDigest not available
BUILD FAILED
This is the error message to investigate for the reason of the failed build.
Next I run a search with "SHA-1 MessageDigest not available" and found on Stack Overflow:
Compute SHA-1 of byte array
SHA-1 MessageDigest not available
java.security.NoSuchAlgorithmException while building a simple android app using Android Studio
And more webpages containing this error message string can be found with using a WWW search engine.
This error message can have several different reasons as I know now after reading the answers and some other webpages. You have to find out by yourself which one of those reasons is responsible for the error message on your build.
I've installed Android SDK + Ant + cordova (3.4.1) + set PATH variables (android, ant, cordova commands are available)
At the end of the cordova CLI, there's this exemple usage:
Example usage
$ cordova create Baz
$ cd Baz
$ cordova platform add android
$ cordova build
$ cordova serve android
-----------------------------------
So I tried just that exemple:
sebastien#sebastien-xps:Desktop$ cordova create Baz
Creating a new cordova project with name "HelloCordova" and id "io.cordova.hellocordova" at location "/home/sebastien/Desktop/Baz"
sebastien#sebastien-xps:Desktop$ cd Baz
sebastien#sebastien-xps:Baz$ cordova platform add android
Creating android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: io.cordova.hellocordova
Name: HelloCordova
Android target: android-19
Copying template files...
Running: android update project --subprojects --path "platforms/android" --target android-19 --library "CordovaLib"
Resolved location of library project to: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib
Updated and renamed default.properties to project.properties
Updated local.properties
No project name specified, using Activity name 'HelloCordova'.
If you wish to change it, edit the first line of build.xml.
Added file platforms/android/build.xml
Added file platforms/android/proguard-project.txt
Updated project.properties
Updated local.properties
No project name specified, using project folder name 'CordovaLib'.
If you wish to change it, edit the first line of build.xml.
Added file platforms/android/CordovaLib/build.xml
Added file platforms/android/CordovaLib/proguard-project.txt
Project successfully created.
sebastien#sebastien-xps:Baz$ cordova build
Running command: /home/sebastien/Desktop/Baz/platforms/android/cordova/build
Buildfile: /home/sebastien/Desktop/Baz/platforms/android/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.2
[checkenv] Installed at /home/sebastien/Desktop/devhome/install/adt-bundle-linux-x86_64-20140321/sdk
-setup:
[echo] Project Name: HelloCordova
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for HelloCordova...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /home/sebastien/Desktop/Baz/platforms/android/ant-build
[mkdir] Created dir: /home/sebastien/Desktop/Baz/platforms/android/ant-build/res
[mkdir] Created dir: /home/sebastien/Desktop/Baz/platforms/android/ant-build/rsObj
[mkdir] Created dir: /home/sebastien/Desktop/Baz/platforms/android/ant-build/rsLibs
[mkdir] Created dir: /home/sebastien/Desktop/Baz/platforms/android/ant-gen
[mkdir] Created dir: /home/sebastien/Desktop/Baz/platforms/android/ant-build/classes
[mkdir] Created dir: /home/sebastien/Desktop/Baz/platforms/android/ant-build/dexedLibs
[echo] ----------
[echo] Resolving Dependencies for HelloCordova...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
nodeps:
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.2
[checkenv] Installed at /home/sebastien/Desktop/devhome/install/adt-bundle-linux-x86_64-20140321/sdk
-setup:
[echo] Project Name: CordovaLib
[gettype] Project Type: Android Library
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for CordovaLib...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/res
[mkdir] Created dir: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/libs
[mkdir] Created dir: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-build
[mkdir] Created dir: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-build/res
[mkdir] Created dir: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-build/rsObj
[mkdir] Created dir: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-build/rsLibs
[mkdir] Created dir: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-gen
[mkdir] Created dir: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-build/classes
[mkdir] Created dir: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-build/dexedLibs
[echo] ----------
[echo] Resolving Dependencies for CordovaLib...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.
-pre-compile:
-compile:
[javac] Compiling 89 source files to /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-build/classes
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[echo] Creating library output jar file...
[jar] Building jar: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-build/classes.jar
-post-compile:
-obfuscate:
-dex:
[echo] Library project: do not convert bytecode...
-crunch:
[crunch] Crunching PNG Files in source dir: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/res
[crunch] To destination dir: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-build/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[echo] Library project: do not package resources...
-package:
[echo] Library project: do not package apk...
-post-package:
-do-debug:
[echo] Library project: do not create apk...
[propertyfile] Creating new property file: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-build/build.prop
-post-build:
debug:
-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.
-pre-compile:
[echo] Set jars path to: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-build/classes.jar
-compile:
[javac] Compiling 3 source files to /home/sebastien/Desktop/Baz/platforms/android/ant-build/classes
-post-compile:
-obfuscate:
-dex:
[dex] input: /home/sebastien/Desktop/Baz/platforms/android/ant-build/classes
[dex] input: /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-build/classes.jar
[dex] Pre-Dexing /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-build/classes.jar -> classes-f44eaf7d8904b207eb36100ec05db9be.jar
[dex] Converting compiled files and external libraries into /home/sebastien/Desktop/Baz/platforms/android/ant-build/classes.dex...
[dx] Merged dex A (7 defs/2.2KiB) with dex B (205 defs/312.8KiB). Result is 212 defs/383.8KiB. Took 0.3s
-crunch:
[crunch] Crunching PNG Files in source dir: /home/sebastien/Desktop/Baz/platforms/android/res
[crunch] To destination dir: /home/sebastien/Desktop/Baz/platforms/android/ant-build/res
[crunch] Processing image to cache: /home/sebastien/Desktop/Baz/platforms/android/res/drawable-hdpi/icon.png => /home/sebastien/Desktop/Baz/platforms/android/ant-build/res/drawable-hdpi/icon.png
[crunch] (processed image to cache entry /home/sebastien/Desktop/Baz/platforms/android/ant-build/res/drawable-hdpi/icon.png: 67% size of source)
[crunch] Processing image to cache: /home/sebastien/Desktop/Baz/platforms/android/res/drawable-ldpi/icon.png => /home/sebastien/Desktop/Baz/platforms/android/ant-build/res/drawable-ldpi/icon.png
[crunch] (processed image to cache entry /home/sebastien/Desktop/Baz/platforms/android/ant-build/res/drawable-ldpi/icon.png: 0% size of source)
[crunch] Processing image to cache: /home/sebastien/Desktop/Baz/platforms/android/res/drawable-mdpi/icon.png => /home/sebastien/Desktop/Baz/platforms/android/ant-build/res/drawable-mdpi/icon.png
[crunch] (processed image to cache entry /home/sebastien/Desktop/Baz/platforms/android/ant-build/res/drawable-mdpi/icon.png: 0% size of source)
[crunch] Processing image to cache: /home/sebastien/Desktop/Baz/platforms/android/res/drawable-xhdpi/icon.png => /home/sebastien/Desktop/Baz/platforms/android/ant-build/res/drawable-xhdpi/icon.png
[crunch] (processed image to cache entry /home/sebastien/Desktop/Baz/platforms/android/ant-build/res/drawable-xhdpi/icon.png: 53% size of source)
[crunch] Processing image to cache: /home/sebastien/Desktop/Baz/platforms/android/res/drawable/icon.png => /home/sebastien/Desktop/Baz/platforms/android/ant-build/res/drawable/icon.png
[crunch] (processed image to cache entry /home/sebastien/Desktop/Baz/platforms/android/ant-build/res/drawable/icon.png: 53% size of source)
[crunch] Crunched 5 PNG files to update cache
-package-resources:
[aapt] Creating full resource package...
-package:
[apkbuilder] Current build type is different than previous build: forced apkbuilder run.
[apkbuilder] Creating HelloCordova-debug-unaligned.apk and signing it with a debug key...
-post-package:
-do-debug:
[zipalign] Running zip align on final apk...
[echo] Debug Package: /home/sebastien/Desktop/Baz/platforms/android/ant-build/HelloCordova-debug.apk
[propertyfile] Creating new property file: /home/sebastien/Desktop/Baz/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/sebastien/Desktop/Baz/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/sebastien/Desktop/Baz/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/sebastien/Desktop/Baz/platforms/android/ant-build/build.prop
-post-build:
[move] Moving 1 file to /home/sebastien/Desktop/Baz/platforms/android/ant-build
[move] Moving 1 file to /home/sebastien/Desktop/Baz/platforms/android/CordovaLib/ant-build
debug:
BUILD SUCCESSFUL
Total time: 18 seconds
sebastien#sebastien-xps:Baz$ cordova serve android
Static file server running on port 8000 (i.e. http://localhost:8000)
CTRL + C to shut down
302 /android/
200 /android/www/
200 /android/www/css/index.css
200 /android/www/cordova.js
200 /android/www/js/index.js
200 /android/www/img/logo.png
This seems to work fine at first glance.
I can open http://localhost:8000 and it displays something:
Package Metadata
name HelloCordova
packageName io.cordova.hellocordova
version 0.0.1
Platforms
ios
android
ubuntu
amazon-fireos
wp7
wp8
blackberry10
www
firefoxos
windows8
Plugins
I can click on the Android link, the problem is when I do so, a strange dialog box appears with question = [], asking me to confirm or cancel the following text prefilled text:
gap:["PluginManager","startup","PluginManager1413322690"]
After accepting, I can see the background Cordova, connecting to device but nothing happens except something that looks like an infinite loop that I can see in the console:
The key "target-densitydpi" is not supported. localhost/:25
Falling back on PROMPT mode since _cordovaNative is missing. Expected for Android 3.2 and lower only. cordova.js:966
698173
processMessage failed: invalid message:
The number 698173 is growing
Can someone tell me what is this strange behavior?
I know it is an old thread, but I had the same issue today and don't really want to install an emulator
you need to add the browser platform to you app
cordova platform add browser
and point your browser to http://localhost:8000/browser/www/
When you're initially prompted with the javascript dialog boxes (e.g. gap: ["PluginManager",...]) you can press Cancel to get the app to load correctly.
After discussions on IRC with a Cordova developer, the serve command is somehow not well documented and it is mostly useful to serve content to the Phonegap App Developer mobile app that was released recently, and as far as I understand it now, it is now intented to serve the application for a regular desktop browser.
For desktop browser testing, I have been succesful until now with the Ripple emulator (not the Chrome plugin which seems unmaintened, but the NPM package).
For exemple you can test in the browser phonegap apps with:
npm install -g ripple-emulator
ripple emulate
This may help you: https://github.com/stample/gulp-browserify-react-phonegap-starter
I try to run android unit test with code coverage. I'm using the Android example NotePad.
These are the commands I used:
cd <main project folder>
android update project --path .
android update test-project -m <full path to main project> -p <full path to main project>\tests
cd ./tests
ant emma debug install test
the tests runs successfully. But in the end emma can't generate the report html File.
Here you get the commandline output of ant emma debug install test
Buildfile: C:\Users\Benedikt\workspace_android\NotePad\tests\build.xml
emma:
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.2
[checkenv] Installed at C:\Android\android-sdk
-setup:
[echo] Project Name: NotesListTest
[gettype] Project Type: Test Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for NotesListTest...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for NotesListTest...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
[subant] No sub-builds to iterate on
[echo] ----------
[echo] Building tested project at C:\Users\Benedikt\workspace_android\NotePad with 'instrument'...
-set-mode-check:
-set-instrumented-mode:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.2
[checkenv] Installed at C:\Android\android-sdk
-setup:
[echo] Project Name: NotesList
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for NotesList...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for NotesList...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'instrument'...
[subant] No sub-builds to iterate on
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found Deleted Target File
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
-compile:
[javac] Compiling 1 source file to C:\Users\Benedikt\workspace_android\NotePad\bin\classes
[echo] Instrumenting classes from C:\Users\Benedikt\workspace_android\NotePad\bin/classes...
-post-compile:
-obfuscate:
-dex:
[dex] input: C:\Users\Benedikt\workspace_android\NotePad\bin\classes
[dex] input: C:\Android\android-sdk\tools\lib\emma_device.jar
[dex] Using Pre-Dexed emma_device-e05f8994020e22cd9d939f07950bd18a.jar <- C:\Android\android-sdk\tools\lib\emma_device.jar
[dex] Found Deleted Target File
[dex] Converting compiled files and external libraries into C:\Users\Benedikt\workspace_android\NotePad\bin\classes.dex...
[dx] Merged dex A (17 defs/29,2KiB) with dex B (297 defs/326,8KiB). Result is 314 defs/427,2KiB. Took 0,2s
-crunch:
[crunch] Crunching PNG Files in source dir: C:\Users\Benedikt\workspace_android\NotePad\res
[crunch] To destination dir: C:\Users\Benedikt\workspace_android\NotePad\bin\res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[aapt] Found Deleted Target File
[aapt] Creating full resource package...
-package:
[apkbuilder] Found Deleted Target File
[apkbuilder] Creating NotesList-instrumented-unaligned.apk and signing it with a debug key...
-post-package:
-do-debug:
[zipalign] Running zip align on final apk...
[echo] Debug Package: C:\Users\Benedikt\workspace_android\NotePad\bin\NotesList-instrumented.apk
[propertyfile] Updating property file: C:\Users\Benedikt\workspace_android\NotePad\bin\build.prop
[propertyfile] Updating property file: C:\Users\Benedikt\workspace_android\NotePad\bin\build.prop
[propertyfile] Updating property file: C:\Users\Benedikt\workspace_android\NotePad\bin\build.prop
[propertyfile] Updating property file: C:\Users\Benedikt\workspace_android\NotePad\bin\build.prop
instrument:
[zipalign] Run cancelled: no changes to input file C:\Users\Benedikt\workspace_android\NotePad\bin\NotesList-instrumented-unaligned.apk
[echo] Instrumented Package: C:\Users\Benedikt\workspace_android\NotePad\bin\NotesList-instrumented.apk
[propertyfile] Updating property file: C:\Users\Benedikt\workspace_android\NotePad\bin\build.prop
[propertyfile] Updating property file: C:\Users\Benedikt\workspace_android\NotePad\bin\build.prop
[propertyfile] Updating property file: C:\Users\Benedikt\workspace_android\NotePad\bin\build.prop
[propertyfile] Updating property file: C:\Users\Benedikt\workspace_android\NotePad\bin\build.prop
[testedprojectclasspath] Resolved classpath:
[testedprojectclasspath] C:\Users\Benedikt\workspace_android\NotePad\bin\classes
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found new input file
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
-compile:
-post-compile:
-obfuscate:
-dex:
[dex] input: C:\Users\Benedikt\workspace_android\NotePad\tests\bin\classes
[dex] Found Deleted Target File
[dex] Converting compiled files and external libraries into C:\Users\Benedikt\workspace_android\NotePad\tests\bin\classes.dex...
-crunch:
[crunch] Crunching PNG Files in source dir: C:\Users\Benedikt\workspace_android\NotePad\tests\res
[crunch] To destination dir: C:\Users\Benedikt\workspace_android\NotePad\tests\bin\res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[aapt] Found Deleted Target File
[aapt] Creating full resource package...
-package:
[apkbuilder] Found Deleted Target File
[apkbuilder] Creating NotesListTest-debug-unaligned.apk and signing it with a debug key...
-post-package:
-do-debug:
[zipalign] Running zip align on final apk...
[echo] Debug Package: C:\Users\Benedikt\workspace_android\NotePad\tests\bin\NotesListTest-debug.apk
[propertyfile] Updating property file: C:\Users\Benedikt\workspace_android\NotePad\tests\bin\build.prop
[propertyfile] Updating property file: C:\Users\Benedikt\workspace_android\NotePad\tests\bin\build.prop
[propertyfile] Updating property file: C:\Users\Benedikt\workspace_android\NotePad\tests\bin\build.prop
[propertyfile] Updating property file: C:\Users\Benedikt\workspace_android\NotePad\tests\bin\build.prop
-post-build:
debug:
install:
[echo] Installing C:\Users\Benedikt\workspace_android\NotePad\tests\bin\NotesListTest-debug.apk onto default emulator or device...
[exec] pkg: /data/local/tmp/NotesListTest-debug.apk
[exec] Success
[exec] 494 KB/s (8101 bytes in 0.016s)
-set-mode-check:
-set-instrumented-mode:
install:
[echo] Installing C:\Users\Benedikt\workspace_android\NotePad\bin\NotesList-instrumented.apk onto default emulator or device...
[exec] pkg: /data/local/tmp/NotesList-instrumented.apk
[exec] Success
[exec] 629 KB/s (211536 bytes in 0.328s)
installi:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.2
[checkenv] Installed at C:\Android\android-sdk
-setup:
[echo] Project Name: NotesListTest
[gettype] Project Type: Test Application
-test-project-check:
test:
[getlibpath] Library dependencies:
[getlibpath] No Libraries
[echo] Running tests...
[echo] Running tests ...
[exec]
[exec] com.example.android.notepad.NotePadActivityTest:.
[exec] com.example.android.notepad.NotePadProviderTest:..........
[exec] Test results for InstrumentationTestRunner=...........
[exec] Time: 2.338
[exec]
[exec] OK (11 tests)
[exec]
[exec]
[exec] Generated code coverage data to /data/data/com.example.android.notepad/coverage.ec
[echo] Setting permission to download the coverage file...
[exec] run-as: Package 'com.example.android.notepad' is unknown
[echo] Downloading coverage file into project directory...
[exec] failed to copy '/data/data/com.example.android.notepad/coverage.ec' to 'C:\Users\Benedikt\workspace_android\NotePad\tests\bin\coverage.ec': Permission denied
[echo] Extracting coverage report...
BUILD FAILED
C:\Android\android-sdk\tools\ant\build.xml:1313: [EMMA v2.0.5312] report: no valid input data files have been specified
Total time...
I would like to post the C:\Android\android-sdk\tools\ant\build.xml but the file is to long. But i guess it is always the same...
Any ideas?
The command ant emma debug install test is only successfull on a rooted device or on an emulator (otherwise permission denied).
Useful hints:
If you're using SDK 13 or older you've to use ant coverage instead of ant emma debug install test
One of the last output lines show you where the report file has been saved
If you use Windows you have to add the Path of the android.bat (normally /tools) and the path of the ant.bat (depending where you installed Ant; If you use Eclipse with ADT it is normally there: /plugins/org.apache.ant.../bin) to the PATH Variable (you may also have to do this with a diffrent OS)
With the basic setup done, when i run rake install start, i just get the build successful message and nothing beyond that. Nothing gets powered up in the emulator which is running on the side for me. I am just starting to write android apps using ruby and this is just a getting started app generated using ruboto gen app.
Here is what i get on running rake install start :
Sid:quick_start SID$ rake install start
/Users/SID/Documents/workspace/android_test/quick_start/src/quick_start_activity.rb changed.
Forcing rebuild of /Users/SID/Documents/workspace/android_test/quick_start/bin/QuickStart-debug.apk.
ant debug
Buildfile: /Users/SID/Documents/workspace/android_test/quick_start/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.2
[checkenv] Installed at /Users/SID/android-sdk-macosx
-setup:
[echo] Project Name: QuickStart
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for QuickStart...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /Users/SID/Documents/workspace/android_test/quick_start/bin/rsObj
[mkdir] Created dir: /Users/SID/Documents/workspace/android_test/quick_start/bin/rsLibs
[echo] ----------
[echo] Resolving Dependencies for QuickStart...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
[subant] No sub-builds to iterate on
-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found new input file
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
-compile:
[javac] Compiling 1 source file to /Users/SID/Documents/workspace/android_test/quick_start/bin/classes
-post-compile:
-obfuscate:
-dex:
[dex] input: /Users/SID/Documents/workspace/android_test/quick_start/bin/classes
[dex] Found modified input file
[dex] Converting compiled files and external libraries into /Users/SID/Documents/workspace/android_test/quick_start/bin/classes.dex...
-crunch:
[crunch] Crunching PNG Files in source dir: /Users/SID/Documents/workspace/android_test/quick_start/res
[crunch] To destination dir: /Users/SID/Documents/workspace/android_test/quick_start/bin/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[aapt] No changed resources or assets. QuickStart.ap_ remains untouched
-package:
[apkbuilder] Found modified input file
[apkbuilder] Creating QuickStart-debug-unaligned.apk and signing it with a debug key...
-post-package:
-do-debug:
[zipalign] Running zip align on final apk...
[echo] Debug Package: /Users/SID/Documents/workspace/android_test/quick_start/bin/QuickStart-debug.apk
[propertyfile] Updating property file: /Users/SID/Documents/workspace/android_test/quick_start/bin/build.prop
[propertyfile] Updating property file: /Users/SID/Documents/workspace/android_test/quick_start/bin/build.prop
[propertyfile] Updating property file: /Users/SID/Documents/workspace/android_test/quick_start/bin/build.prop
[propertyfile] Updating property file: /Users/SID/Documents/workspace/android_test/quick_start/bin/build.prop
-post-build:
debug:
BUILD SUCCESSFUL
Total time: 7 seconds
And here are the modifications i made in the dx file:
# By default, give dx a max heap size of 1 gig. This can be overridden
# by using a "-J" option (see below).
defaultMx="-Xmx2048M"
defaultMx="-Xmx1024M"
Here is my avd which i setup :
Sid:quick_start SID$ android list avd
Available Android Virtual Devices:
Name: Android_4.4
Path: /Users/SID/.android/avd/Android_4.4.avd
Target: Android 4.4.2 (API level 19)
Tag/ABI: default/x86
Skin: WVGA800
Sdcard: 1000M
Please let me know if i am doing anything wrong.
Ideally,
rake install start should take me beyond build successful to something like this for instance and the app should be powered up on the emulator :
adb shell date -s 20131120.102437
Wed Nov 20 10:24:37 EST 2013
Installing package org.ruboto.example.quick_start
pkg: /data/local/tmp/QuickStart-debug.apk
Success
526 KB/s (74474 bytes in 0.138s)
This is a bug in Ruboto 1.0.3 and older, and only happens when deploying to Android 4.4 kitkat.
The bug has been fixed here: https://github.com/ruboto/ruboto/issues/585
You can apply the same change in your project to work around this bug.
I have everything ready to run Phonegap but I'm getting a error. Maybe someone know how to solve it.
Here is the error:
I get this error after typing phonegap run android
[apkbuilder] Creating HelloWorld-debug-unaligned.apk and signing it with a debug key...
-post-package:
-do-debug:
[zipalign] Running zip align on final apk...
[echo] Debug Package: /home/almeidamarcell/my-app/platforms/android/ant-build/HelloWorld-debug.apk
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
-post-build:
[move] Moving 1 file to /home/almeidamarcell/my-app/platforms/android/ant-build
[move] Moving 1 file to /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build
debug:
BUILD SUCCESSFUL
Total time: 6 seconds
[phonegap] successfully compiled Android app
[phonegap] trying to install app onto device
{ [ReferenceError: a is not defined]
stack: 'ReferenceError: a is not defined\n at Object.ConfigParser.getPreference (/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/ConfigParser.js:88:23)\n at Object.module.exports.findOrientationPreference (/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/metadata/android_parser.js:52:26)\n at Object.module.exports.update_from_config (/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/metadata/android_parser.js:84:36)\n at Object.module.exports.update_project (/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/metadata/android_parser.js:167:18)\n at /usr/local/lib/node_modules/phonegap/node_modules/cordova/src/prepare.js:113:31\n at _fulfilled (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:798:54)\n at self.promiseDispatch.done (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:827:30)\n at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:760:13)\n at /usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:821:14\n at flush (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:108:17)' }
Buildfile: /home/almeidamarcell/my-app/platforms/android/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.0
[checkenv] Installed at /opt/android-sdk-linux
-setup:
[echo] Project Name: HelloWorld
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for HelloWorld...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for HelloWorld...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
nodeps:
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.0
[checkenv] Installed at /opt/android-sdk-linux
-setup:
[echo] Project Name: CordovaLib
[gettype] Project Type: Android Library
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for CordovaLib...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for CordovaLib...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found modified input file
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
-compile:
[echo] Creating library output jar file...
-post-compile:
-obfuscate:
-dex:
[echo] Library project: do not convert bytecode...
-crunch:
[crunch] Crunching PNG Files in source dir: /home/almeidamarcell/my-app/platforms/android/CordovaLib/res
[crunch] To destination dir: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[echo] Library project: do not package resources...
-package:
[echo] Library project: do not package apk...
-post-package:
-do-debug:
[echo] Library project: do not create apk...
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/build.prop
-post-build:
debug:
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found modified input file
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
[echo] Set jars path to: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/classes.jar
-compile:
[javac] Compiling 1 source file to /home/almeidamarcell/my-app/platforms/android/ant-build/classes
-post-compile:
-obfuscate:
-dex:
[dex] input: /home/almeidamarcell/my-app/platforms/android/ant-build/classes
[dex] input: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/classes.jar
[dex] Using Pre-Dexed classes-a82c7d07d612c222e41d4b5fb4fa6480.jar <- /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/classes.jar
[dex] Found modified input file
[dex] Converting compiled files and external libraries into /home/almeidamarcell/my-app/platforms/android/ant-build/classes.dex...
[dx] Merged dex A (7 defs/2.2KiB) with dex B (205 defs/312.8KiB). Result is 212 defs/383.8KiB. Took 0.3s
-crunch:
[crunch] Crunching PNG Files in source dir: /home/almeidamarcell/my-app/platforms/android/res
[crunch] To destination dir: /home/almeidamarcell/my-app/platforms/android/ant-build/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[aapt] Found modified input file
[aapt] Creating full resource package...
-package:
[apkbuilder] Found modified input file
[apkbuilder] Creating HelloWorld-debug-unaligned.apk and signing it with a debug key...
-post-package:
-do-debug:
[zipalign] Running zip align on final apk...
[echo] Debug Package: /home/almeidamarcell/my-app/platforms/android/ant-build/HelloWorld-debug.apk
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
-post-build:
[move] Moving 1 file to /home/almeidamarcell/my-app/platforms/android/ant-build
[move] Moving 1 file to /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build
debug:
BUILD SUCCESSFUL
Total time: 6 seconds
WARNING : No started emulators found, starting an emulator.
/home/almeidamarcell/my-app/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.
[phonegap] no device was found
[phonegap] trying to install app onto emulator
{ [ReferenceError: a is not defined]
stack: 'ReferenceError: a is not defined\n at Object.ConfigParser.getPreference (/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/ConfigParser.js:88:23)\n at Object.module.exports.findOrientationPreference (/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/metadata/android_parser.js:52:26)\n at Object.module.exports.update_from_config (/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/metadata/android_parser.js:84:36)\n at Object.module.exports.update_project (/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/metadata/android_parser.js:167:18)\n at /usr/local/lib/node_modules/phonegap/node_modules/cordova/src/prepare.js:113:31\n at _fulfilled (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:798:54)\n at self.promiseDispatch.done (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:827:30)\n at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:760:13)\n at /usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:821:14\n at flush (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:108:17)' }
Buildfile: /home/almeidamarcell/my-app/platforms/android/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.0
[checkenv] Installed at /opt/android-sdk-linux
-setup:
[echo] Project Name: HelloWorld
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for HelloWorld...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for HelloWorld...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
nodeps:
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.0
[checkenv] Installed at /opt/android-sdk-linux
-setup:
[echo] Project Name: CordovaLib
[gettype] Project Type: Android Library
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for CordovaLib...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for CordovaLib...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found modified input file
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
-compile:
[echo] Creating library output jar file...
-post-compile:
-obfuscate:
-dex:
[echo] Library project: do not convert bytecode...
-crunch:
[crunch] Crunching PNG Files in source dir: /home/almeidamarcell/my-app/platforms/android/CordovaLib/res
[crunch] To destination dir: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[echo] Library project: do not package resources...
-package:
[echo] Library project: do not package apk...
-post-package:
-do-debug:
[echo] Library project: do not create apk...
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/build.prop
-post-build:
debug:
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found modified input file
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
[echo] Set jars path to: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/classes.jar
-compile:
[javac] Compiling 1 source file to /home/almeidamarcell/my-app/platforms/android/ant-build/classes
-post-compile:
-obfuscate:
-dex:
[dex] input: /home/almeidamarcell/my-app/platforms/android/ant-build/classes
[dex] input: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/classes.jar
[dex] Using Pre-Dexed classes-a82c7d07d612c222e41d4b5fb4fa6480.jar <- /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/classes.jar
[dex] Found modified input file
[dex] Converting compiled files and external libraries into /home/almeidamarcell/my-app/platforms/android/ant-build/classes.dex...
[dx] Merged dex A (7 defs/2.2KiB) with dex B (205 defs/312.8KiB). Result is 212 defs/383.8KiB. Took 0.3s
-crunch:
[crunch] Crunching PNG Files in source dir: /home/almeidamarcell/my-app/platforms/android/res
[crunch] To destination dir: /home/almeidamarcell/my-app/platforms/android/ant-build/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[aapt] Found modified input file
[aapt] Creating full resource package...
-package:
[apkbuilder] Found modified input file
[apkbuilder] Creating HelloWorld-debug-unaligned.apk and signing it with a debug key...
-post-package:
-do-debug:
[zipalign] Running zip align on final apk...
[echo] Debug Package: /home/almeidamarcell/my-app/platforms/android/ant-build/HelloWorld-debug.apk
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
-post-build:
[move] Moving 1 file to /home/almeidamarcell/my-app/platforms/android/ant-build
[move] Moving 1 file to /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build
debug:
BUILD SUCCESSFUL
Total time: 6 seconds
/home/almeidamarcell/my-app/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.
[error] /home/almeidamarcell/my-app/platforms/android/cordova/run: Command failed with exit code 1
almeidamarcell#ubuntu:~/my-app$
Nodejs -v: v0.10.26
Node -v: v0.11.12-pre
npm -v: 1.4.3
phonegap -v: 3.4.0-0.19.7
cordova -v: 3.4.0-0.1.0
ant -v: Apache Ant(TM) version 1.9.2 compiled on July 14 2013
Trying the default build file: build.xml
Buildfile: build.xml does not exist! Build failed
Ubuntu 13.04
I also have Java and Android SDK installed.
You can run "android" on the command line and use the GUI to select "Manage AVDs...". Create an AVD from there and you're good to go.
IMPORTANT: AVDs are only visible to the user who created it, I have to run "sudo phonegap" and tried creating an avd without sudo and it wasn't visible to phonegap. So I had to "sudo android" and create it again.
http://developer.android.com/tools/devices/index.html
Error says:
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
You need to create a virtual device first