Android App crash upon startup

222 views
Skip to first unread message

gswf...@gmail.com

unread,
Feb 21, 2017, 10:28:00 PM2/21/17
to Kivy users support
Hi, friends:

I am trying to use Kiwy to write an app to connect my ERP server. The first app is just a few lines of code add to Alexander Taylor's Kivycrashcourse2's code. It works on Mac when I run "kivy main.py" in terminal, and buildozer can successfully build apk. But the Android app crash upon startup.
I have a HM 1S phone with Android 4.4.4 KTU84P
The main.py and buildozer.spec files are attahced.
A twist of my situation is that I have trouble installing the Android SDK, NDK on my local machine because of the GFW, so buildozer is installed on the remote AWS EC2 server in Tokyo, and I scp the apk back to my local machine for test on my Android phone. So I guess logcat does not work for me. Maybe I am wrong on this.

Anyway I tried both "buildozer -v android debug" and buildozer -v android_new debug", both apk is Ok, but app crash upon startup.

Any help will be appreciated.


gswf  
buildozer.spec
main.py

Feral Bytes

unread,
Feb 21, 2017, 10:31:49 PM2/21/17
to Kivy users support
Please also include the logcat; try simply $ buildozer android logcat
Then run your application; copy and paste the output back here or read it through and interpret the crash information from the logs.

gswf...@gmail.com

unread,
Feb 23, 2017, 11:40:50 PM2/23/17
to Kivy users support
Hi, Feral:

Thanks for the tip, I finally get over the GFW and install all the necessary android SDK, NDK on my local linux Ubuntu 14.04.5 LTS.
The following message is what I got from typing "buildozer android logcat"
feifei@LSYServer:~/erptest$ buildozer android logcat
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Run 'dpkg --version'
# Cwd None
Debian `dpkg' package management program version 1.17.5 (i386).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /usr/local/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-8-openjdk-i386/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-8-openjdk-i386/jre/bin/keytool
# Run '/home/feifei/.buildozer/android/platform/android-sdk-20/platform-tools/adb devices'
# Cwd None
List of devices attached 

feifei@LSYServer:~/erptest$ 

I tried "buildozer android logcat deploy run"

# Distribution already compiled, pass.

# Application pushed.

# Application started.

No error message, but my android has no app on it. I use a Windows PC to copy the apk to my android, installed the app. But it still crashes upon startup.


It seems ubuntu can not see my android, but buildozer does not give any error messages.

Any further suggestions:


gswf

Feng Ye

unread,
Mar 5, 2017, 6:46:10 PM3/5/17
to Kivy users support
A little progress:
I switched the USB-debug mode on @ my phone, now the log reads sth like these:

# Android packaging done!

# APK ERPtest-0.1-debug.apk available in the bin directory

# Run '/home/feifei/.buildozer/android/platform/android-sdk-20/platform-tools/adb devices'

# Cwd None

List of devices attached 

???????????? no permissions


# Deploy on ????????????

# Run '/home/feifei/.buildozer/android/platform/android-sdk-20/platform-tools/adb install -r /home/feifei/erptest/bin/ERPtest-0.1-debug.apk'

# Cwd /home/feifei/.buildozer/android/platform

error: insufficient permissions for device

error: insufficient permissions for device

error: insufficient permissions for device

- waiting for device -


I googled online, find suggest solution @ http://ssahinkoc.blogspot.jp/2015/01/how-to-fix-no-permission-error-for.html

I followed the suggestions but with no luck, the log gave same error.


Anyone know how should I do with this error? 

Victor Sued

unread,
Mar 5, 2017, 6:59:02 PM3/5/17
to Kivy users support
I liked use:

$ android logcat |grep python

Filter errors in python code.

Feng Ye

unread,
Mar 6, 2017, 8:41:00 AM3/6/17
to Kivy users support
Following the instruction of http://stackoverflow.com/questions/3127539/ubuntu-android-device-debug/3129903#3129903, I did the following:
1)Create a file /etc/udev/rules.d/51-android.rules 
2) other chmod ... things
3) sudo buildozer android debug deploy run

Ubuntu now can recognize my phone device, but the app still crashes upon startup:
The following is the new log:

List of devices attached 

d66134c7 device


# Deploy on d66134c7

# Run '/home/feifei/.buildozer/android/platform/android-sdk-20/platform-tools/adb install -r /home/feifei/test/bin/MyERPtest-0.1.2-debug.apk'

# Cwd /home/feifei/.buildozer/android/platform

4019 KB/s (7494889 bytes in 1.820s)

open: Permission denied

open: Permission denied

pkg: /data/local/tmp/MyERPtest-0.1.2-debug.apk

Success

# Application pushed.

# Run on d66134c7

# Run '/home/feifei/.buildozer/android/platform/android-sdk-20/platform-tools/adb shell am start -n org.test.erptest/org.renpy.android.PythonActivity -a org.renpy.android.PythonActivity'

# Cwd /home/feifei/.buildozer/android/platform

open: Permission denied

open: Permission denied

Starting: Intent { act=org.renpy.android.PythonActivity cmp=org.test.erptest/org.renpy.android.PythonActivity }

# Application started.


How can I solve this crashing problem? any help will be very much appreciated.



Reply all
Reply to author
Forward
0 new messages