What is the Processing "Temp" folder?

Hello,
I had an error while building a project in android mode, says the directory contains non ASCII characters. that is correct, the user folder in my windows machine contains non ASCII characters and actually I don’t really want to change it because it feel like a big mess. But I have few questions about this directory.

the error is pretty long, but I saw in the beginning:

Build folder: C:\Users\7250~1\AppData\Local\Temp\android1653928038104850017sketch (HERE: the temp folder)

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\לקוח\AppData\Local\Temp\android1653928038104850017sketch\app\build.gradle' line: 1(also HERE, the same temp folder again)

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
   > Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/95744 for details. This warning can be disabled by adding the line 'android.overridePathCheck=true' to gradle.properties file in the project directory.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org
  1. I see the Temp folders, with tons of folders that looks like every time I built or compiled a project, and also some other files, but I am not so sure if that is really what it is. what are these folders and what their purpose?

  2. should I get rid of these files? and if so, how?

  3. how can I change the directory of these files? I want them to be generated somewhere else

Thank you for any answer,
Arad.

I believe the “Temp” folder is just the temporary folder files are stored in before they are saved somewhere by the user. I think that this is just set as the default folder for saving your Processing Andriod files. Have you tried going into the AppData folder and moving the stuff in Temp that you want to keep into another folder?

Processing uses: %TEMP%

Hi @aradarbel10
The temp folder, as said above, it is a place where sketches are stored temporarily if they are not saved. However, after you save your files, the temp folders works as a temp folder, meaning that Processing uses it to store temporal files generated when you build any of your projects. I can only talk about Processing java and Processing Android as I am not sure how it is used in other modes (probly similar if not the same).

In Processing java, when you build your code, processing transpilates your pde code into java. In short, it creates the proper files and then it builds them using the standard java commands. One of the steps in this process is converting your pde to java and adding a main() function to it.

In Processing Android, the temp folder is used to, again, generate the java file version of your projects. Then it creates the apk file and then processing loads this file into your mobile device.

You will notice that this temp folder grows over time. If you are using only java, it grows slowly. If you use Android, then your temp folder can grow faster. This means that you need to go back and clean your Processing temp files from time to time. Please make sure you do this clean up only when you are not running the PDE for obvious reasons. Notice Processing never does the clean up for you, just to clarify.

You can delete them. If in Windows, select those folders and move them to the trash can. In linux, you can create a script that removes the files for you so you don’t have to call the rm command all the time.

Not sure if it can be changed. If you dont find a way to change this, then you could create a ticket and make this a feature request. You can do it here: Issues · processing/processing · GitHub
Please let us know if you find a way to do so.

Kf

@aradarbel10===

  • nothing to add to gotoLoop answer for your first question

  • as for the second one: when compiling for android P5 not only “transforms” your code in java but also creates the real structure of an apk with standards folders && subfolders: res, assets and so on. Can you get rid of these folders: yes, you put them to the trash! (of course closing your pde instance when you do that) : in this case you “force” the compiler to make te whole work again and so it will take much time.MUST you do that (as kfrajer says) i dont think so: 2 years ago i have seen that Android p5 mode was “eating” my hard disk and found that it was for this reason: i have put a post to github for that and now i can see that these folders disappear without doing nothing, probably after some time, days or weeks.

  • as for the third one i dont see anywhere how to change the path (to temp) inside p5; with AS, or Eclipse, that can be done very easily, same way than the path to SDK. Perhaps it is possible to create env var for that with the command line, not sure about it, more probably using (also with command line ) the AAPT2 syntax, which allows to specify the output folder:

see here for more details about “path” command:https://developer.android.com/studio/command-line/aapt2#compile-syntax

Note that this problem seems to be different working with windows 10, linux or OSX (which uses a very different path).

  • finally, for your error, as you guessed it is generated by non ASCI chars in your path, probably your user-name. 3 solutions for that: you create another user and dont use these chars, you add your P5 folder to this user (perhaps only wilth a symlink?); or you try to change this name to ASCi (i am afraid that this solution affects other apps!); or you add to your gradle properties: com.android.build.gradle.overridePathCheck=true (because the error is generated by “checking” the path)

1 Like
1 Like