Android SDK MonkeyRunner 25.3.2 Won't Run - monkeyrunner

So I upgraded Android SDK tools today and now I'm having a problem getting monkeyrunner to run. I did the standard which is (from the command prompt)
D:\Android\SDK\tools\bin\monkeyrunner.bat D:\ScriptName.py
Note 1: The directory of monkeyrunner.bat changed in this release, so I had to update my command line accordingly.
That fails with the message:
SWT Folder '..\framework\x86_64' does not exist.
I can fix that by editing monkeyrunner.bat and instead of having frameworkdir be set to 'lib' it gets set to '..\lib', the actual location of the monkey runner jar file.
However, when I implement this fix it then gives the error:
Cannot run program "..\framework\adb.exe" cannot find the file specified.
I'm kind of stuck here because no matter what I change in monkeyrunner.bat I get the same message, which indicates to me that the jar file has this directory hardcoded in it or something. It should probably be "....\platform-tools\adb.exe"
Any help would be appreciated.

-open monkeyrunner.bat in notepad
change set frameworkdir=. to set frameworkdir=..\lib everywhere
find the line call "%java_exe%" -Xmx512m "-Djava.ext.dirs=%frameworkdir%;%swt_path%" -Dcom.android.monkeyrunner.bindir= -jar %jarpath% %*
change the value of Dcom.android.monkeyrunner.bindir to the path of the folder containing adb.exe. Mine was under platform-tools

Related

I am trying to convert a python .PY file to .EXE. But the EXE file won't run because of "Fatal Error Detected Failed To Execute Script Error" Help Pls

