Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app crashes when trying to pause/play a sound file in onPause() or onResume() functions #101

Open
AniManOtaku opened this issue Feb 10, 2024 · 0 comments
Labels
Android bug Something isn't working

Comments

@AniManOtaku
Copy link

here is the code:

import processing.sound.*;

SoundFile menuTheme;

void setup(){
  menuTheme=new SoundFile(this, "s8.wav");
  menuTheme.loop();
}

void draw(){
  background(255);
}

@Override
public void onBackPressed(){
  println("on back pressed");
  menuTheme.stop();
  super.onBackPressed();
}

@Override
public void onPause(){
  println("on pause");
  menuTheme.pause();
  super.onPause();
}

@Override
public void onResume(){
  println("on resume");
  menuTheme.loop();
  super.onResume();
}

here is the error:

Initializing build sequence…
Deleted old build folder
Detected architecture armeabi-v7a
java.io.FileNotFoundException: /data/user/0/com.calsignlabs.apde/files/tmp/aapt (Text file busy)
	at java.io.FileOutputStream.open0(Native Method)
	at java.io.FileOutputStream.open(FileOutputStream.java:287)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:223)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
	at com.calsignlabs.apde.build.Build.createFileFromInputStream(Build.java:1941)
	at com.calsignlabs.apde.build.Build.createFileFromInputStream(Build.java:1932)
	at com.calsignlabs.apde.build.Build.build(Build.java:732)
	at com.calsignlabs.apde.build.Build.build(Build.java:287)
	at com.calsignlabs.apde.EditorActivity.lambda$runApplication$15(EditorActivity.java:3395)
	at com.calsignlabs.apde.EditorActivity.$r8$lambda$yRcQupdy0sH1fAylZELq0DvnNtA(Unknown Source:0)
	at com.calsignlabs.apde.EditorActivity$$ExternalSyntheticLambda28.run(Unknown Source:4)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
	at java.lang.Thread.run(Thread.java:764)

Packaging resources with AAPT…
Compiling with ECJ…

Dexing with DX Dexer…
Launching sketch preview…
Finished in 9050ms










Failed to delete file: /data/user/0/com.calsignlabs.apde/app_build/support-res
Failed to delete file: /data/user/0/com.calsignlabs.apde/app_build/assets
Failed to delete file: /data/user/0/com.calsignlabs.apde/app_build
java.io.FileNotFoundException: /data/user/0/com.calsignlabs.apde/app_build/assets/s8.mp3 (No such file or directory)
	at java.io.FileOutputStream.open0(Native Method)
	at java.io.FileOutputStream.open(FileOutputStream.java:287)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:223)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
	at com.calsignlabs.apde.build.Build.copyFile(Build.java:1987)
	at com.calsignlabs.apde.build.Build.copyDir(Build.java:2019)
	at com.calsignlabs.apde.build.Build.build(Build.java:646)
	at com.calsignlabs.apde.EditorActivity.lambda$autoCompile$9(EditorActivity.java:2087)
	at com.calsignlabs.apde.EditorActivity.$r8$lambda$K0CTn2EuOMUNHNIuNlGXHlxgPxw(Unknown Source:0)
	at com.calsignlabs.apde.EditorActivity$$ExternalSyntheticLambda27.run(Unknown Source:4)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
	at java.lang.Thread.run(Thread.java:764)
java.io.FileNotFoundException: /data/user/0/com.calsignlabs.apde/files/tmp/aapt (Text file busy)
	at java.io.FileOutputStream.open0(Native Method)
	at java.io.FileOutputStream.open(FileOutputStream.java:287)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:223)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
	at com.calsignlabs.apde.build.Build.createFileFromInputStream(Build.java:1941)
	at com.calsignlabs.apde.build.Build.createFileFromInputStream(Build.java:1932)
	at com.calsignlabs.apde.build.Build.build(Build.java:732)
	at com.calsignlabs.apde.EditorActivity.lambda$autoCompile$9(EditorActivity.java:2087)
	at com.calsignlabs.apde.EditorActivity.$r8$lambda$K0CTn2EuOMUNHNIuNlGXHlxgPxw(Unknown Source:0)
	at com.calsignlabs.apde.EditorActivity$$ExternalSyntheticLambda27.run(Unknown Source:4)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
	at java.lang.Thread.run(Thread.java:764)
