Cordova build failed - android

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.

Related

How do I debug when using ionic emulate android

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:

Phonegap 3.5 custom plugin development : error "cannot find import org.apache.cordova.Plugin"

I am trying to develop a simple echo plugin for Android on PG 3.5. I am getting the above error however. Full trace from a "cordova build" is below. How can I fix this?
Running command: C:\Users\virgil\projects\Installerconnect2\sw\phonegapexperiments\platforms\android\cordova\build.bat
Buildfile: C:\Users\virgil\projects\Installerconnect2\sw\phonegapexperiments\platforms\android\build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.0
[checkenv] Installed at C:\adt-bundle-windows-x86_64-20131030\android-sdk
-setup:
[echo] Project Name: PhoneGapTest
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.0
[echo] Resolving Build Target for PhoneGapTest...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for PhoneGapTest...
[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 C:\adt-bundle-windows-x86_64-20131030\android-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.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: C:\Users\virgil\projects\Installerconnect2\sw\phonegapexperiments\platforms\android\CordovaLib\res
[crunch] To destination dir: C:\Users\virgil\projects\Installerconnect2\sw\phonegapexperiments\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\virgil\projects\Installerconnect2\sw\phonegapexperiments\platforms\android\CordovaLib\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\virgil\projects\Installerconnect2\sw\phonegapexperiments\platforms\android\CordovaLib\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\virgil\projects\Installerconnect2\sw\phonegapexperiments\platforms\android\CordovaLib\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\virgil\projects\Installerconnect2\sw\phonegapexperiments\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\virgil\projects\Installerconnect2\sw\phonegapexperiments\platforms\android\CordovaLib\ant-build\classes.jar
-compile:
[javac] Compiling 4 source files to C:\Users\virgil\projects\Installerconnect2\sw\phonegapexperiments\platforms\android\ant-build\classes
[javac] C:\Users\virgil\projects\Installerconnect2\sw\phonegapexperiments\platforms\android\src\org\apache\cordova\plugin\Echo.java:3: error: cannot find symbol
[javac] import org.apache.cordova.Plugin;
[javac] ^
[javac] symbol: class Plugin
[javac] location: package org.apache.cordova
[javac] C:\Users\virgil\projects\Installerconnect2\sw\phonegapexperiments\platforms\android\src\org\apache\cordova\plugin\Echo.java:12: error: cannot find symbol
[javac] public class Echo extends Plugin {
[javac] ^
[javac] symbol: class Plugin
[javac] 2 errors
You should be importing and extending CordovaPlugin, not Plugin.

ant emma BUILD FAILED

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)

Trying to run Phonegap on Ubuntu 13.04

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

Android + In-App BIlling + Proguard

I have created the app with in-app biling and now I want to obfuscate my code to short the chance to crack it. BUt there is some problems with proguard setup. I am trying to setup it by this tutorial. My project structure is common and the main project has the reference to other project which has IN-app service with all functionality. I have stopped on the last step where is executing ant release with code obfuscating. All the time I receive:
Buildfile: /home/viktor/Desktop/Dropbox/work/MyProject/build.xml
-set-mode-check:
-set-release-mode:
-release-obfuscation-check:
[echo] proguard.config is /home/viktor/android-sdk-linux/tools/proguard/proguard-android.txt:proguard-project.txt
[echo] Proguard.config is enabled
-check-env:
[checkenv] Android SDK Tools Revision 21
[checkenv] Installed at /home/viktor/android-sdk-linux
-setup:
[echo] Project Name: MyProject
[gettype] Project Type: Application
-build-setup:
[echo] Resolving Build Target for MyProject...
[gettarget] Project Target: Google APIs
[gettarget] Vendor: Google Inc.
[gettarget] Platform Version: 4.1.2
[gettarget] API level: 16
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for MyProject...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[echo] ----------
[echo] Building Libraries with 'release'...
nodeps:
-set-mode-check:
-set-release-mode:
-release-obfuscation-check:
[echo] proguard.config is ${proguard.config}
-check-env:
[checkenv] Android SDK Tools Revision 21
[checkenv] Installed at /home/viktor/android-sdk-linux
-setup:
[echo] Project Name: AndroidBillingLibrary
[gettype] Project Type: Android Library
-build-setup:
[echo] Resolving Build Target for AndroidBillingLibrary...
[gettarget] Project Target: Android 4.0.3
[gettarget] API level: 15
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for AndroidBillingLibrary...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
[dependency] API<=15: Adding annotations.jar to the classpath.
-pre-build:
-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
[echo] Handling aidl files...
[aidl] Found 1 AIDL files.
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
[aapt] No changed resources. R.java and Manifest.java untouched.
[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/viktor/Desktop/Dropbox/work/AndroidBillingLibrary/res
[crunch] To destination dir: /home/viktor/Desktop/Dropbox/work/AndroidBillingLibrary/bin/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:
-release-prompt-for-password:
-release-nosign:
[echo]
[propertyfile] Updating property file: /home/viktor/Desktop/Dropbox/work/AndroidBillingLibrary/bin/build.prop
[propertyfile] Updating property file: /home/viktor/Desktop/Dropbox/work/AndroidBillingLibrary/bin/build.prop
[propertyfile] Updating property file: /home/viktor/Desktop/Dropbox/work/AndroidBillingLibrary/bin/build.prop
[propertyfile] Updating property file: /home/viktor/Desktop/Dropbox/work/AndroidBillingLibrary/bin/build.prop
-release-sign:
-post-build:
release:
-pre-build:
-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
[aapt] No changed resources. R.java and Manifest.java untouched.
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
-compile:
-dex-obfuscate:
-dex-no-obfuscate:
BUILD FAILED
/home/viktor/Desktop/Dropbox/work/MyProject/add-proguard-release.xml:14: /home/viktor/Desktop/Dropbox/work/MyProject/${out.classes.dir} does not exist.
The error notifies me that something is not found but what and how to fix it?
ANother thing, when I was on the second step where is ant release of unsigned project without obfuscating I have received succes but with some notification: "It seems that you have subprojects, if so, please use --subprojects command". I try to add this parameter and receive totally succes without nitifications quite long but I cannot update subprojects. I m not sure its very bad or not. Please could you help me to fix this moment too.
The tutorial that you are using is outdated. ProGuard is now part of the Android SDK. You can enable it by commenting in the corresponding line in project.properties, as explained in the documentation of the Android SDK.

Categories

Resources