Android App created with Kivy (Buildozer) crashes on phone, but why? - python-2.7

I have some problems with an App, which I wrote with kivy an packaged with buildozer is always crashing when I try to run in on my phone. On my PC I use Ubuntu 14.10 and I don't get any error when compiling it (buildozer android debug). Then I send it on my SmartPhone and I install and run it, but it just loads and after a few seconds it crashes. By the way the kivy program is not very big.
Could someone help me, please? And sorry for my bad grammar ;)

Try using kivy-launcher just put your main.py and other files and run it and you can debug logs inside log directory. Then once you got all the error fix build an apk and use it.

If you are using kivy and your app loads some images, then there is no problem. But if you are using some other packages like pygame to load images, it will crash. Or if you are working in some files like reading or writing a text file, it will crash. Because when you package your app with buildozer, It will move the additional files of your app (.txt, .png) to a different location. So your python file fails to find the additional files in your specified location.
To solve this, do some corrections in your python file like changing the path of the additional file from the current directory of the python file to the path that is referred below.
PATH = "/data/data/#package domain#.#package name#/files/app"
In the above path change #package domain# with the domain of your package and #package name# with your package name.
All the additional files of any app that is installed in an android device will go to this location.
Try out this. All the best.

Buildozer.spec, use the following setting
Tittle= abc
Package.name=abc
Package.domain=org.abc
Include all your files eg.png,txt etc
Requirements= python3,kivy==2.0.0,kivymd, pillow,kivy-deps.angle,kivy-deps.glew,kivy-deps.sdl2
Uncomment android.logcat.
Now make sure your phone is on developer mode, connect your phone to the computer, turn on USB debugging, open a terminal,
cd abc
sudo apt install scrcpy
Type
sudo apt install adb
type
scrcpy
your phone will appear on your computer.
Type
buildozer android debug deploy run logcat.
adb logcat -s python
Run your app on your phone ( ensure you phone is connected to your computer); your log file will appear

Related

How to modifiy path for JDK for NeurophStudio

I tried do install NeurophStudio on Win 10, but when i try to run it i got this message
I installed this program on my hard drive, but my windows is installed on my SSD.
How can i change --jdkhome destination on NeurophStudio, because i didnt install any NetBeans?
What do i need to run to enter that --jdkhome instrunction, and how to I enter my path like C:\bla\bla\jdk12 or C:/bla/bla/jdk12
UPDATE:
I tried installing it on my SSD, but same result as before.
When i run javac --version in cmd, i get this:
I have java jkd path in JAVA_HOME aswell:
In windows try this: (Works for some people)
First install latest version
https://www.oracle.com/java/technologies/javase-downloads.html
Find the instalation Neuroph Studio folder and when look for a neurophstudio\etc\neurophstudio.conf file.
Open it with e.g notepad++ and search this property#jdkhome="/usr/local/java/jdk1.8.0_20"
Update it for your actual path like this jdkhome="C:\Program Files\Java\jdk-15.0.1" and remove #.
Save and exit.
If this solution remove initial error messege box, but program after launch quit immediately probably you didn't update your JDK (latest version).
It says it can't find the JDK, but it's actually looking for the JRE. Install that, and you should be good.

macOS Catalina: trying to install content to the system volume

I have apps that I distribute as .pkg files created using pkgbuild and productbuild. With macOS Catalina, this doesn't work any more. The installer complains that I'm trying to install content to the system volume.
I posted three weeks ago thinking the error had to do with bundling a Java runtime. It turns out it has nothing to do with Java.
To test it I have the smallest possible project called Hello with a main window and a button to click. In XCode, I do Product -> Archive, then Distribute App, and Copy App. This creates a directory Hello 2019-12-18 15-01-07 with contents Hello.app. The app works fine. I then
pkgbuild --root *7 Hello.pkg
which creates Hello.pkg.
When I double-click Hello.pkg in the finder the installer presents me with screens for Introduction, Destination Select (only one option is offered), and Installation type ("Standard Install on Macintosh HD"), then asks me for my password. It then says, "This package is incompatible with this version of macOS. The package is trying to install content to the system volume. Contact the software manufacturer for assistance."
It makes no difference if I codesign and notarize. Productbuild only adds one more layer to the failing process.
What am I missing?
We could fix the issue by using the option
--install-location
of the pkgbuild command.
If the
--install-location
option is not used, pkgbuild uses / as the default install location in many cases.
In macOS Catalina, only certain folders are writable. Refer this link for more details.
In our case, the package installation succeeded only when we specified one of the writable folders such as
/usr/local
/opt
/Applications
as the default install location.

