How to build MuPDF for Android on Linux - android

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.

Related

error from inside the android tools, check the console in processing 3.3.5 in ubuntu 16.04

i am new to processing and wanted to make apps using processing,
but i am not able to run a basic code in the android mode in ubuntu
i tried finding the solution to this, but i could only find it for windows,
i have installed java version 1.8
please help, it will be really appreciated
the error i am encountering is,
1. WARNING in /tmp/android5161046717281048963sketch/src/processing/test/sa/MainActivity.java (at line 11)
import android.support.v4.content.ContextCompat;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The import android.support.v4.content.ContextCompat is never used
----------
2. WARNING in /tmp/android5161046717281048963sketch/src/processing/test/sa/MainActivity.java (at line 15)
import android.Manifest;
^^^^^^^^^^^^^^^^
The import android.Manifest is never used
----------
3. WARNING in /tmp/android5161046717281048963sketch/src/processing/test/sa/MainActivity.java (at line 49)
int check;
^^^^^
The value of the local variable check is not used
----------
----------
4. WARNING in /tmp/android5161046717281048963sketch/src/processing/test/sa/sa.java (at line 4)
import processing.data.*;
^^^^^^^^^^^^^^^
The import processing.data is never used
----------
5. WARNING in /tmp/android5161046717281048963sketch/src/processing/test/sa/sa.java (at line 5)
import processing.event.*;
^^^^^^^^^^^^^^^^
The import processing.event is never used
----------
6. WARNING in /tmp/android5161046717281048963sketch/src/processing/test/sa/sa.java (at line 6)
import processing.opengl.*;
^^^^^^^^^^^^^^^^^
The import processing.opengl is never used
----------
7. WARNING in /tmp/android5161046717281048963sketch/src/processing/test/sa/sa.java (at line 8)
import java.util.HashMap;
^^^^^^^^^^^^^^^^^
The import java.util.HashMap is never used
----------
8. WARNING in /tmp/android5161046717281048963sketch/src/processing/test/sa/sa.java (at line 9)
import java.util.ArrayList;
^^^^^^^^^^^^^^^^^^^
The import java.util.ArrayList is never used
----------
9. WARNING in /tmp/android5161046717281048963sketch/src/processing/test/sa/sa.java (at line 10)
import java.io.File;
^^^^^^^^^^^^
The import java.io.File is never used
----------
10. WARNING in /tmp/android5161046717281048963sketch/src/processing/test/sa/sa.java (at line 11)
import java.io.BufferedReader;
^^^^^^^^^^^^^^^^^^^^^^
The import java.io.BufferedReader is never used
----------
11. WARNING in /tmp/android5161046717281048963sketch/src/processing/test/sa/sa.java (at line 12)
import java.io.PrintWriter;
^^^^^^^^^^^^^^^^^^^
The import java.io.PrintWriter is never used
----------
12. WARNING in /tmp/android5161046717281048963sketch/src/processing/test/sa/sa.java (at line 13)
import java.io.InputStream;
^^^^^^^^^^^^^^^^^^^
The import java.io.InputStream is never used
----------
13. WARNING in /tmp/android5161046717281048963sketch/src/processing/test/sa/sa.java (at line 14)
import java.io.OutputStream;
^^^^^^^^^^^^^^^^^^^^
The import java.io.OutputStream is never used
----------
14. WARNING in /tmp/android5161046717281048963sketch/src/processing/test/sa/sa.java (at line 15)
import java.io.IOException;
^^^^^^^^^^^^^^^^^^^
The import java.io.IOException is never used
----------
14 problems (14 warnings)
-post-compile:
-obfuscate:
-dex:
input: /tmp/android5161046717281048963sketch/bin/classes
input: /tmp/android5161046717281048963sketch/libs/android-support-v4.jar
input: /tmp/android5161046717281048963sketch/libs/processing-core.jar
Pre-Dexing /tmp/android5161046717281048963sketch/libs/android-support-v4.jar -> android-support-v4-4a45b30e6f029e45cd804738867ce484.jar
Pre-Dexing /tmp/android5161046717281048963sketch/libs/processing-core.jar -> processing-core-e5aa8bee33bb8c16a67b91c03a0cc33a.jar
Converting compiled files and external libraries into /tmp/android5161046717281048963sketch/bin/classes.dex...
[dx] Merged dex #1 (9 defs/5.7KiB)
[dx] Merged dex #2 (1153 defs/1127.0KiB)
[dx] Merged dex #3 (171 defs/703.5KiB)
[dx] Result is 1333 defs/2250.4KiB. Took 0.6s
-crunch:
[crunch] Crunching PNG Files in source dir: /tmp/android5161046717281048963sketch/res
[crunch] To destination dir: /tmp/android5161046717281048963sketch/bin/res
[crunch] Processing image to cache: /tmp/android5161046717281048963sketch/res/drawable-hdpi/icon.png => /tmp/android5161046717281048963sketch/bin/res/drawable-hdpi/icon.png
[crunch] (processed image to cache entry /tmp/android5161046717281048963sketch/bin/res/drawable-hdpi/icon.png: 52% size of source)
[crunch] Processing image to cache: /tmp/android5161046717281048963sketch/res/drawable-ldpi/icon.png => /tmp/android5161046717281048963sketch/bin/res/drawable-ldpi/icon.png
[crunch] (processed image to cache entry /tmp/android5161046717281048963sketch/bin/res/drawable-ldpi/icon.png: 0% size of source)
[crunch] Processing image to cache: /tmp/android5161046717281048963sketch/res/drawable-xhdpi/icon.png => /tmp/android5161046717281048963sketch/bin/res/drawable-xhdpi/icon.png
[crunch] (processed image to cache entry /tmp/android5161046717281048963sketch/bin/res/drawable-xhdpi/icon.png: 74% size of source)
[crunch] Processing image to cache: /tmp/android5161046717281048963sketch/res/drawable-xxhdpi/icon.png => /tmp/android5161046717281048963sketch/bin/res/drawable-xxhdpi/icon.png
[crunch] (processed image to cache entry /tmp/android5161046717281048963sketch/bin/res/drawable-xxhdpi/icon.png: 89% size of source)
[crunch] Processing image to cache: /tmp/android5161046717281048963sketch/res/drawable-xxxhdpi/icon.png => /tmp/android5161046717281048963sketch/bin/res/drawable-xxxhdpi/icon.png
[crunch] (processed image to cache entry /tmp/android5161046717281048963sketch/bin/res/drawable-xxxhdpi/icon.png: 89% size of source)
[crunch] Processing image to cache: /tmp/android5161046717281048963sketch/res/drawable/icon.png => /tmp/android5161046717281048963sketch/bin/res/drawable/icon.png
[crunch] (processed image to cache entry /tmp/android5161046717281048963sketch/bin/res/drawable/icon.png: 84% size of source)
[crunch] Crunched 6 PNG files to update cache
-package-resources:
Creating full resource package...
-package:
Current build type is different than previous build: forced apkbuilder run.
Creating sa-debug-unaligned.apk and signing it with a debug key...
BUILD FAILED
/home/satinder/sketchbook/modes/AndroidMode/sdk/tools/ant/build.xml:958: The following error occurred while executing this line:
/home/satinder/sketchbook/modes/AndroidMode/sdk/tools/ant/build.xml:969: The following error occurred while executing this line:
/home/satinder/sketchbook/modes/AndroidMode/sdk/tools/ant/build.xml:312: com.android.sdklib.build.ApkCreationException: Failed to create key: Cannot run program "/home/satinder/Downloads/processing-3.3.5/java/bin/keytool": error=2, No such file or directory
JAVA_HOME is set to: /home/satinder/Downloads/processing-3.3.5/java
Update it if necessary, or manually execute the following command:
/home/satinder/Downloads/processing-3.3.5/java/bin/keytool -genkey -alias AndroidDebugKey -keyalg RSA -dname "CN=Android Debug,O=Android,C=US" -validity 10950 -keypass android -keystore /home/satinder/.android/debug.keystore -storepass android
at com.android.sdklib.build.ApkBuilder.getDebugKey(ApkBuilder.java:300)
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.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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:525)
at processing.mode.android.AndroidBuild.build(AndroidBuild.java:96)
at processing.mode.android.AndroidMode.handleRunEmulator(AndroidMode.java:259)
at processing.mode.android.AndroidEditor$15.run(AndroidEditor.java:511)
Total time: 23 seconds

How to package Android NDK's sample?

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!

Cordova: ant error code 1 when building android hello world app

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)

Error from inside the Android tools, check the console - in processing 2.0 , Android Mode

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.

Not able to build the created Titanium Android Module

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.

Categories

Resources