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.
Related
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.
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.
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.
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 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.