AAPT failed with error code 1
java.io.FileNotFoundException: /data/user/0/com.calsignlabs.apde/files/tmp/aapt (Text file busy)
	at java.io.FileOutputStream.open0(Native Method)
	at java.io.FileOutputStream.open(FileOutputStream.java:287)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:223)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
	at com.calsignlabs.apde.build.Build.createFileFromInputStream(Build.java:1941)
	at com.calsignlabs.apde.build.Build.createFileFromInputStream(Build.java:1932)
	at com.calsignlabs.apde.build.Build.build(Build.java:732)
	at com.calsignlabs.apde.EditorActivity.lambda$autoCompile$9(EditorActivity.java:2087)
	at com.calsignlabs.apde.EditorActivity.$r8$lambda$K0CTn2EuOMUNHNIuNlGXHlxgPxw(Unknown Source:0)
	at com.calsignlabs.apde.EditorActivity$$ExternalSyntheticLambda27.run(Unknown Source:4)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
	at java.lang.Thread.run(Thread.java:764)
java.io.FileNotFoundException: /data/user/0/com.calsignlabs.apde/files/tmp/aapt (Text file busy)
	at java.io.FileOutputStream.open0(Native Method)
	at java.io.FileOutputStream.open(FileOutputStream.java:287)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:223)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
	at com.calsignlabs.apde.build.Build.createFileFromInputStream(Build.java:1941)
	at com.calsignlabs.apde.build.Build.createFileFromInputStream(Build.java:1932)
	at com.calsignlabs.apde.build.Build.build(Build.java:732)
	at com.calsignlabs.apde.EditorActivity.lambda$autoCompile$9(EditorActivity.java:2087)
	at com.calsignlabs.apde.EditorActivity.$r8$lambda$K0CTn2EuOMUNHNIuNlGXHlxgPxw(Unknown Source:0)
	at com.calsignlabs.apde.EditorActivity$$ExternalSyntheticLambda27.run(Unknown Source:4)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
	at java.lang.Thread.run(Thread.java:764)
java.io.FileNotFoundException: /data/user/0/com.calsignlabs.apde/files/tmp/aapt (Text file busy)
	at java.io.FileOutputStream.open0(Native Method)
	at java.io.FileOutputStream.open(FileOutputStream.java:287)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:223)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
	at com.calsignlabs.apde.build.Build.createFileFromInputStream(Build.java:1941)
	at com.calsignlabs.apde.build.Build.createFileFromInputStream(Build.java:1932)
	at com.calsignlabs.apde.build.Build.build(Build.java:732)
	at com.calsignlabs.apde.EditorActivity.lambda$autoCompile$9(EditorActivity.java:2087)
	at com.calsignlabs.apde.EditorActivity.$r8$lambda$K0CTn2EuOMUNHNIuNlGXHlxgPxw(Unknown Source:0)
	at com.calsignlabs.apde.EditorActivity$$ExternalSyntheticLambda27.run(Unknown Source:4)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
	at java.lang.Thread.run(Thread.java:764)
java.io.FileNotFoundException: /data/user/0/com.calsignlabs.apde/files/tmp/aapt (Text file busy)
	at java.io.FileOutputStream.open0(Native Method)
	at java.io.FileOutputStream.open(FileOutputStream.java:287)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:223)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
	at com.calsignlabs.apde.build.Build.createFileFromInputStream(Build.java:1941)
	at com.calsignlabs.apde.build.Build.createFileFromInputStream(Build.java:1932)
	at com.calsignlabs.apde.build.Build.build(Build.java:732)
	at com.calsignlabs.apde.EditorActivity.lambda$autoCompile$9(EditorActivity.java:2087)
	at com.calsignlabs.apde.EditorActivity.$r8$lambda$K0CTn2EuOMUNHNIuNlGXHlxgPxw(Unknown Source:0)
	at com.calsignlabs.apde.EditorActivity$$ExternalSyntheticLambda27.run(Unknown Source:4)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
	at java.lang.Thread.run(Thread.java:764)

@kevinstadler kevinstadler added bug Something isn't working Android labels Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants