Phonegap run android gives error - android

I am trying to run the basic hello-world app. I am totally frustrated can't find solution to this. What is wrong? I have tried these solutions but still no luck. Please help me :'(
C:\apps>phonegap create app3
[phonegap] create called with the options C:\apps\app3 com.phonegap.helloworld HelloWorld
[phonegap] Customizing default config.xml file
[phonegap] created project at C:\apps\app3
C:\apps>cd app3
C:\apps\app3>phonegap local run android
[phonegap] adding the Android platform...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: com.phonegap.helloworld
Name: HelloWorld
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: C:\apps\app3\platforms\android\CordovaLib
Updated and renamed default.properties to project.properties
Updated local.properties
No project name specified, using Activity name 'HelloWorld'.
If you wish to change it, edit the first line of build.xml.
Added file C:\apps\app3\platforms\android\build.xml
Added file C:\apps\app3\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 C:\apps\app3\platforms\android\CordovaLib\build.xml
Added file C:\apps\app3\platforms\android\CordovaLib\proguard-project.txt
Project successfully created.
cp: no such file or directory: C:\apps\app3\icon.png
cp: no such file or directory: C:\apps\app3\res\icon\ios\icon-72.png
[phonegap] compiling Android...
cp: no such file or directory: C:\apps\app3\icon.png
cp: no such file or directory: C:\apps\app3\res\icon\ios\icon-72.png
Buildfile: C:\apps\app3\platforms\android\build.xml
[taskdef] Could not load definitions from resource emma_ant.properties. It could not be found.
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 23.0.0
[checkenv] Installed at F:\Android\SDK-for-kepler\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: 19.1.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: C:\apps\app3\platforms\android\ant-build
[mkdir] Created dir: C:\apps\app3\platforms\android\ant-build\res
[mkdir] Created dir: C:\apps\app3\platforms\android\ant-build\rsObj
[mkdir] Created dir: C:\apps\app3\platforms\android\ant-build\rsLibs
[mkdir] Created dir: C:\apps\app3\platforms\android\ant-gen
[mkdir] Created dir: C:\apps\app3\platforms\android\ant-build\classes
[mkdir] Created dir: C:\apps\app3\platforms\android\ant-build\dexedLibs
[echo] ----------
[echo] Resolving Dependencies for HelloWorld...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
[taskdef] Could not load definitions from resource emma_ant.properties. It could not be found.
nodeps:
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 23.0.0
[checkenv] Installed at F:\Android\SDK-for-kepler\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.1.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...
[mkdir] Created dir: C:\apps\app3\platforms\android\CordovaLib\res
[mkdir] Created dir: C:\apps\app3\platforms\android\CordovaLib\libs
[mkdir] Created dir: C:\apps\app3\platforms\android\CordovaLib\ant-build
[mkdir] Created dir: C:\apps\app3\platforms\android\CordovaLib\ant-build\res
[mkdir] Created dir: C:\apps\app3\platforms\android\CordovaLib\ant-build\rsObj
[mkdir] Created dir: C:\apps\app3\platforms\android\CordovaLib\ant-build\rsLibs
[mkdir] Created dir: C:\apps\app3\platforms\android\CordovaLib\ant-gen
[mkdir] Created dir: C:\apps\app3\platforms\android\CordovaLib\ant-build\classes
[mkdir] Created dir: C:\apps\app3\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 90 source files to C:\apps\app3\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: C:\apps\app3\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: C:\apps\app3\platforms\android\CordovaLib\res
[crunch] To destination dir: C:\apps\app3\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: C:\apps\app3\platforms\android\CordovaLib\ant-build\build.prop
[propertyfile] Updating property file: C:\apps\app3\platforms\android\CordovaLib\ant-build\build.prop
[propertyfile] Updating property file: C:\apps\app3\platforms\android\CordovaLib\ant-build\build.prop
[propertyfile] Updating property file: C:\apps\app3\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: C:\apps\app3\platforms\android\CordovaLib\ant-build\classes.jar
-compile:
[javac] Compiling 3 source files to C:\apps\app3\platforms\android\ant-build\classes
-post-compile:
-obfuscate:
-dex:
[dex] input: C:\apps\app3\platforms\android\ant-build\classes
[dex] input: C:\apps\app3\platforms\android\CordovaLib\ant-build\classes.jar
[dex] Pre-Dexing C:\apps\app3\platforms\android\CordovaLib\ant-build\classes.jar -> classes-b6d5849ba546b3720c0e46effd6702fc.jar
[dx] Error occurred during initialization of VM
[dx] Could not reserve enough space for object heap
[dx] Could not create the Java virtual machine.
BUILD FAILED
F:\Android\SDK-for-kepler\sdk\tools\ant\build.xml:892: The following error occurred while executing this line:
F:\Android\SDK-for-kepler\sdk\tools\ant\build.xml:894: The following error occurred while executing this line:
F:\Android\SDK-for-kepler\sdk\tools\ant\build.xml:906: The following error occurred while executing this line:
F:\Android\SDK-for-kepler\sdk\tools\ant\build.xml:283: null returned: 1
Total time: 4 seconds
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,C:\apps\app3\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
{ [Error: C:\apps\app3\platforms\android\cordova\build.bat: Command failed with exit code 2] code: 2 }
[error] C:\apps\app3\platforms\android\cordova\build.bat: Command failed with exit code 2

this worked for me
Go to Start->Control Panel->System->Advanced(tab)->Environment Variables->System Variables->New:
Variable name: _JAVA_OPTIONS
Variable value: -Xmx512M
taken from this link

After seeing your log it seems to be java heap memory issue..
See this question for more help.. it suggests to use 64-bit JDK.
This link might also help you..

Your logcat output clearly say that application build is failed, beacuse of sdk tools issue. add the path of sdk tools in enviroment variables,like this yourpath\sdk\platform-tools\;'your path'\sdk\tools\.Make sure that path is added in this way go to advancedsystemsettings->Enviromentvariables->systemvariables(not the user variable) select the path system variable and add your path

Here is how to fix it:
Go to Start->Control Panel->System->Advanced(tab)->Environment Variables->System
Variables->New:
Variable name: _JAVA_OPTIONS
Variable value: -Xmx512M
Variable name: Path
Variable value: ;C:\Program Files\Java\jre6\bin;F:\JDK\bin;
Change this to your appropriate path.

Related

Debugging reversed Android Application without emulator for Dynamic Analysis

Suppose I download an android real-world app from Google Play and planned to do a dynamic analysis in the android application that received. thus, I first did the reverse engineering with apktool on the received android applications, and then by adding build.xml file and a few other files, executed the sudo ant clean debug command.
This can be done on several projects with ant structures that have been built by my own. But Unfortunately, it does not happen for real-world applications and gives the following error which is related to the resources.
Buildfile: /home/xxx/APK/Accept/psiphon3/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 25.2.5
[checkenv] Installed at /usr/local/Application/Android
-setup:
[echo] Project Name: psiphone3
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.1.0
[echo] Resolving Build Target for psiphone3...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[gettarget] WARNING: No minSdkVersion value set. Application will install on all Android versions.
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /home/xxx/APK/Accept/psiphon3/libs
[mkdir] Created dir: /home/xxx/APK/Accept/psiphon3/bin
[mkdir] Created dir: /home/xxx/APK/Accept/psiphon3/bin/res
[mkdir] Created dir: /home/xxx/APK/Accept/psiphon3/bin/rsObj
[mkdir] Created dir: /home/xxx/APK/Accept/psiphon3/bin/rsLibs
[mkdir] Created dir: /home/xxx/APK/Accept/psiphon3/gen
[mkdir] Created dir: /home/xxx/APK/Accept/psiphon3/bin/classes
[mkdir] Created dir: /home/xxx/APK/Accept/psiphon3/bin/dexedLibs
[echo] ----------
[echo] Resolving Dependencies for psiphone3...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
[subant] No sub-builds to iterate on
-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...
[aapt] invalid resource directory name: /home/xxx/APK/Accept/psiphon3/res/values-b+sr+Latn
BUILD FAILED
/usr/local/Application/Android/tools/ant/build.xml:649: The following error occurred while executing this line:
/usr/local/Application/Android/tools/ant/build.xml:694: null returned: 1
Is there a way to do debugging without the execution of programs on the real-world emulator or device?

codenameone server build error

I am designing an android application using codenameone. after running the application on the codenameone simulator I decided to build, the build server is giving me the following error log :
Executing: /home/ec2-user/android-sdk/tools/android create project --target android-21 --name Application --path /tmp/build2045678520977010415xxx/Application --activity ApplicationStub --package com.microserve.mssn Created directory /tmp/build2045678520977010415xxx/Application/src/com/microserve/mssn
Added file /tmp/build2045678520977010415xxx/Application/src/com/microserve/mssn/ApplicationStub.java
Created directory /tmp/build2045678520977010415xxx/Application/res
Created directory /tmp/build2045678520977010415xxx/Application/bin
Created directory /tmp/build2045678520977010415xxx/Application/libs
Created directory /tmp/build2045678520977010415xxx/Application/res/values
Added file /tmp/build2045678520977010415xxx/Application/res/values/strings.xml
Created directory /tmp/build2045678520977010415xxx/Application/res/layout
Added file /tmp/build2045678520977010415xxx/Application/res/layout/main.xml
Created directory /tmp/build2045678520977010415xxx/Application/res/drawable-xhdpi
Created directory /tmp/build2045678520977010415xxx/Application/res/drawable-hdpi
Created directory /tmp/build2045678520977010415xxx/Application/res/drawable-mdpi
Created directory /tmp/build2045678520977010415xxx/Application/res/drawable-ldpi
Added file /tmp/build2045678520977010415xxx/Application/AndroidManifest.xml
Added file /tmp/build2045678520977010415xxx/Application/build.xml
Added file /tmp/build2045678520977010415xxx/Application/proguard-project.txt
Executing: /home/ec2-user/android/ant/bin/ant release Buildfile: /tmp/build2045678520977010415xxx/Application/build.xml
-set-mode-check:
-set-release-mode:
-release-obfuscation-check:
[echo] proguard.config is proguard.cfg
[echo] Proguard.config is enabled
-pre-build:
-check-env:
[checkenv] Android SDK Tools Revision 23.0.5
[checkenv] Installed at /home/ec2-user/android-sdk
-setup:
[echo] Project Name: Application
[gettype] Project Type: Application
-build-setup:
[getbuildtools] Using latest Build Tools: 20.0.0
[echo] Resolving Build Target for Application...
[gettarget] Project Target: Android 5.0
[gettarget] API level: 21
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /tmp/build2045678520977010415xxx/Application/bin/res
[mkdir] Created dir: /tmp/build2045678520977010415xxx/Application/bin/rsObj
[mkdir] Created dir: /tmp/build2045678520977010415xxx/Application/bin/rsLibs
[mkdir] Created dir: /tmp/build2045678520977010415xxx/Application/gen
[mkdir] Created dir: /tmp/build2045678520977010415xxx/Application/bin/classes
[mkdir] Created dir: /tmp/build2045678520977010415xxx/Application/bin/dexedLibs
[echo] ----------
[echo] Resolving Dependencies for Application...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'release'...
[subant] No sub-builds to iterate on
-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...
[aapt] /tmp/build2045678520977010415xxx/Application/res/values/strings.xml:3: error: Apostrophe not preceded by \ (in Da'awah Week)
BUILD FAILED
/home/ec2-user/android-sdk/tools/ant/build.xml:653: The following error occurred while executing this line:
/home/ec2-user/android-sdk/tools/ant/build.xml:698: null returned: 1
Total time: 1 second
The inclusion of the ' character in the app title seems to be the source of the problem. Its something that we can probably fix in the build server but you might have issues with it in other platforms too.

Can't use serve with Cordova / Phonegap helloworld

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

can´t build cordova.jar

i am currently trying to get into the cross-plattform development for mobile devices with cordova (phonegap).
right now i am trying to build the cordova.jar - so i am at the very beginning.
when i run android update project -p . -t android-15 in my framework directory i get the output:
E:\eclipse\cordova-android-master\framework>android update project -p . -t android-15
Updated project.properties
Updated local.properties
build.xml: Found version-tag: custom. File will not be updated.
Updated file E:\eclipse\cordova-android-master\framework\proguard-project.txt
It seems that there are sub-projects. If you want to update them
please use the --subprojects parameter.
Then in the step where i run the command ant jar in my framework directory i get the output:
Buildfile: E:\eclipse\cordova-android-master\framework\build.xml
-check-env:
[checkenv] Android SDK Tools Revision 21
[checkenv] Installed at E:\eclipse\android-sdk-windows
-setup:
[echo] Project Name: Cordova
[gettype] Project Type: Android Library
-pre-clean:
clean:
[delete] Deleting directory E:\eclipse\cordova-android-master\framework\bin
[delete] Deleting directory E:\eclipse\cordova-android-master\framework\gen
[getlibpath] Library dependencies:
[getlibpath] No Libraries
[subant] No sub-builds to iterate on
build-javascript:
-build-setup:
[echo] Resolving Build Target for Cordova...
[gettarget] Project Target: Android 4.0.3
[gettarget] API level: 15
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: E:\eclipse\cordova-android-master\framework\bin
[mkdir] Created dir: E:\eclipse\cordova-android-master\framework\bin\res
[mkdir] Created dir: E:\eclipse\cordova-android-master\framework\gen
[mkdir] Created dir: E:\eclipse\cordova-android-master\framework\bin\classes
[mkdir] Created dir: E:\eclipse\cordova-android-master\framework\bin\dexedLibs
[echo] ----------
[echo] Resolving Dependencies for Cordova...
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
[dependency] API<=15: Adding annotations.jar to the classpath.
[echo] ----------
[echo] Building Libraries with '${build.target}'...
[subant] No sub-builds to iterate on
-pre-build:
-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...
[renderscript] No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.
-pre-compile:
-compile:
[javac] Compiling 53 source files to E:\eclipse\cordova-android-master\framework\bin\classes
[javac] E:\eclipse\cordova-android-master\framework\src\org\apache\cordova\CordovaWebView.java:900: error: cannot find symbol
[javac] settings.setAllowUniversalAccessFromFileURLs(true);
[javac] ^
[javac] symbol: method setAllowUniversalAccessFromFileURLs(boolean)
[javac] location: variable settings of type WebSettings
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 1 error
does anyone have an idea what i´m doing wrong?
the common-codec-1.6.jar is in the lib folder, just as the readme says.
the android api level 15 is installed.
You need to build with API level 16 so that you won't get the compilation error. The method WebSettings.setAllowUniversalAccessFromFileURLs() was introduced in API level 16.

jenkins can't archive the debug apk

I'm trying to set up jenkins for building android apps and archiving builds.
However, it seems that I can't archive the debug apk.
Ant is run with "clean debug" and "archive artifacts" is selected. I tried with */.apk and with bin/test-debug.apk, which is the file I want(and is visible through the jenkins workspace browser.
console log:
Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/test-project/workspace
Checkout:workspace / /var/lib/jenkins/jobs/test-project/workspace - hudson.remoting.LocalChannel#eb3f66
Using strategy: Default
Last Built Revision: Revision bae064038961f07de92252f6f65d222e90d2d871 (origin/HEAD, origin/master)
Checkout:workspace / /var/lib/jenkins/jobs/test-project/workspace - hudson.remoting.LocalChannel#eb3f66
Fetching changes from 1 remote Git repository
Fetching upstream changes from /home/andraz/test/.git
Seen branch in repository origin/HEAD
Seen branch in repository origin/master
Commencing build of Revision bae064038961f07de92252f6f65d222e90d2d871 (origin/HEAD, origin/master)
Checking out Revision bae064038961f07de92252f6f65d222e90d2d871 (origin/HEAD, origin/master)
Warning : There are multiple branch changesets here
[workspace] $ ant -Dsdk.dir=/home/andraz/android-sdk-linux clean debug
Buildfile: /var/lib/jenkins/jobs/test-project/workspace/build.xml
-pre-clean:
clean:
[delete] Deleting directory /var/lib/jenkins/jobs/test-project/workspace/bin
[delete] Deleting directory /var/lib/jenkins/jobs/test-project/workspace/gen
-set-mode-check:
-set-debug-files:
-set-debug-mode:
-debug-obfuscation-check:
-setup:
[echo] Creating output directories if needed...
[mkdir] Created dir: /var/lib/jenkins/jobs/test-project/workspace/bin
[mkdir] Created dir: /var/lib/jenkins/jobs/test-project/workspace/bin/res
[echo] Gathering info for test...
[setup] Android SDK Tools Revision 17
[setup] Project Target: Android 2.2
[setup] API level: 8
[setup]
[setup] ------------------
[setup] Resolving library dependencies:
[setup] No library dependencies.
[setup]
[setup] ------------------
[setup] API<=15: Adding annotations.jar to the classpath.
[setup]
[setup] ------------------
[setup] WARNING: No minSdkVersion value set. Application will install on all Android versions.
-build-setup:
[mkdir] Created dir: /var/lib/jenkins/jobs/test-project/workspace/gen
[mkdir] Created dir: /var/lib/jenkins/jobs/test-project/workspace/bin/classes
-pre-build:
-code-gen:
[echo] ----------
[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] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.
-pre-compile:
-compile:
[javac] Compiling 4 source files to /var/lib/jenkins/jobs/test-project/workspace/bin/classes
-post-compile:
-obfuscate:
-dex:
[dex] Converting compiled files and external libraries into /var/lib/jenkins/jobs/test-project/workspace/bin/classes.dex...
-crunch:
[crunch] Crunching PNG Files in source dir: /var/lib/jenkins/jobs/test-project/workspace/res
[crunch] To destination dir: /var/lib/jenkins/jobs/test-project/workspace/bin/res
[crunch] Crunched 0 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 test-debug-unaligned.apk and signing it with a debug key...
-post-package:
-do-debug:
[zipalign] Running zip align on final apk...
[echo] Debug Package: /var/lib/jenkins/jobs/test-project/workspace/bin/test-debug.apk
[propertyfile] Creating new property file: /var/lib/jenkins/jobs/test-project/workspace/bin/build.prop
[propertyfile] Updating property file: /var/lib/jenkins/jobs/test-project/workspace/bin/build.prop
[propertyfile] Updating property file: /var/lib/jenkins/jobs/test-project/workspace/bin/build.prop
[propertyfile] Updating property file: /var/lib/jenkins/jobs/test-project/workspace/bin/build.prop
-post-build:
debug:
BUILD SUCCESSFUL
Total time: 4 seconds
Archiving artifacts
ERROR: No artifacts found that match the file pattern "**/*.apk". Configuration error?
Build step 'Archive the artifacts' changed build result to FAILURE
Finished: FAILURE
it seems to me that file is generated but somehow not found.
also if I chose to archive bin/test* it stores test-debug-unaligned.apk.d, test.apk_, test.apk.d but no apks
any insights?
It seems that the file is simply not there when archiving happens. As a last build step run shell script that executes ls -l bin and see if the file is indeed there by examining the console output.

Categories

Resources