I am a absolute beginner with Python. What I have done so far is I have installed Python with IDLE, Pycharm, Pygame-zero and Pyinstaller too. I have a (.py) file game I would like to turn into a (.exe) file. So I can release my game for my friends to play.
I have entered this command into CMD window "pyinstaller --onefile -w gamename.py"* (*My game is not really called "gamename". I have called it that in this code above. For this example only.)
When in the file folder of my game and then Pyinstaller converts my file into the (.exe) file. But everytime I try to run this file. It fails with this error message - "Fatal Error Detected, Failed To Execute Script Error".
I have watched all kinds of YouTube videos trying to solve this problem and have tried these following fixes:
Updated Pyinstaller (4.3).
Updated Python (3.9.5).
Changed the path in Enviroment Variables to point to Python39\Scripts and resetting my computer.
Coverted the (.py) file to (.exe) by including the console window. Then after running the program after when the console window disappears. Opening the CMD window again and typing the file directly "gamename.exe" to run.
Installing auto-py-to-exe program.
Each time deleting the Main, Dis and Spec files and moving the (.exe) file into the main file folder. With the resources for the games. Music, Images and Sounds.
Testing out my Python script to check. If it doesn't have any errors while loading through IDLE and it doesn't. It works straight away, I can play my game through IDLE. There is no errors in the code of my game script.
And after trying all of these solutions it still hasn't solved this issue.I still have the same error message appearing when trying to run my game. Now I have found out what the meaning is to this error message that appears. Which is:
"Fatal Error: failed to execute
This means something has gone wrong as it's giving you a visual warning about it; this is not an error, it's a warning; the real error has been printed to stdout/stderr. If you open the executable using the terminal or something else that will preserve the console output, you will most likely see a Python error telling you what went wrong. Fixing this and repackaging is the solution to this issue".
I have remade the (.exe) file including the console window and it does explan what the error is. When I try to run my game, the error comes up as:
"FileNotFoundError: {Errno 2} No such file or directory: C:*****\Local\Temp_MEI58602\pgzero\data\icon.png {4268} Failed to execute script.
Any suggestions? On how to fix this error please. So I can run and play my game outside of Python on any PC.
A Possible Answer:
I have found a webpage that has the possible answer to my problem. But I don't know what they mean, because I am a beginner with Python. Can anybody read this and break it down for me? Here is what it say's:
"Pyinstaller packaging exe, missing icons and other issues
Reason
When the exe runs, it will decompress a resource folder named "_MEI*" to a temporary directory on the computer, and delete it when the program ends.
uses a path like ‘\icon.png’ in the program. When the exe is running, it will only search for its own directory, of course it cannot be found.
Two, the solution
Make sure the picture is in this temporary resource folder
This can be done by editing the'.spec' configuration file to add pictures.
(Note: .spec is the file generated by Pyinstaller last time, in your python project directory.)
These are the three pictures I used, which is actually adding three tuples to the "binaries" list
Before the comma is the address of the picture in the python project, after the comma is the address of the package into the ‘_MEI*’ temporary folder.
I have built an ‘img’ folder to store pictures in it. Just put a dot in the root directory, such as (’./img/info.png’,’.’)
Finally, run when packagingpyinstaller program entry.spec, You can add the picture resource.
(Note: Other external resources can also be added in this way, such as .ini, .txt, .exe, etc.)
Make sure the program can find this path
Because the name of the temporary directory is different each time, a method is needed to dynamically obtain this path.
The code is presented, and the core statement is ‘os.path.realpath(sys.path[0])’.
Python running effect is as follows:
Package it as an exe, drag it to the cmd window and run it."
Here is the link to the webpage to the article. Because it makes use of screenshots that I can't include on this webpage;
(https://www.programmersought.com/article/94965073850/)
Please read this acticle and break it down for me. It does seem to be explaining the solution to my problem. But what does it all mean? What pictures is he talking about? Please explain.
I am not sure why but PyInstaller doesn't seem to bundle everything needed for Pygame Zero, including that icon.png file. The solution is simple, though. You just need to use pyinstaller --collect-all pgzero --onefile -w <scipt_name>. If your game has sounds, images or anything like that, remember to include those specific folders as well using --add-data <file_or_folder>. Also, make sure your script includes the following lines.
import pgzrun
# GAME CODE HERE
pgzrun.go()
I hope it helps, even though it is a little late.

QtCreator - no rule to make target when building windeployqt

I have installed C:\Qt\5.6\ on Windows 10. I have started QtCreator from there, and opened C:\Qt\5.6\Src\qttools\qttools.pro in it. I expanded the node, and right-clicked on designer and did Build "designer", it built fine (using mingw)
Now, I try to do the same for windeployqt, but it fails with:
:-1: error: No rule to make target 'C:/Qt/5.6/mingw49_32/lib/libQt5Bootstrapd.a', needed by '..\..\bin\windeployqt.exe'. Stop.
What am I missing, and how can I get windeployqt to compile?
Ok, I think I got it. First, I tried looking for *bootstrap* named files in C:\Qt, and it turns out, this file exists:
C:\Qt\5.6\mingw49_32\lib\libQt5Bootstrap.a
So, the only difference from the filename in the error message, libQt5Bootstrapd.a, is that there isn't a d at the end of the filename (without the extension) - and then I remembered, that d probably represents a Debug version of the .a library.
As you can see on the screenshot, there is a button down left in the Qt Creator GUI, where it says "qttools ... (monitor icon) ... Debug". This is "Deploy Configuration" - I clicked there, and set the Deploy Configuration to "Release" - and then tried building windeployqt again - and this time, it worked without an error message.

.jar file quickly opens, then closes

I am trying to make a FTB server that me and my friends can play on. So, I downloaded the .jar and it said "Choose what to open with. SO, I assigned java binary to what it is opened with. It then now opens, but then not less then a second later, closes. I tested with other .jar files. Each one of them either didn't open at all, or opened quickly, then closes. WHat could be wrong?
More than likely the jar (which is just a zip of the programs main classes) is running into an error and exiting.
In order to find and resolve that error you need to see the error message!
first locate the jar file in either your terminal or command prompt and run the following command
java -jar <YOUR_JAR_FILE_NAME>.jar
You will see any output sent from the java program to the console so you can diagnose and resolve it!
In your terminal, where your .jar file is located, type and run the following command :
java --enable-preview -jar <JAR FILE NAME>.jar
Most probably the .jar fill will open, or it will show you the error, which you can then resolve.

JWrapper Build Failed OutOfMemoryError

I am running this build through the JWrapperApp. When ever I try and build my 86.7Mb .jar file, it gets to the step of adding the .jar file to archive then fails with a java.lang.OutOfMemoryError. I have tried only building for one OS at a time, as well as adjusting some other settings but none seem to have an effect.
I have successfully been able to build the sample-app and I know my .jar file is in working order.
I would suggest you try starting your JWrapperApp with more memory by passing the JVM option -Xmx1024m or greater to it. This entails starting the JWrapperApp packager from the commandline/shell using the following command:
java -Xmx1024m JWrapperApp.jar

netbeans, Qt, & Qmake "command not found"

All,
I am (trying to) using Netbeans to build a simple Qt app (from a tutorial) and I cannot build it because I get this error:
/C/Qt/2010.02.1/qt/qmake/qmake.exe VPATH=. -spec win32-g++ -o qttmp-Debug.mk nbproject/qt-Debug.pro
make[1]:/C/Qt/2010.02.1/qt/qmake/qmake.exe: Command not found
when the file is exactly there, and I can open a terminal and execute it.
Note in the error message: "/C/Qt..." The actual path is C:/Qt...
I have used the tools/options/c++ dialog to browse to the file and select it, and it is specified as C:\Qt... just like all the other tools. What is corrupting the C: and making it /C/ ?
Now, if I remove the path to qmake, and have it use the PATH environment variable, it finds it, but then it fails due to 'multiple targets'...
Obviously, pilot error, but where? I have seen several posts on this, and they all say to make sure it is in the path, and it is, so now what? (I can open a terminal and type 'qmake' and I get the 'Usage: qmake..." so I know it is visible.
Windows 7, Netbeans 7.0, MinGW (I also have cygwin installed...).
Any and all help greatly appreciated.
:bp:
Addenda: I changed the path to my 'make' to use the MinGW one rather than the cygqin one, and now it can find qmake, but I get other errors: 'Could not find mkspecs for your QMAKESPEC(win32-g++) after trying:...
Any additional thoughts?
QMake requires more than just a path to work correctly. On my Windows box, there is a menu option for 'Qt Command Prompt' under the 'Qt SDK 2010.05' group in the Start Menu. Running it produces the following:
Setting up a MinGW/Qt only environment...
-- QTDIR set to C:\Qt\2010.05\qt
-- PATH set to C:\Qt\2010.05\qt\bin
-- Adding C:\Qt\2010.05\bin to PATH
-- Adding C:\WINDOWS\System32 to PATH
-- QMAKESPEC set to win32-g++
You will want to make sure the environment you launch qmake in has all of those set.
The most probable reason you are see '/C/...' is because you are causing a mingw shell to run when you execute your build.

Resources