Failing to install sqlite3 plugin for electron project on windows

I am trying to include sqlite3 in an electron project I am getting my hands dirty with. I have never used electron, nor Node before, excuse my ignorance. I understand that to do this on Windows, I need Python installed, I need to download sqlite3, and I need to install it.
As per the NPM sqlite3 page, I am trying to install it using npm install --build-from-source
It always fails with
unpack_sqlite_dep
'python' is not recognized as an internal or external command,
operable program or batch file.
I have Python 2.7 installed and the path has been added to environment variable PATH. I can verify that if I type 'python' in cmd, I get the same response. BUT, if I type 'py', it works....
So, my question is: how can I make node-gyp use the 'py' command instead of 'python' when trying to unpack sqlite3?
If this is not possible, how can I make 'python' an acceptable command to use?
I am using Windows 10 if this helps. Also, please let me know if I can do this whole procedure in a different way.
Thanks for any help!
This has been resolved....
Uninstalled Python 2.7.13. Reinstalled, added path to PATH variable again, now command 'python' works just fine...

Error while accessing sqlite3 shell from django application

When I run python manage.py dbshell command I get this error:
Error: You appear not to have the 'sqlite3' program installed or on your path. The solution is partly hinted at in the second post of this thread. But how it can be solved on ubuntu? The python I'm using is version 2.6.
Installing the sqlite program should solve the problem:
sudo apt-get install sqlite3
(or use synaptic if you prefer a GUI interface)
To download SQLite, you open the download page of the SQlite website.
First, go to the https://www.sqlite.org website.
Second, open the download page https://www.sqlite.org/download.html
SQLite provides various versions for various platforms e.g., Windows, Linux, Mac, etc. You should choose an appropriate version to download.
For example, to work with SQLite on Windows, you download the command-line shell program as shown in the screenshot below.
The downloaded file is ZIP format and its size is quite small.
Install SQLite
Installing SQLite is simple and straightforward.
First, create a new folder e.g., C:\sqlite.
Second, extract the content of the file that you downloaded in the previous section to the C:\sqlite folder. You should see the sqlite3.exe is in the C:\sqlite folder.
To verify the installation, you perform the following steps:
First, open the command line window and navigate to the C:\sqlite folder.
Second, enter sqlite3, you should see the following window
Third, you can type the .help command from the sqlite> prompt to see all available commands in sqlite3.
Fourth, to quit the sqlite>, you use .quit command as follows:
Append the directory where you installed the sqlite to the system path variable in windows environment variables and kaboom. Mine worked just fine.
Happy programming...!

Using QtMobility in QtCreator: Setup?

I am trying to set up a development environment to play around with developing Qt apps for Symbian devices. I have succesfully set up the environment and am able to create simple apps such as HelloWorld and get them to run on my device. I would now like to try using the QtMobility package, but I am struggling to get it to work in QtCreator.
I got some sample code for using the camera (initially I only had QtMobility 1.0.2, but I have now downloaded the 1.1.0 technology preview version). I followed the instructions in the help file to install it, here is what I did:
Extracted the zip file to C:\QtMobility
Opened a Qt Command prompt and ran configure (in the QtMobility directory)
Ran mingw32-make
Ran mingw32-make install
Finally I updated my PATH variable to include C:\QtMobility\lib
I went back to QtCreator (restarted it) and looked at the cpp file that first calls the macro QTM_USE_NAMESPACE but it is still underlined in red, because it can't find the qmobilityglobal.h file.
Does anyone know if I have missed anything out during the installation that will tell the QtCreator where to find the QtMobility header files?
mingw32-make suggests you're building for win32-mingw target environment. To work with Symbian SDKs, you should be building for e.g. symbian-abld instead. The configure.bat script will auto-detect the target you are building for. Just make sure that QT_PATH environment variable points to a location where you have a Symbian build of the Qt toolchain.
(Also note that make install is unnecessary with symbian-abld - the build step already puts everything in place in Symbian SDK directories.)