Buildozer android APK导入错误

时间:2016-06-24 19:16:52

标签: android python-2.7 apk kivy buildozer

请帮忙。

我的kivy程序在桌面上运行完美(Mac OS,使用buildozer和Android-new工具链)。

然而,一旦我构建APK并在Android模拟器(Andyroid)上测试它,我在logcat中得到以下关于我导入的用户类的错误。我是否需要在spec文件中的某处指定它?

D/HostConnection( 1738): HostConnection::get() New Host Connection established 0xb7f2d2b0, tid 1865
I/python  ( 1738): [INFO   ] [GL          ] OpenGL version <OpenGL ES 2.0>
I/python  ( 1738): [INFO   ] [GL          ] OpenGL vendor <Imagination Technologies>
I/python  ( 1738): [INFO   ] [GL          ] OpenGL renderer <PowerVR SGX 544MP>
I/python  ( 1738): [INFO   ] [GL          ] OpenGL parsed version: 2, 0
I/python  ( 1738): [INFO   ] [GL          ] Texture max size <8192>
I/python  ( 1738): [INFO   ] [GL          ] Texture max units <16>
I/python  ( 1738): [INFO   ] [Window      ] auto add sdl2 input provider
I/python  ( 1738): [INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
D/AndroidRuntime( 2115): 
D/AndroidRuntime( 2115): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
D/AndroidRuntime( 2115): CheckJNI is OFF
D/dalvikvm( 2115): Trying to load lib libjavacore.so 0x0
D/dalvikvm( 2115): Added shared lib libjavacore.so 0x0
D/dalvikvm( 2115): Trying to load lib libnativehelper.so 0x0
D/dalvikvm( 2115): Added shared lib libnativehelper.so 0x0
D/AndroidRuntime( 2115): Calling main entry com.android.commands.settings.SettingsCmd
D/dalvikvm( 2115): Note: class Landroid/app/ActivityManagerNative; has 157 unimplemented (abstract) methods
D/AndroidRuntime( 2115): Shutting down VM
D/SettingsProvider( 2213): User 0 external modification to /data/data/com.android.providers.settings/databases/settings.db; event=8
D/SettingsProvider( 2213): User 0 updating our caches for /data/data/com.android.providers.settings/databases/settings.db
I/python  ( 1738):  Traceback (most recent call last):
I/python  ( 1738):    File "main.py", line 72, in <module>
I/python  ( 1738):      from user import User
I/python  ( 1738):  ImportError: cannot import name User
I/python  ( 1738): Python for android ended.
I/HostConnection( 1738): ~HostConnection
V/SDL     ( 1738): onPause()
E/dalvikvm( 1738): Loading ARM symbol: Java_org_libsdl_app_SDLActivity_nativePause
E/dalvikvm( 1738): Loading ARM symbol: Java_org_libsdl_app_SDLActivity_nativePause__
E/dalvikvm( 1738): Loading ARM symbol: Java_org_libsdl_app_SDLActivity_nativePause
E/dalvikvm( 1738): Loading ARM symbol: Java_org_libsdl_app_SDLActivity_nativePause__
E/dalvikvm( 1738): Loading ARM symbol: Java_org_libsdl_app_SDLActivity_nativePause
E/dalvikvm( 1738): Loading ARM symbol: Java_org_libsdl_app_SDLActivity_nativePause__
E/dalvikvm( 1738): Loading ARM symbol: Java_org_libsdl_app_SDLActivity_nativePause
E/dalvikvm( 1738): Loading ARM symbol: Java_org_libsdl_app_SDLActivity_nativePause__
E/dalvikvm( 1738): Loading ARM symbol: Java_org_libsdl_app_SDLActivity_nativePause
E/dalvikvm( 1738): Loading ARM symbol: Java_org_libsdl_app_SDLActivity_nativePause__
E/dalvikvm( 1738): Loading ARM symbol: Java_org_libsdl_app_SDLActivity_nativePause
E/dalvikvm( 1738): Loading ARM symbol: Java_org_libsdl_app_SDLActivity_nativePause__
E/dalvikvm( 1738): Loading ARM symbol: Java_org_libsdl_app_SDLActivity_nativePause
E/dalvikvm( 1738): Loading ARM symbol: Java_org_libsdl_app_SDLActivity_nativePause__
E/dalvikvm( 1738): Loading ARM symbol: Java_org_libsdl_app_SDLActivity_nativePause
V/SDL     ( 1738): nativePause()
F/libc    ( 1738): Fatal signal 11 (SIGSEGV) at 0x00000004 (code=1), thread 1738 (rg.test.rides16)
I/DEBUG   ( 1315): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

来自main.py的片段

from user import User
from category import Category
from advert import Advert
from attending import Attending

1 个答案:

答案 0 :(得分:0)

python 2.7中有一个user包,它会覆盖您自己的user包。尝试将名称更改为其他内容,例如user_。它是构建器中的一个小错误。