Files won't run on another system

I recently got a new computer and copied the Processing folder to the new system in order to continue development of these projects (most in Android mode). Unfortunately the source code will not run on the new system and generates the error shown below. If I copy/paste the code into a new file and save it on the second system then it will run ok. Likely it is a signing issue which prevents the code from running on a new system. Does any one know how to fix this or a work around that is less time consuming than copy/pasting each file.

err

You should try a clean installation instead. Providing you follow all the steps there shouldn’t be any problems.

Also clean any previous installations you may have had and remember there are files in the appdata folder.

  1. I don’t know what you mean by a ‘clean’ installation. It’s a brand new computer and Processing was only installed one time from the official website.
  2. Where is the ‘appdata’ folder?

ok I didnt notice you said new. Have you downloaded an sdk and signed the agreement on the new computer?

I have Android Studio on the same system so I believe that’s where it got the SDK. Code runs fine as long as the file was saved on the new system (Mac).

I think I found the problem. Both computers have been connected through a USB port to the same Android device (Samsung tablet) during app development. When I started using the new computer and running the code on the Android device there was already a Processing app there from the old computer. If I uninstall this old app on the Android device first, then compile the code from the new system it will run without error. Therefore it appears that the app signature is different depending on which computer it’s compiled on. I have dozens of these developmental apps on my tablet from the old system and probably need to uninstall them before trying to compile the code on the new system.

Does anyone know how to open an app folder system on an Android device to see what files have been included (similar to ‘Show Package Contents’ on Mac)? If there is a signature file I’d like to able to read it. It would be nice to use the same signature on different machines, but I don’t know if this is possible for security reasons.

1 Like

@svan === each computer generates a debug key which is used for signature: find the debug key,copy it and change on the second computer; normally you can find the debug keystore in a folder called users/.android which can be invisible.

@akenaton Thanks for the information. Is that debug key stored inside of the Android app itself (on a mobile device) or on the desktop computer which generates the app? I’m not sure how to find users/.android; I’ve looked in the root directory of my Mac and inside the Processing folder to no avail. I would like to disassemble the app on the mobile device but have no idea how to do it. Alternatively perhaps I could export a Java app to my desktop and try to disassemble that so I can see how it is constructed.

@svan === this debug Key is created and stored inside the computer; then when you compile it is saved inside the Apk: that why you got this error when you changed the computer; on MAC i have explained that you can find this key inside the USERS folder/.Android/, folder which is (default) invisible (.) but you can easily make it visible eg with onyx; inside this folder you can find a lot of things, and the debug key; as for seeing what is in a .apk, change .apk for.zip and unzip it. But there are also special tools for that.

Adding on to it, This happens when the already installed app has different certificates, that might be because the APK is being signed with a different Keystore file on another system. To resolve this you can replace the Keystore file from the previous system with keystore file at the new system(location is android\keystore\android-release-key.keystore). But for that case, it is required that you know the password from the previously generated Keystore because every time for signing APK, you will be asked for a password. The password can be different in case if the android-release-key.keystore gets replaced.
I would like to know the way you are running the application because if the process is to install debug APK on a device or emulator then it might be the case that the app is being signed with C:\Users\Name\.android\debug.keystore
In that case, you can try replacing the debug.keystore file from the previous system to the new system. Make sure to create a backup and to remember the things you are configuring in case if something goes wrong.
Thanks and regards!

@Rupesh_Kumar Thank you for your response and information. I am entering source code in the Processing IDE on a Mac and compiling it in the Android mode to a Samsung S2 tablet. I am not using File/Export Signed Package. Processing leaves a generic app icon on my tablet for each sketch that I compile. When I try to run the same sketch on a second Mac Processing will refuse to compile unless I uninstall the app created by the first machine; then it will compile ok. Your explanation and that of @akenaton have been very helpful. Unfortunately I can not find the offending keystore file on my system. The closest that I can come is a keystore folder buried deep in the sdk: /Users/xxxxx/Library/Android/sdk/sources/android-30/android/security/keystore. There is a bunch of .java files in this folder but no android-release-key.keystore file. I will keep looking. I can continue to work around it by uninstalling the previous app compiled by the first system, which is not a terrible price to pay. At least Android allows me to keep dozens of developmental apps on my tablet at one time while my iPad allows only three, and then it refuses to compile any more until one is deleted and a certain period of time has passed.

Please clean all install files and reinstall itll work.

I have no idea how to do what you’re recommending. Do you want me to trash the Processing app in the Applications folder of my Mac and download another one? I just don’t understand how that would do anything to solve the problem.

Just delete any folders which processing has access to, making sure to back up any filee you need. Please search this forum as this topic has been answered many times and if even then you cqnnot install processing then please clarify the steps you have followed and proceed from there.

@svan :the problem has nothing to see with P5: as you have guessed by yourself it is a problem of signature of your apps installed on the phone by the first computer and so there are 2 solutions: first one is to uninstall these apps on the phone or device and then reinstall using the second computer; the second one is to find on the first computer the file where is saved this signature, called debugKey; as i have explained on mac you can find it inside a folder called .android which is an invisible one but on the path users, at the first level; when you find it you look inside and see that there is a file called debugKey, you copy it and on the second computer you paste it in the same folder, .android in place of the second signature: that s all. Of course before erasing the second one you can make a copy.

Hi @svan , on checking I observed that processing runs a Gradle’s task - ‘assembleDebug’ while runninng app on devices. Which generates APK signed by debug.keystore file. Location of debug.keystore file on Mac is ‘/Users// .android / debug.keystore’

I think replacing the debug.keystore file on new system from an older system will work fine since the alias name, password, filename, etc. will remain same. Also, I am not sure about Mac but .android folder can be hidden as the folder name starts with a dot character. I haven’t checked it across multiple systems but you can check and let me know.
All the best,
Thanks

@Rupesh_Kumar === that is exactly what i have said… And you are right: the folder is hidden as its name begins by a ., but you can easily solve that (on a Mac) using Onyx.

1 Like

@akenaton @Rupesh_Kumar I finally found the .android file using the technique below (except I opened Users/xxxx/ first not the MacHD)

Thank you both for your work on this. I will try copy/pasting the debug file later today.

SOLUTION: The above described technique of copy/pasting the debug.keystore file into the hidden .android folder at Users/xxxx/ (ie, Home directory) does indeed allow the same file to run on both systems without error. For safety reasons I took a Processing file compiled in Android mode from my new system and copied it to my old system and tried to run it; it failed as expected (error message shown in the first post). After making a copy of my old debug.keystore file I replaced the original file with a debug.keystore file from my new system and the new app ran on the old system without error. Since I have more old files than new files on my new system I will probably do the reverse to cut down of the number of old apps which have to be uninstalled. The downside is that then I will have to uninstall my new files but there aren’t as many of them. I never would have thought to look for a hidden folder, but the cmd+shift+dot makes it pretty easy to find it as long as you look in the Home directory of each system. Thanks for helping me solve this problem.