0

请帮忙。

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

但是,一旦我构建了 APK 并在 android Emulator (Andyroid) 上对其进行了测试,我在 logcat 中收到以下关于我导入的用户类的错误。我需要在规范文件中的某处指定它吗?

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
4

1 回答 1

0

python 2.7中有一个user包,它覆盖了你自己的user包。尝试将名称更改为其他名称,例如user_. 这是 buildozer 中的一个小错误。

于 2016-06-24T20:18:25.560 回答