This is a generic question, but I cannot find any similar questions in stackoverflow that discuss the solution to this for recent version for Android SDK/NDK.
My purpose is to package the Android NDK as a apk file.
So:
I installed Android NDK into /opt directory - called it /opt/.
And cd /opt//samples/ where is any example.
And then enter "/opt//ndk-build", it compiled alright:
/opt/android-ndk/ndk-build
[arm64-v8a] Gdbserver : [aarch64-linux-android-4.9] libs/arm64-v8a/gdbserver
[arm64-v8a] Gdbsetup : libs/arm64-v8a/gdb.setup
[x86_64] Gdbserver : [x86_64-4.9] libs/x86_64/gdbserver
[x86_64] Gdbsetup : libs/x86_64/gdb.setup
[mips64] Gdbserver : [mips64el-linux-android-4.9] libs/mips64/gdbserver
[mips64] Gdbsetup : libs/mips64/gdb.setup
[armeabi-v7a] Gdbserver : [arm-linux-androideabi-4.8] libs/armeabi-v7a/gdbserver
[armeabi-v7a] Gdbsetup : libs/armeabi-v7a/gdb.setup
[armeabi] Gdbserver : [arm-linux-androideabi-4.8] libs/armeabi/gdbserver
[armeabi] Gdbsetup : libs/armeabi/gdb.setup
[x86] Gdbserver : [x86-4.8] libs/x86/gdbserver
[x86] Gdbsetup : libs/x86/gdb.setup
[mips] Gdbserver : [mipsel-linux-android-4.8] libs/mips/gdbserver
[mips] Gdbsetup : libs/mips/gdb.setup
[arm64-v8a] Compile : hello-jni libs/arm64-v8a/libhello-jni.so
[x86_64] Compile : hello-jni libs/x86_64/libhello-jni.so
[mips64] Compile : hello-jni libs/mips64/libhello-jni.so
[armeabi-v7a] Compile thumb : hello-jni libs/armeabi-v7a/libhello-jni.so
[armeabi] Compile thumb : hello-jni libs/armeabi/libhello-jni.so
[x86] Compile : hello-jni libs/x86/libhello-jni.so
[mips] Compile : hello-jni libs/mips/libhello-jni.so
To package into APK, I used "ant", so generate the build.xml first:
/opt/android-sdk-linux/tools/android update project --path . --target android-21
"ant debug"
Buildfile: /opt/android-ndk/samples/hello-gl2/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 24.1.2
[checkenv] Installed at /opt/android-sdk-linux
-setup:
[echo] Project Name: GL2JNIActivity
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 22.0.1
[echo] Resolving Build Target for GL2JNIActivity...
[gettarget] Project Target: Android 5.0.1
[gettarget] API level: 21
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /opt/android-ndk/samples/hello-gl2/bin/rsObj
[mkdir] Created dir: /opt/android-ndk/samples/hello-gl2/bin/rsLibs
[echo] ----------
[echo] Resolving Dependencies for GL2JNIActivity...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
[subant] No sub-builds to iterate on
-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] No changed resources. R.java and Manifest.java untouched.
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.
-pre-compile:
-compile:
[javac] Compiling 6 source files to /opt/android-ndk/samples/hello-gl2/bin/classes
-post-compile:
-obfuscate:
-dex:
[dex] input: /opt/android-ndk/samples/hello-gl2/bin/classes
[dex] Found modified input file
[dex] Converting compiled files and external libraries into /opt/android-ndk/samples/hello-gl2/bin/classes.dex...
-crunch:
[crunch] Crunching PNG Files in source dir: /opt/android-ndk/samples/hello-gl2/res
[crunch] To destination dir: /opt/android-ndk/samples/hello-gl2/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 GL2JNIActivity-debug-unaligned.apk and signing it with a debug key...
[apkbuilder] Found duplicate file for APK: AndroidManifest.xml
[apkbuilder] Origin 1: /opt/android-ndk/samples/hello-gl2/bin/GL2JNIActivity.ap_
[apkbuilder] Origin 2: /opt/android-ndk/samples/hello-gl2/AndroidManifest.xml
BUILD FAILED
/opt/android-sdk-linux/tools/ant/build.xml:963: The following error occurred while executing this line:
/opt/android-sdk-linux/tools/ant/build.xml:974: The following error occurred while executing this line:
/opt/android-sdk-linux/tools/ant/build.xml:313: com.android.sdklib.build.DuplicateFileException: Duplicate files at the same path inside the APK
at com.android.sdklib.build.ApkBuilder.doAddFile(ApkBuilder.java:821)
at com.android.sdklib.build.ApkBuilder.addFile(ApkBuilder.java:507)
at com.android.sdklib.build.ApkBuilder.processFileForResource(ApkBuilder.java:872)
at com.android.sdklib.build.ApkBuilder.addSourceFolder(ApkBuilder.java:623)
at com.android.sdklib.build.ApkBuilder.addSourceFolder(ApkBuilder.java:605)
at com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:356)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at com.android.ant.IfElseTask.execute(IfElseTask.java:124)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at com.android.ant.IfElseTask.execute(IfElseTask.java:124)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Total time: 2 seconds
How to overcome the above compilation errors?
Thanks.
First of all, it looks like you built the native side of hello-jni, and then built and packaged hello-gl2. These are two different samples. Could you please make sure you stay in the same sample folder?
I also highly recommend that you add /opt/android-ndk-r10e, /opt/android-sdk-linux/tools and /opt/android-sdk-linux/platform-tools to your PATH environment variable. Simply add this line to your ~/.profile and then restart your terminal.
export PATH=${PATH}:/opt/android-ndk-r10e;/opt/android-sdk-linux/tools:/opt/android-sdk-linux/platform-tools"
this way, you should be able to access any android tools such as ndk-build, adb and android without having to specify their absolute paths.
If that doesn't help, try cleaning up and rebuilding your sample with ant clean && ant debug. If that doesn't work, try deleting the following:
bin/
gen/
libs/
obj/
build.xml
local.properties
proguard-project.xml
and then try again:
ndk-build NDK_DEBUG=1
android update project --path . --target android-21
ant debug
Everything should work. If it still doesn't work, I would advise to launch android (with no parameters) to launch the Android SDK Manager. Make sure you are up to date, and make sure you have SDK Platform for API level 21 installed if that's the API level you want to use. The latest Android SDK Tools as of today should be revision 24.2. Make sure you have the latest android-ndk too. Latest as of today should be r10e.
Good luck!
Related
I'm using Qt5.4.1 on Ubuntu 14.04. I've installed Android SDK Tools 24.1.2, Android SDK Platform-tools 22, Android SDK Build-tools 22.0.1 and API22 in the Android SDK Manager.
I have installed java-7-openjdk-amd64 and added the paths to the Android SDK, Android NDK, java-7-openjdk-amd64 and apache-ant-1.9.4 in Qt Creator 3.3.1.
If I create a project an build I get this error:
07:40:06: Running steps for project android01...
07:40:06: Configuration unchanged, skipping qmake step.
07:40:06: Starting: "/usr/bin/make"
make: Nothing to be done for `first'.
07:40:06: The process "/usr/bin/make" exited normally.
07:40:06: Removing directory /home/user/QtProjects/_test_/build-android01-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug/android-build
07:40:06: Starting: "/usr/bin/make" INSTALL_ROOT=/home/user/QtProjects/_test_/build-android01-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug/android-build install
install -m 755 -p "libandroid01.so" "/home/user/QtProjects/_test_/build-android01-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug/android-build/libs/armeabi-v7a/libandroid01.so"
07:40:06: The process "/usr/bin/make" exited normally.
07:40:06: Starting: "/home/user/Qt5/5.4/android_armv7/bin/androiddeployqt" --input /home/user/QtProjects/_test_/build-android01-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug/android-libandroid01.so-deployment-settings.json --output /home/user/QtProjects/_test_/build-android01-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug/android-build --deployment bundled --android-platform android-22 --jdk /usr/lib/jvm/java-7-openjdk-amd64 --ant /home/user/apache-ant-1.9.4/bin/ant
Generating Android Package
Input file: /home/user/QtProjects/_test_/build-android01-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug/android-libandroid01.so-deployment-settings.json
Output directory: /home/user/QtProjects/_test_/build-android01-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug/android-build/
Application binary: /home/user/QtProjects/_test_/build-android01-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug/libandroid01.so
Android build platform: android-22
Install to device: No
Buildfile: /home/user/QtProjects/_test_/build-android01-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug/android-build/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 24.1.2
[checkenv] Installed at /home/user/android-sdk-linux
-setup:
[echo] Project Name: QtApp
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 22.0.1
[echo] Resolving Build Target for QtApp...
[gettarget] Project Target: Android 5.1.1
[gettarget] API level: 22
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /home/user/QtProjects/_test_/build-android01-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug/android-build/bin
[mkdir] Created dir: /home/user/QtProjects/_test_/build-android01-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug/android-build/bin/res
[mkdir] Created dir: /home/user/QtProjects/_test_/build-android01-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug/android-build/bin/rsObj
[mkdir] Created dir: /home/user/QtProjects/_test_/build-android01-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug/android-build/bin/rsLibs
[mkdir] Created dir: /home/user/QtProjects/_test_/build-android01-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug/android-build/gen
[mkdir] Created dir: /home/user/QtProjects/_test_/build-android01-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug/android-build/bin/classes
[mkdir] Created dir: /home/user/QtProjects/_test_/build-android01-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_1-Debug/android-build/bin/dexedLibs
[echo] ----------
[echo] Resolving Dependencies for QtApp...
[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] Found 2 AIDL files.
[aidl] Compiling 2 AIDL files.
BUILD FAILED
/home/user/android-sdk-linux/tools/ant/build.xml:653: The following error occurred while executing this line:
/home/user/android-sdk-linux/tools/ant/build.xml:659: Execute failed: java.io.IOException: Cannot run program "/home/user/android-sdk-linux/build-tools/22.0.1/aidl": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
at java.lang.Runtime.exec(Runtime.java:617)
at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442)
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:628)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
at com.android.ant.AidlExecTask$AidlProcessor.process(AidlExecTask.java:102)
at com.android.ant.MultiFilesTask.processFiles(MultiFilesTask.java:131)
at com.android.ant.AidlExecTask.execute(AidlExecTask.java:203)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:186)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
... 48 more
Total time: 0 seconds
Building the android package failed!
-- For more information, run this command with --verbose.
07:40:07: The process "/home/user/Qt5/5.4/android_armv7/bin/androiddeployqt" exited with code 14.
Error while building/deploying project android01 (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.4.1))
When executing step "Build Android APK"
07:40:07: Elapsed time: 00:01.
Where is the problem?
sudo apt-get install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386 solved the problem.
I am having difficulty building MuPDF for Android on Linux. I have followed exactly the directions at How to build MuPDF for Android
The build fails when running the command 'ant debug' with the following error-
/home/georgew/AndroidSDK/android-sdk-linux/tools/ant/build.xml:653: The following error occurred while executing this line:
/home/georgew/AndroidSDK/android-sdk-linux/tools/ant/build.xml:698: null returned: 132
I have spent the day trying every suggested solution that Google could find. They all fail with this error, except that the value of the null returned can vary.
The build system is a Pentium4 running Scientific Linux 6.3. Ant was compiled from source because a newer version than supplied by SL6 was required.
Below are the last lines of output from running 'ant -d debug'
Class com.android.ant.RenderScriptTask$1 loaded from ant loader (parentFirst)
[echo] ----------
[echo] Handling Resources...
Property "android.library" has not been set
[aapt] Generating resource IDs...
Class org.apache.tools.ant.types.Commandline$Argument loaded from parent loader (parentFirst)
[aapt] Current OS is Linux
[aapt] Executing '/home/georgew/AndroidSDK/android-sdk-linux/build-tools/21.0.2/aapt' with arguments:
[aapt] 'package'
[aapt] '-f'
[aapt] '-m'
[aapt] '-0'
[aapt] 'apk'
[aapt] '-M'
[aapt] '/home/georgew/AndroidSDK/src/mupdf/platform/android/bin/AndroidManifest.xml'
[aapt] '-S'
[aapt] '/home/georgew/AndroidSDK/src/mupdf/platform/android/bin/res'
[aapt] '-S'
[aapt] '/home/georgew/AndroidSDK/src/mupdf/platform/android/res'
[aapt] '-I'
[aapt] '/home/georgew/AndroidSDK/android-sdk-linux/platforms/android-16/android.jar'
[aapt] '-J'
[aapt] '/home/georgew/AndroidSDK/src/mupdf/platform/android/gen'
[aapt] '--generate-dependencies'
[aapt] '-G'
[aapt] '/home/georgew/AndroidSDK/src/mupdf/platform/android/bin/proguard.txt'
[aapt]
[aapt] The ' characters around the executable and arguments are
[aapt] not part of the command.
Execute:Java13CommandLauncher: Executing '/home/georgew/AndroidSDK/android-sdk-linux/build-tools/21.0.2/aapt' with arguments:
'package'
'-f'
'-m'
'-0'
'apk'
'-M'
'/home/georgew/AndroidSDK/src/mupdf/platform/android/bin/AndroidManifest.xml'
'-S'
'/home/georgew/AndroidSDK/src/mupdf/platform/android/bin/res'
'-S'
'/home/georgew/AndroidSDK/src/mupdf/platform/android/res'
'-I'
'/home/georgew/AndroidSDK/android-sdk-linux/platforms/android-16/android.jar'
'-J'
'/home/georgew/AndroidSDK/src/mupdf/platform/android/gen'
'--generate-dependencies'
'-G'
'/home/georgew/AndroidSDK/src/mupdf/platform/android/bin/proguard.txt'
The ' characters around the executable and arguments are
not part of the command.
BUILD FAILED
/home/georgew/AndroidSDK/android-sdk-linux/tools/ant/build.xml:653: The following error occurred while executing this line:
/home/georgew/AndroidSDK/android-sdk-linux/tools/ant/build.xml:698: null returned: 132
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:650)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:676)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:502)
at com.android.ant.AaptExecTask.execute(AaptExecTask.java:703)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
at org.apache.tools.ant.Main.runBuild(Main.java:801)
at org.apache.tools.ant.Main.startAnt(Main.java:218)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
After much further research- the problem is not with building MuPDF. The problem is that aapt in the newer versions of the SDK is compiled with SSE2 support and is broken in older machines.
The available solutions are to download and compile the SDK on the machine being used for the build, install the SDK and build the project on a more modern machine, or find a copy of a recent version of aapt that was compiled without SSE2 support.
I searched and found a jar file, apktool-2.0.jar, that I extracted aapt from and the build completes successfully.
Clean install of Cordova on an Ubuntu 12.04, then installed Android ADT bundle and added the platform-tools and tools to the path.
Then created the hello app from toturial at apache Cordova. but it refuses to build.
See the error I'm getting:
aus#devhost:/opt/android_app/hello$ cordova build
Running command: /opt/android_app/hello/platforms/android/cordova/build
Buildfile: /opt/android_app/hello/platforms/android/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.2
[checkenv] Installed at /opt/android_app/hello/adt-bundle-linux-x86_64-20140321/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.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.2
[checkenv] Installed at /opt/android_app/hello/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: /opt/android_app/hello/platforms/android/CordovaLib/ant- build/rsObj
[mkdir] Created dir: /opt/android_app/hello/platforms/android/CordovaLib/ant-build/rsLibs
[echo] ----------
[echo] Resolving Dependencies for CordovaLib...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
BUILD FAILED
/opt/android_app/hello/adt-bundle-linux-x86_64-20140321/sdk/tools/ant/build.xml:601: The following error occurred while executing this line:
/opt/android_app/hello/adt-bundle-linux-x86_64-20140321/sdk/tools/ant/build.xml:653: The following error occurred while executing this line:
/opt/android_app/hello/adt-bundle-linux-x86_64-20140321/sdk/tools/ant/build.xml:698: Execute failed: java.io.IOException: Cannot run program "/opt/android_app/hello/adt-bundle-linux-x86_64-20140321/sdk/build-tools/android-4.4.2/aapt" (in directory "/opt/android_app/hello/platforms/android/CordovaLib"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
at java.lang.Runtime.exec(Runtime.java:617)
at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:41)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442)
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:628)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
at com.android.ant.AaptExecTask.execute(AaptExecTask.java:699)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440)
at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:303)
at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:221)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
... 68 more
Total time: 1 second
Error code 1 for command: ant with args: debug,- f,/opt/android_app/hello/platforms/android/build.xml,-Dout.dir=ant-build,- Dgen.absolute.dir=ant-gen
Error: /opt/android_app/hello/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.EventEmitter.emit (events.js:110:17)
at maybeClose (child_process.js:992:16)
at Process.ChildProcess._handle.onexit (child_process.js:1064:5)
Any ideas what i'm missing? doesn't seems to be dependencies, I didn't get errors during the installation of npm, cordova, jdk-7, android sdk, ant, nodejs etc.
Also, in the error message it refers to build.xml, that file exists with content. but when I try it with ant directly I get:
aus#devhost:/opt/android_app/hello$ ant /opt/android_app/hello/platforms/android/build.xml
Buildfile: build.xml does not exist!
Build failed
probably should use ant like that but I had to try.
So the solution was to run those commands:
sudo dpkg --add-architecture i386
sudo apt-get -qqy update
sudo apt-get -qqy install libncurses5:i386 libstdc++6:i386 zlib1g:i386
appearantly android sdk have some dependency on 32bit architechture.
Check if /opt/android_app/hello/adt-bundle-linux-x86_64-20140321/sdk/build-tools/android-4.4.2/aapt exists. If it does exist please check the link below that provides a fix. It looks like aapt has a dependency on zlib, which is available in i386 architecture only, so you'll need to add that architecture and the lib itself.
How to make Android's aapt and adb work on 64-bit Ubuntu without ia32-libs (works for versions 12, 13 and 14)
The problem summary:
I cannot run the programs on android device, nor in emulator. I installed Android SDK 2.33 (API10) and all the components, also 4.1 and higher. I installed new USB drivers for HTC EVO V 4G (Virgin Mobile) and still nothing. I checked the path for SDK and Processing is locating it correctly. I spent whole day researching it online, reinstalling SDK, installing Processing 2.0 64-bits (since my SDK is 64-bit) etc etc.
I am trying to run any program, even templates and blank listing. It gives me the same error all the time, no matter if I run it on emulator or through my android device.
Console tells me: Error from inside the Android tools, check the console
My error and compilation message
-set-mode-check:
-set-debug-files:
-check-env:
Android SDK Tools Revision 22.0.1
Installed at F:\ANDROID SDK\sdk
-setup:
[echo] Project Name: SonicPainterAndroid
Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
Using latest Build Tools: 17.0.0
[echo] Resolving Build Target for SonicPainterAndroid...
Project Target: Android 2.3.3
API level: 10
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\bin
[mkdir] Created dir: C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\bin\res
[mkdir] Created dir: C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\gen
[mkdir] Created dir: C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\bin\classes
[mkdir] Created dir: C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\bin\dexedLibs
[echo] ----------
[echo] Resolving Dependencies for SonicPainterAndroid...
Library dependencies:
No Libraries
------------------
API<=15: Adding annotations.jar to the classpath.
[echo] ----------
[echo] Building Libraries with 'debug'...
[subant] No sub-builds to iterate on
-code-gen:
Merging AndroidManifest files into one.
Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
Generating BuildConfig class.
-pre-compile:
-compile:
[javac] Since compiler setting isn't classic or modern, ignoring fork setting.
[javac] Since compiler setting isn't classic or modern, ignoring fork setting.
[javac] Since compiler setting isn't classic or modern, ignoring fork setting.
[javac] Compiling 3 source files to C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\bin\classes
[javac] Since compiler setting isn't classic or modern, ignoring fork setting.
[javac] Note: C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\src\processing\test\sonicpainterandroid\SonicPainterAndroid.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
-post-compile:
-obfuscate:
-dex:
input: C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\bin\classes
input: F:\ANDROID SDK\sdk\tools\support\annotations.jar
input: C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\libs\processing-core.jar
Pre-Dexing F:\ANDROID SDK\sdk\tools\support\annotations.jar -> annotations-6fd7360592e852b6775ac413fb7ed0ba.jar
Pre-Dexing C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\libs\processing-core.jar -> processing-core-777dbf75952a9afa0c94c831b5d89f0d.jar
Converting compiled files and external libraries into C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\bin\classes.dex...
[dx] Merged dex A (18 defs/19.5KiB) with dex B (2 defs/1.1KiB). Result is 20 defs/23.8KiB. Took 0.1s
[dx] Merged dex A (20 defs/23.8KiB) with dex B (203 defs/686.6KiB). Result is 223 defs/838.1KiB. Took 0.2s
-crunch:
[crunch] Crunching PNG Files in source dir: C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\res
[crunch] To destination dir: C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\bin\res
[crunch] Processing image to cache: C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\res\drawable-hdpi\icon.png => C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\bin\res\drawable-hdpi\icon.png
[crunch] (processed image to cache entry C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\bin\res\drawable-hdpi\icon.png: 47% size of source)
[crunch] Processing image to cache: C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\res\drawable-ldpi\icon.png => C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\bin\res\drawable-ldpi\icon.png
[crunch] (processed image to cache entry C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\bin\res\drawable-ldpi\icon.png: 0% size of source)
[crunch] Processing image to cache: C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\res\drawable\icon.png => C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\bin\res\drawable\icon.png
[crunch] (processed image to cache entry C:\Users\SEBAST~1\AppData\Local\Temp\android1631735927318765460sketch\bin\res\drawable\icon.png: 0% size of source)
[crunch] Crunched 3 PNG files to update cache
-package-resources:
Creating full resource package...
[aapt] Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.
-package:
Current build type is different than previous build: forced apkbuilder run.
Creating SonicPainterAndroid-debug-unaligned.apk and signing it with a debug key...
BUILD FAILED
F:\ANDROID SDK\sdk\tools\ant\build.xml:955: The following error occurred while executing this line:
F:\ANDROID SDK\sdk\tools\ant\build.xml:966: The following error occurred while executing this line:
F:\ANDROID SDK\sdk\tools\ant\build.xml:310: com.android.sdklib.build.ApkCreationException: java.io.EOFException
at com.android.sdklib.build.ApkBuilder.getDebugKey(ApkBuilder.java:308)
at com.android.sdklib.build.ApkBuilder.<init>(ApkBuilder.java:392)
at com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:334)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at com.android.ant.IfElseTask.execute(IfElseTask.java:124)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at com.android.ant.IfElseTask.execute(IfElseTask.java:124)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at processing.mode.android.AndroidBuild.antBuild(AndroidBuild.java:415)
at processing.mode.android.AndroidBuild.build(AndroidBuild.java:73)
at processing.mode.android.AndroidMode.handleRunDevice(AndroidMode.java:220)
at processing.mode.android.AndroidEditor$14.run(AndroidEditor.java:310)
Caused by: java.io.EOFException
at java.io.DataInputStream.readFully(DataInputStream.java:180)
at java.io.DataInputStream.readUTF(DataInputStream.java:592)
at java.io.DataInputStream.readUTF(DataInputStream.java:547)
at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:685)
at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:38)
at java.security.KeyStore.load(KeyStore.java:1185)
at com.android.sdklib.internal.build.DebugKeyProvider.loadKeyEntry(DebugKeyProvider.java:174)
at com.android.sdklib.internal.build.DebugKeyProvider.<init>(DebugKeyProvider.java:107)
at com.android.sdklib.build.ApkBuilder.getDebugKey(ApkBuilder.java:272)
... 60 more
Total time: 18 seconds
How do I make the Processing run android programs ?
I solved it ! Thanks to the abbas.aniefa who's post is located here
All what has to be done is deleting the debug keystore file which is located at
C:\Users\<UserName>\.android\debug.keystore
where is the name of the computer user
Hopefully others will find it useful as much as I do.
I had created Titanium Android Module using the Commadline commands in my Windows7 machine, when I try to build the created module using Ant it shows the following error
C:\Users\ram\modtest>ant
Buildfile: C:\Users\ram\modtest\build.xml
init:
process.annotations:
generate.rhino.bindings:
[java] Generating C:\Users\ram\modtest\build\generated\java\com\ram\apptest
\ExampleProxyPrototype.java
[java] Generating C:\Users\ram\modtest\build\generated\java\com\ram\apptest
\ModtestModulePrototype.java
[java] Generating C:\Users\ram\modtest\build\generated\java\modtestGenerate
dBindings.java
generate.rhino.idswitch:
[echo] Generating IDs for C:\Users\ram\modtest\build\generated\java\com\ram
\apptest\ExampleProxyPrototype.java
[echo] Generating IDs for C:\Users\ram\modtest\build\generated\java\com\ram
\apptest\ModtestModulePrototype.java
[echo] Generating IDs for C:\Users\ram\modtest\build\generated\java\modtest
GeneratedBindings.java
generate.v8.bindings:
[java] Generating C:\Users\ram\modtest\build\generated\jni\com.ram.apptest.
ExampleProxy.h
[java] Generating C:\Users\ram\modtest\build\generated\jni\com.ram.apptest.
ExampleProxy.cpp
[java] Generating C:\Users\ram\modtest\build\generated\jni\com.ram.apptest.
ModtestModule.h
[java] Generating C:\Users\ram\modtest\build\generated\jni\com.ram.apptest.
ModtestModule.cpp
BUILD FAILED
C:\Users\ram\AppData\Roaming\Titanium\mobilesdk\win32\1.8.0.1\module\android\bui
ld.xml:103: Execute failed: java.io.IOException: Cannot run program "C:\Users\ra
m\AppData\Roaming\Titanium\mobilesdk\win32\1.8.0.1\module\android\bootstrap.py":
CreateProcess error=193, %1 is not a valid Win32 application
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at java.lang.Runtime.exec(Runtime.java:593)
at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Exec
ute.java:862)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:631)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:672)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:498)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32
application
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
at java.lang.ProcessImpl.start(ProcessImpl.java:30)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
... 23 more
Total time: 6 seconds
Is there is any way to fix it...?
this is a known bug and won't be fixed until release 1.8.1 which I'm not sure when it's coming out. you can't build modules for windows platforms with 1.8.0.1. seems par for the course with titanium software.
I see it is not able to execute the python script. if you have python installed on your machine make sure to add it to the PATH environment variable.