问题总结:我无法在android设备上运行程序,也不能在模拟器中运行。我安装了 Android SDK 2.33 (API10) 和所有组件,还有 4.1 和更高版本。我为 HTC EVO V 4G (Virgin Mobile) 安装了新的 USB 驱动程序,但仍然没有。我检查了 SDK 的路径并且处理正确地定位它。我花了一整天的时间在网上研究它,重新安装 SDK,安装 Processing 2.0 64 位(因为我的 SDK 是 64 位)等等。
我正在尝试运行任何程序,甚至是模板和空白列表。无论我是在模拟器上还是通过我的安卓设备运行它,它总是给我同样的错误。控制台告诉我:来自 Android 工具内部的错误,请检查控制台
我的错误和编译信息
-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
如何让 Processing 运行 android 程序?