APK crash after converting with Buildozer - kivy

After I convert Python To APK using Buildozer my APK file crashes
is there something wrong in my requirements line
requirements = python3,kivy,kivymd,psutil,speedtest,pillow
import datetime
import threading
import random
from time import sleep
import psutil
import speedtest
from kivymd.app import MDApp
from kivy.lang import Builder
from kivy.core.window import Window
from kivy.uix.screenmanager import ScreenManager, Screen
from get_size import get_size
from get_size_bits import get_size_bits
from kivymd.uix.list import OneLineListItem, TwoLineListItem, MDList

You can use ADB to debug your APK file and see what is causing it to crash.
Android Debug Bridge is a tool that helps you debug Android based devices. The daemon on the Android device connects to the server on the host PC via USB.
You need to enable USB debugging on your Android device if you want to connect it to a computer and use it for development purposes. To do this, you need to enter the "Developer Settings" window and enable the USB debugging option. Once you have done this, you can connect your Android device to your computer using a USB cable.

According to buildozer documentation you can use
buildozer android deploy run logcat
this command can help you directly deploy to the android device and see the logcat in order to see what is crashing. Read all details here.
Additionally, buildozer is based on python for android so you can also see if any of that troubleshooting help you to identify the crash
https://python-for-android.readthedocs.io/en/latest/troubleshooting/

Related

Flutter logs don't work in Xcode console after upgrading to Flutter 2.5

I have updated Flutter to 2.5 and Xcode to 12.5.1. Since then, when I run the app on Xcode, no logs from Flutter code are displayed, only the logs in the native iOS code.
This is the default log I use which doesn't work now:
print('default print');
I have tried this log:
import 'dart:developer';
log('test log');
and it also doesn't work.
Any suggestions?

How does Flutter driver work with Android?

In android world to run UI test with ADB, you need to execute this command
adb shell am instrument -w com.tarek360.sample.test
but before running this command you need to install your test package and main application Android package files (.apk files) to your current Android device or emulator, more info here.
Normally the APKs package names will be in the following format:
Main APK: com.tarek360.sample
Test APK: com.tarek360.sample.test
but in Flutter world, when I run flutter drive, for example, the following command:
flutter drive --target=test_driver/app.dart
I see only the main APK has installed and I don't see any test APK has installed on my device, I'm wondering how does Flutter Driver works with Android, it's important for me to understand because I have very customized CI and I build APKs in a completely different environment than the test runner environment.
Tests on your computer use Flutter Driver to connect to Flutter Driver Extension, that you must enable separately, inside your application using TCP and send commands to it using adb with port forwarding

How to connect flutter to Bluestacks emulator?

I'm setting up an Android device for flutter development and need to have a lightweight emulator. How do I connect bluestacks to flutter? Since the android studio is too slow for my machine and I only have an iPhone.
Yes, You can connect Flutter to Bluestacks.
You have to enable adb on Bluestacks' configurations, by following:
gear icon > Advanced configs > (marks as true: enable ADB connection)
after that, you must to restart your bluestacks, then open a terminal and go to your Android SDK folder:
%localappdata%/Android/Sdk/platform-tools/
then type the follow commands:
adb connect localhost:5555
So, by now if you type flutter devices you will get the emulator device name on the list, then you can run your apps on it
In this case what I would like to suggest you is to download GenyMotion.
Is a very lightweight emulator and it has its own plugin for Android Studio.
I was on a similar situation with an AMD processor and this was a really helpful way for me to test my apps.
Here is the URL for download: http://cloud.geny.io/
Steps
Install the latest version(4.180.10.1006) of bluestack
Open the bluestack
Enable the adb by setting>preferences>tick "Enable Android Debug Bridge"
Open the cmd
Create a flutter project by typing "flutter create [projectName]"
Access to your project folder by typing "cd projectName"
Run flutter app by typing "flutter run"
How to enable adb over bluestack
Step1 - Click the setting(gear)
Step2- Click the preference
Step3 - Scroll Down to Enable Android Debug Bridge
Hello, I hope it's not too late for you - but:
You can use sublime text as editor and for running your app.
You can use command prompt (cmd) on windows and as an emulator, you can use Genymotion.
It will fit for you if you need a light editor along with a good emulator that does not take too much RAM space.
I have tested it, and it was running perfectly.
However, the problem were flutter packages for sublime text(coding helper).
I couldn't find any packages for sublime text, only dart. You can update the question for further information.
I hope you understand this and it will help you.

Does Appium need Xcode for run automated testing on iOS device?

I'm trying to run automated testing on iOS devices without installing Xcode, but seem like it doesn't work.
So I just want to know that Does Appium really need Xcode for run automated testing on iOS device? and why?
Xcode needs to be present for Appium to work.
Appium's command life-cycle, works as :
Selenium webdriver picks a command form the code like (Element.click) and sends it in form of JSON via http request to the Appium server. Appium server knows the automation context like the iOS and Android and sends this command to the Instruments command server which will wait for the Instruments command client (written in node.js) to pick it up and execute it in bootstrap.js with in the iOS instruments environment. Once the command is executed the command client sends back the message to the Appium server which logs everything related to the command in its console. This cycle keeps going till the time all the commands gets executed.
Appleā€™s instruments binary, which Appium uses to launch the iOS simulator, by default uses the currently-selected Xcode, and the highest iOS SDK installed with that version of Xcode.
Appium uses the appium-xcuitest-driver to test iOS devices using the Xcode UI Testing protocol. Under the hood, it will launch the WebDriverAgent on the iOS device, which does the heavy lifting.
There is 3rd party, commercial software which allow you to launch Appium tests on iOS devices without having to use Xcode. Such examples are Mobile Center from MicroFocus, Appium Studio from Experitest, or the quamotion/appion-docker-ios docker image.
Yes you need xcode to run you test on ios. And yes it supports native, hybrid as well as browsers.

simple kivy application not running on android?

i'm trying to run kivy examples on my android emulator, i can build them and install them on my device without any problem but i can't start them. does anybody have this problem too?
i'm using android API 18 as target.
You can run adb logcat, then try to start your app. After it crashes, you can ctrl+c to stop logcat and search for "died". Your error should be shown a few lines before it says your app died.
First thing, I'm not clear...is your problem with an emulator or a device? Or you have different problems on each?
If it's an emulator, make sure you are using a recent android version (I think you need at least 4.1 or something), and it must have hardware acceleration enabled for kivy to work.
Either way, if the app installs but fails to start, that suggests something is crashing it at the initialisation stage. You should plug your device into your computer, enable adb in its developer options, and run adb logcat to see the device log in real time. Run your application, and you will see the initialisation log and any standard python log when the app fails. This should indicate the problem.
The adb tool comes with the android sdk, so you must have it if you built an apk, but you might need to find it manually somewhere in the sdk folder if it isn't already somewhere in your $PATH.
I have same issue in past and I solve by adding requirements in .spec
This requirements work for me:
requirements = hostpython3==3.7.8,python3==3.7.8,kivy==1.11.1, certifi,chardet, lxml, docutils, future, idna, Kivy-Garden, Pygments, requests, six, soupsieve, urllib3, deep-translator, arabic-reshaper, python-bidi, openssl, pyopenssl, numpy, pytz, python-dateutil, pandas, setuptools, zope.interface, datetime
you have to write all modules and parent module in requirements which your app is using.
To know module which you app is using has two method:
run command pip freeze in current app folder in powershell
install all the module as below photo which help to install your application module

Resources