Android Processing importing Sound library error

Hello everyone!

I have an issue with the Sound library import into the Android Mode. All works fine when in Java Mode, all sounds are playing as they should, but in Android Mode the " import processing.sound.* " line of code gives me the following error:

Exception in thread "Thread-119" java.lang.NullPointerException: Cannot read the array length because "list" is null
	at processing.app.Library.wrapFiles(Library.java:427)
	at processing.app.Library.getApplicationExports(Library.java:437)
	at processing.mode.android.AndroidBuild.copyImportedLibs(AndroidBuild.java:839)
	at processing.mode.android.AndroidBuild.createAppModule(AndroidBuild.java:481)
	at processing.mode.android.AndroidBuild.createProject(AndroidBuild.java:262)
	at processing.mode.android.AndroidBuild.build(AndroidBuild.java:223)
	at processing.mode.android.AndroidMode.handleRunDevice(AndroidMode.java:294)
	at processing.mode.android.AndroidEditor$17.run(AndroidEditor.java:421)

Without the abovementioned line of code, all works well!
What is the problem? Why the Sound library doesn’t work in Android Mode?
I use the Processing 4.3 IDE.
Also the “Thread-119” portion gets changed with other numbers each time I compile my code!

Many thanks,
Sammy

1 Like

I’ve been having an identical error. Have you managed to sort it, or find another Sound library that works on both Android and PC?

  • Josh

@SammySylvester84 @joshuamv I don’t think this is an issue with the Processing Sound library, rather Android Mode in general. It appears that both sound libraries that support Android (P4/Sound and Pd4P3) both throw cryptic errors that seem to be related to importing external libraries.
I can confirm that Pd4P3 works on Android via Android Studio, but not when using Android mode, at least on Windows.
I will report this to the processing-android team.

1 Like

Looks like this was already reported last year. You can see @kevinstadler’s fix at the bottom. I haven’t confirmed it that works or not.
Cannot build Android Mode sketch that uses any native code libraries · Issue #738 · processing/processing-android (github.com)

1 Like

I had a lot of problems with the Sound Library.
I removed the existing Sound library and downloaded the last version of Processing-Sound from github (Download the zip file and extract it into the Processing Library Directory). You can run the sketches from “Examples” to check if they run correctly.