Issues running on emulator and device

edited March 27 in Android Mode

Hi, I'm very new to processing and I'm trying to get a sketch to run on the emulator or device for the first time. I've spent four days scrolling through forums but nothing seems to have fixed the issue. The emulator will load up completely but when I run my sketch on it, it says "could not create a virtual device for the emulator". If I try to run it on my device it say's that it lost connection to the device. The android API is set to 6.0(23) on the target SKD. The SKD manager is downloaded and have the relevant APIs and tools downloaded. My AVD is set as Processing-0217 and will load up fine but won't load a sketch. In order to check that this wasn't my novice coding affecting things, I'm trying to run a simple black background with a white box so I don't think this is an error with the coding. No error message comes up but I do get 14 warnings that i've pasted below. Any ideas on how to fix this?

[mkdir] Created dir: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin
 [echo] org.eclipse.jdt.core.JDTCompilerAdapter

-set-mode-check:

-set-debug-files:

-check-env: Android SDK Tools Revision 25.2.5 Installed at C:\Users\KAT\Documents\Processing\modes\AndroidMode\sdk

-setup: [echo] Project Name: sketch_170326a Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup: Using latest Build Tools: 26.0.0 rc1 [echo] Resolving Build Target for sketch_170326a... Project Target: Android 6.0 API level: 23 [echo] ---------- [echo] Creating output directories if needed... [mkdir] Created dir: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\res [mkdir] Created dir: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\rsObj [mkdir] Created dir: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\rsLibs [mkdir] Created dir: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\gen [mkdir] Created dir: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\classes [mkdir] Created dir: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\dexedLibs [echo] ---------- [echo] Resolving Dependencies for sketch_170326a... Library dependencies: No Libraries


 [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... [echo] ---------- [echo] Handling Resources... Generating resource IDs... [echo] ---------- [echo] Handling BuildConfig class... Generating BuildConfig class.

-pre-compile:

-compile:

[javac] Compiling 4 source files to C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\classes

  1. WARNING in C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\src\processing\test\sketch_170326a\MainActivity.java (at line 11) import android.support.v4.content.ContextCompat; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The import android.support.v4.content.ContextCompat is never used

  1. WARNING in C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\src\processing\test\sketch_170326a\MainActivity.java (at line 15) import android.Manifest; ^^^^^^^^^^^^^^^^

The import android.Manifest is never used

  1. WARNING in C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\src\processing\test\sketch_170326a\MainActivity.java (at line 49) int check; ^^^^^

The value of the local variable check is not used


  1. WARNING in C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\src\processing\test\sketch_170326a\sketch_170326a.java (at line 4) import processing.data.*; ^^^^^^^^^^^^^^^

The import processing.data is never used

  1. WARNING in C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\src\processing\test\sketch_170326a\sketch_170326a.java (at line 5) import processing.event.*; ^^^^^^^^^^^^^^^^

The import processing.event is never used

  1. WARNING in C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\src\processing\test\sketch_170326a\sketch_170326a.java (at line 6) import processing.opengl.*; ^^^^^^^^^^^^^^^^^

The import processing.opengl is never used

  1. WARNING in C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\src\processing\test\sketch_170326a\sketch_170326a.java (at line 8) import java.util.HashMap; ^^^^^^^^^^^^^^^^^

The import java.util.HashMap is never used

  1. WARNING in C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\src\processing\test\sketch_170326a\sketch_170326a.java (at line 9) import java.util.ArrayList; ^^^^^^^^^^^^^^^^^^^

The import java.util.ArrayList is never used

  1. WARNING in C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\src\processing\test\sketch_170326a\sketch_170326a.java (at line 10) import java.io.File; ^^^^^^^^^^^^

The import java.io.File is never used

  1. WARNING in C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\src\processing\test\sketch_170326a\sketch_170326a.java (at line 11) import java.io.BufferedReader; ^^^^^^^^^^^^^^^^^^^^^^

The import java.io.BufferedReader is never used

  1. WARNING in C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\src\processing\test\sketch_170326a\sketch_170326a.java (at line 12) import java.io.PrintWriter; ^^^^^^^^^^^^^^^^^^^

The import java.io.PrintWriter is never used

  1. WARNING in C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\src\processing\test\sketch_170326a\sketch_170326a.java (at line 13) import java.io.InputStream; ^^^^^^^^^^^^^^^^^^^

The import java.io.InputStream is never used

  1. WARNING in C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\src\processing\test\sketch_170326a\sketch_170326a.java (at line 14) import java.io.OutputStream; ^^^^^^^^^^^^^^^^^^^^

The import java.io.OutputStream is never used

  1. WARNING in C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\src\processing\test\sketch_170326a\sketch_170326a.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: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\classes input: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\libs\android-support-v4.jar input: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\libs\processing-core.jar Pre-Dexing C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\libs\android-support-v4.jar -> android-support-v4-1bcc11c51f82e7fa90181ff9ec342685.jar Pre-Dexing C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\libs\processing-core.jar -> processing-core-e11ed9c58d0bd900949a9fdea907518e.jar Converting compiled files and external libraries into C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\classes.dex... [dx] Merged dex #1 (9 defs/5.8KiB) [dx] Merged dex #2 (1153 defs/1127.0KiB) [dx] Merged dex #3 (171 defs/703.5KiB) [dx] Result is 1333 defs/2250.4KiB. Took 1.4s

-crunch: [crunch] Crunching PNG Files in source dir: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\res [crunch] To destination dir: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\res [crunch] Processing image to cache: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\res\drawable-hdpi\icon.png => C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\res\drawable-hdpi\icon.png [crunch] (processed image to cache entry C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\res\drawable-hdpi\icon.png: 52% size of source) [crunch] Processing image to cache: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\res\drawable-ldpi\icon.png => C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\res\drawable-ldpi\icon.png [crunch] (processed image to cache entry C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\res\drawable-ldpi\icon.png: 0% size of source) [crunch] Processing image to cache: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\res\drawable-xhdpi\icon.png => C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\res\drawable-xhdpi\icon.png [crunch] (processed image to cache entry C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\res\drawable-xhdpi\icon.png: 74% size of source) [crunch] Processing image to cache: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\res\drawable-xxhdpi\icon.png => C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\res\drawable-xxhdpi\icon.png [crunch] (processed image to cache entry C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\res\drawable-xxhdpi\icon.png: 89% size of source) [crunch] Processing image to cache: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\res\drawable-xxxhdpi\icon.png => C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\res\drawable-xxxhdpi\icon.png [crunch] (processed image to cache entry C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\res\drawable-xxxhdpi\icon.png: 89% size of source) [crunch] Processing image to cache: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\res\drawable\icon.png => C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\res\drawable\icon.png [crunch] (processed image to cache entry C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\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 sketch_170326a-debug-unaligned.apk and signing it with a debug key...

-post-package:

-do-debug: Running zip align on final apk... [echo] Debug Package: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\sketch_170326a-debug.apk [propertyfile] Creating new property file: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\build.prop [propertyfile] Updating property file: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\build.prop [propertyfile] Updating property file: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\build.prop [propertyfile] Updating property file: C:\Users\KAT\AppData\Local\Temp\android7533559375860661968sketch\bin\build.prop

-post-build:

debug

Answers

  • edited March 27

    @katejess===

    all these warnings are not importants (these are imports made automatically by processing and unused by your code)

    as for the emulator = verify what is its api (you can edit the AVD in the AVD manager menu); it must be at least 16 (or the min targetSdk in your Manifest)

    and try with some real device

  • I've changed the API to 23 but now the emulator doesn't seem to load. It's been an hour and it still just shows the android logo.

Sign In or Register to comment.