質問編集履歴
3
情報の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -125,6 +125,7 @@
|
|
125
125
|
# raising an issue with buildozer itself.
|
126
126
|
# In case of a bug report, please add a full log with log_level = 2
|
127
127
|
```
|
128
|
+
|
128
129
|
何が原因でエラーになってるかわかりません。
|
129
130
|
|
130
131
|
詳しい方アドバイスお願いします。
|
2
エラーコードの不要と思われる部分を削除、追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -50,7 +50,7 @@
|
|
50
50
|
```
|
51
51
|
# python for android
|
52
52
|
export ANDROIDSDK="$HOME/ProgramFiles/android-sdk/tools/bin"
|
53
|
-
export ANDROIDNDK="$HOME/
|
53
|
+
export ANDROIDNDK="$HOME/ProgramFiles/android-ndk-r17c"
|
54
54
|
export ANDROIDAPI="20"
|
55
55
|
export NDKAPI="17"
|
56
56
|
export ANDROIDKVER="r17c"
|
1
エラーコードの不要と思われる部分を削除、追記
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
buildozerで
|
1
|
+
buildozerでandroid debug するとエラーになる
|
body
CHANGED
@@ -7,203 +7,124 @@
|
|
7
7
|
- `buildozer android debug logcat`コマンドを実行
|
8
8
|
[参考サイト](https://qiita.com/gotta_dive_into_python/items/82ee13ebac44719adad6)
|
9
9
|
|
10
|
-
|
11
|
-
**テストコード**
|
12
|
-
```python
|
13
|
-
# main.py
|
14
|
-
from kivy.app import App
|
15
|
-
from kivy.uix.label import Label
|
16
|
-
|
17
|
-
class HelloApp(App):
|
18
|
-
def build(self):
|
19
|
-
return Label(text='Hello World')
|
20
|
-
|
21
|
-
if __name__ == '__main__':
|
22
|
-
HelloApp().run()
|
23
|
-
```
|
24
|
-
|
25
|
-
`buildozer.spec`の変更箇所
|
26
|
-
```
|
27
|
-
title = Test Application
|
28
|
-
package.name = testapp
|
29
|
-
source.dir = /media/sf_VM-share
|
30
|
-
requirements = python3,kivy
|
31
|
-
p4a.branch = develop
|
32
|
-
log_level = 2
|
33
|
-
```
|
34
|
-
PATHはbashrcに設定しました([参考](https://python-for-android.readthedocs.io/en/latest/quickstart/#installing-android-sdk))
|
35
|
-
```
|
36
|
-
# python for android
|
37
|
-
export ANDROIDSDK="$HOME/ProgramFiles/android-sdk/tools/bin"
|
38
|
-
#export ANDROIDNDK="$HOME/Documents/android-ndk-r21"
|
39
|
-
export ANDROIDNDK="$HOME/Documents/android-ndk-r19c"
|
40
|
-
export ANDROIDAPI="27"
|
41
|
-
export NDKAPI="19"
|
42
|
-
export ANDROIDKVER="r19c"
|
43
|
-
```
|
44
|
-
|
45
|
-
---
|
46
|
-
|
47
10
|
実行結果
|
48
11
|
```
|
49
12
|
~$ buildozer android debug logcat
|
50
|
-
|
51
|
-
# Ensure build layout
|
52
|
-
# Check configuration tokens
|
53
|
-
# Preparing build
|
54
|
-
# Check requirements for android
|
55
|
-
# Run 'dpkg --version'
|
56
|
-
# Cwd None
|
57
|
-
Debian `dpkg' パッケージ管理プログラム バージョン 1.18.4 (amd64)。
|
58
|
-
これはフリーソフトです; コピー条件については GNU 一般公有使用許諾書バージョン 2
|
59
|
-
もしくはそれ以降を参照してください。このソフトウェアは無保証です。
|
60
|
-
# Search for Git (git)
|
61
|
-
# -> found at /usr/bin/git
|
62
|
-
# Search for Cython (cython)
|
63
|
-
# -> found at /home/ubun/.local/bin/cython
|
64
|
-
# Search for Java compiler (javac)
|
65
|
-
# -> found at /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
|
66
|
-
# Search for Java keytool (keytool)
|
67
|
-
# -> found at /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool
|
68
|
-
# Install platform
|
69
|
-
# Run 'git config --get remote.origin.url'
|
70
|
-
# Cwd /home/ubun/.buildozer/android/platform/python-for-android
|
71
|
-
https://github.com/kivy/python-for-android.git
|
72
|
-
# Run 'git branch -vv'
|
73
|
-
# Cwd /home/ubun/.buildozer/android/platform/python-for-android
|
74
|
-
* develop d96d71e [origin/develop] Merge pull request #2205 from AndreMiras/feature/troubleshooting_ssl_error
|
75
|
-
# Run '/usr/local/bin/python3.8 -m pip install -q --user \'appdirs\' \'colorama>=0.3.3\' \'jinja2\' \'six\' \'enum34; python_version<"3.4"\' \'sh>=1.10; sys_platform!="nt"\' \'pep517<0.7.0"\' \'toml\''
|
76
|
-
# Cwd None
|
77
|
-
# Apache ANT found at /home/ubun/.buildozer/android/platform/apache-ant-1.9.4
|
78
|
-
# Android SDK found at /home/ubun/.buildozer/android/platform/android-sdk
|
79
|
-
# Recommended android's NDK version by p4a is: 19c
|
80
|
-
# Android NDK found at /home/ubun/.buildozer/android/platform/android-ndk-r19c
|
81
|
-
# Check application requirements
|
82
|
-
# Check garden requirements
|
83
|
-
# Compile platform
|
84
|
-
# Run '/usr/local/bin/python3.8 -m pythonforandroid.toolchain create --dist_name=testapp --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/ubun/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21'
|
85
|
-
# Cwd /home/ubun/.buildozer/android/platform/python-for-android
|
86
|
-
/home/ubun/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py:84: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
|
13
|
+
:
|
87
14
|
import imp
|
88
|
-
[INFO]: Will compile for the following archs: armeabi-v7a
|
89
|
-
[INFO]: Found Android API target in $ANDROIDAPI: 27
|
90
|
-
[INFO]: Available Android APIs are (27)
|
91
|
-
[INFO]: Requested API target 27 is available, continuing.
|
92
|
-
[INFO]: Found NDK dir in $ANDROIDNDK: /home/ubun/.buildozer/android/platform/android-ndk-r19c
|
93
|
-
[INFO]: Could not determine NDK version, no source.properties in the NDK dir.
|
94
15
|
[WARNING]: Unable to read the NDK version from the given directory /home/ubun/.buildozer/android/platform/android-ndk-r19c.
|
95
16
|
[WARNING]: Make sure your NDK version is greater than 19. If you get build errors, download the recommended NDK 19c from https://developer.android.com/ndk/downloads/.
|
96
|
-
[INFO]: Getting NDK API version (i.e. minimum supported API) from user argument
|
97
17
|
[WARNING]: ndk_platform doesn't exist: /home/ubun/.buildozer/android/platform/android-ndk-r19c/platforms/android-21/arch-arm
|
98
18
|
[WARNING]: Could not find toolchain subdirectory!
|
99
19
|
[WARNING]: Could not find any toolchain for arm-linux-androideabi!
|
100
20
|
Traceback (most recent call last):
|
101
|
-
File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
|
102
|
-
return _run_code(code, main_globals, None,
|
103
|
-
File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
|
104
|
-
exec(code, run_globals)
|
105
|
-
File "/home/ubun/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1243, in <module>
|
106
|
-
|
21
|
+
:
|
107
|
-
File "/home/ubun/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
|
108
|
-
ToolchainCL()
|
109
|
-
File "/home/ubun/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 692, in __init__
|
110
|
-
getattr(self, command)(args)
|
111
|
-
File "/home/ubun/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 144, in wrapper_func
|
112
|
-
ctx.prepare_build_environment(user_sdk_dir=self.sdk_dir,
|
113
22
|
File "/home/ubun/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 408, in prepare_build_environment
|
114
23
|
self.toolchain_version = toolchain_version
|
115
24
|
UnboundLocalError: local variable 'toolchain_version' referenced before assignment
|
116
25
|
# Command failed: /usr/local/bin/python3.8 -m pythonforandroid.toolchain create --dist_name=testapp --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/ubun/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21
|
117
|
-
|
118
|
-
# XDG_VTNR = '7'
|
119
|
-
# XDG_SESSION_ID = 'c1'
|
120
|
-
# XDG_GREETER_DATA_DIR = '/var/lib/lightdm-data/ubun'
|
121
|
-
# CLUTTER_IM_MODULE = 'xim'
|
122
|
-
# SESSION = 'ubuntu'
|
123
|
-
# ANDROID_HOME = '/home/ubun/ProgramFiles/android-sdk'
|
124
|
-
# GPG_AGENT_INFO = '/home/ubun/.gnupg/S.gpg-agent:0:1'
|
125
|
-
# TERM = 'xterm-256color'
|
126
|
-
# VTE_VERSION = '4205'
|
127
|
-
# XDG_MENU_PREFIX = 'gnome-'
|
128
|
-
# SHELL = '/bin/bash'
|
129
|
-
# QT_LINUX_ACCESSIBILITY_ALWAYS_ON = '1'
|
130
|
-
# WINDOWID = '62914570'
|
131
|
-
# UPSTART_SESSION = 'unix:abstract=/com/ubuntu/upstart-session/1000/1181'
|
132
|
-
# GNOME_KEYRING_CONTROL = ''
|
133
|
-
# GTK_MODULES = 'gail:atk-bridge:unity-gtk-module'
|
134
|
-
# USER = 'ubun'
|
135
|
-
# LS_COLORS = '***'
|
136
|
-
# QT_ACCESSIBILITY = '1'
|
137
|
-
# UNITY_HAS_3D_SUPPORT = 'true'
|
138
|
-
# XDG_SESSION_PATH = '/org/freedesktop/DisplayManager/Session0'
|
139
|
-
# XDG_SEAT_PATH = '/org/freedesktop/DisplayManager/Seat0'
|
140
|
-
# SSH_AUTH_SOCK = '/run/user/1000/keyring/ssh'
|
141
|
-
# DEFAULTS_PATH = '/usr/share/gconf/ubuntu.default.path'
|
142
|
-
# SESSION_MANAGER = 'local/ubun-VirtualBox:@/tmp/.ICE-unix/1539,unix/ubun-VirtualBox:/tmp/.ICE-unix/1539'
|
143
|
-
# XDG_CONFIG_DIRS = '/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg'
|
144
|
-
# UNITY_DEFAULT_PROFILE = 'unity'
|
145
|
-
# DESKTOP_SESSION = 'ubuntu'
|
146
|
-
# PATH = '/home/ubun/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/ubun/bin:/home/ubun/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ubun/ProgramFiles/android-sdk/tools/bin:/home/ubun/ProgramFiles/android-sdk/platform-tools:/home/ubun/ProgramFiles/android-sdk/tools/bin:/home/ubun/ProgramFiles/android-sdk/platform-tools:/home/ubun/ProgramFiles/android-sdk/tools/bin:/home/ubun/ProgramFiles/android-sdk/platform-tools'
|
147
|
-
# ANDROIDAPI = '27'
|
148
|
-
# QT_IM_MODULE = 'fcitx'
|
149
|
-
# QT_QPA_PLATFORMTHEME = 'appmenu-qt5'
|
150
|
-
# XDG_SESSION_TYPE = 'x11'
|
151
|
-
# PWD = '/home/ubun'
|
152
|
-
# JOB = 'unity-settings-daemon'
|
153
|
-
# XMODIFIERS = '@im=fcitx'
|
154
|
-
# GNOME_KEYRING_PID = ''
|
155
|
-
# LANG = 'ja_JP.UTF-8'
|
156
|
-
# GDM_LANG = 'ja'
|
157
|
-
# MANDATORY_PATH = '/usr/share/gconf/ubuntu.mandatory.path'
|
158
|
-
# ANDROIDNDK = '/home/ubun/.buildozer/android/platform/android-ndk-r19c'
|
159
|
-
# COMPIZ_CONFIG_PROFILE = 'ubuntu'
|
160
|
-
# IM_CONFIG_PHASE = '1'
|
161
|
-
# GDMSESSION = 'ubuntu'
|
162
|
-
# ANDROIDKVER = 'r19c'
|
163
|
-
# SESSIONTYPE = 'gnome-session'
|
164
|
-
# GTK2_MODULES = 'overlay-scrollbar'
|
165
|
-
# SHLVL = '1'
|
166
|
-
# HOME = '/home/ubun'
|
167
|
-
# XDG_SEAT = 'seat0'
|
168
|
-
# LANGUAGE = 'ja'
|
169
|
-
# GNOME_DESKTOP_SESSION_ID = 'this-is-deprecated'
|
170
|
-
# UPSTART_INSTANCE = ''
|
171
|
-
# ANDROIDSDK = '/home/ubun/.buildozer/android/platform/android-sdk'
|
172
|
-
# UPSTART_EVENTS = 'xsession started'
|
173
|
-
# XDG_SESSION_DESKTOP = 'ubuntu'
|
174
|
-
# LOGNAME = 'ubun'
|
175
|
-
# COMPIZ_BIN_PATH = '/usr/bin/'
|
176
|
-
# DBUS_SESSION_BUS_ADDRESS = 'unix:abstract=/tmp/dbus-kvtUxCvHjt'
|
177
|
-
# XDG_DATA_DIRS = '/usr/share/ubuntu:/usr/share/gnome:/usr/local/share:/usr/share:/var/lib/snapd/desktop'
|
178
|
-
# QT4_IM_MODULE = 'fcitx'
|
179
|
-
# LESSOPEN = '| /usr/bin/lesspipe %s'
|
180
|
-
# INSTANCE = ''
|
181
|
-
# UPSTART_JOB = 'unity7'
|
182
|
-
# XDG_RUNTIME_DIR = '/run/user/1000'
|
183
|
-
# DISPLAY = ':0'
|
184
|
-
# NDKAPI = '19'
|
185
|
-
# XDG_CURRENT_DESKTOP = 'Unity'
|
186
|
-
# GTK_IM_MODULE = 'fcitx'
|
187
|
-
# LESSCLOSE = '/usr/bin/lesspipe %s %s'
|
188
|
-
# XAUTHORITY = '/home/ubun/.Xauthority'
|
189
|
-
# _ = '/usr/local/bin/buildozer'
|
190
|
-
# PACKAGES_PATH = '/home/ubun/.buildozer/android/packages'
|
191
|
-
# ANDROIDMINAPI = '21'
|
192
|
-
#
|
193
|
-
# Buildozer failed to execute the last command
|
194
|
-
# The error might be hidden in the log above this error
|
195
|
-
# Please read the full log, and search for it before
|
196
|
-
# raising an issue with buildozer itself.
|
197
|
-
# In case of a bug report, please add a full log with log_level = 2
|
198
|
-
|
26
|
+
:
|
199
27
|
```
|
200
28
|
|
201
|
-
---
|
202
|
-
|
203
29
|
**試したこと**
|
204
30
|
- sudo で実行
|
205
31
|
- NDKのバージョンが読み取れないと指摘されていたのでr19cのNDKに変更して実行
|
206
32
|
- APIレベル27(Android8.1)のSDKに変更して実行
|
207
33
|
以上の結果も同じエラーになりました。
|
208
34
|
|
35
|
+
---
|
36
|
+
|
37
|
+
**追記**
|
38
|
+
[こちら](https://qiita.com/gotta_dive_into_python/items/f3a6a2c83ed96366bc2f)と[リンク](https://github.com/kivy/kivy/wiki/Android-SDK-NDK-Information)を参考
|
39
|
+
- SDKのAPIレベルを20に変更
|
40
|
+
- NDKをr17cに変更
|
41
|
+
- main.pyと同じディレクトリにSDK,NDK,specを移動
|
42
|
+
|
43
|
+
`buildozer.spec`の設定
|
44
|
+
```
|
45
|
+
android.ndk_path=/android-ndk-r17c
|
46
|
+
android.sdk_path=/android-sdk
|
47
|
+
```
|
48
|
+
|
49
|
+
`bashrc`の設定([参考](https://python-for-android.readthedocs.io/en/latest/quickstart/#installing-android-sdk))
|
50
|
+
```
|
51
|
+
# python for android
|
52
|
+
export ANDROIDSDK="$HOME/ProgramFiles/android-sdk/tools/bin"
|
53
|
+
export ANDROIDNDK="$HOME/Documents/android-ndk-r17c"
|
54
|
+
export ANDROIDAPI="20"
|
55
|
+
export NDKAPI="17"
|
56
|
+
export ANDROIDKVER="r17c"
|
57
|
+
```
|
58
|
+
`main.py`のディレクトリに移動し
|
59
|
+
権限で引っかかったので`sudo buidlozer android debug deploy`で実行
|
60
|
+
|
61
|
+
前回のエラーを解決し今度は動いたと思ったのですが別のエラーになりました
|
62
|
+
```
|
63
|
+
:
|
64
|
+
[INFO]: -> running python3 setup.py build_ext -v
|
65
|
+
working: error: command '/usr/bin/ccache' failed with exit status 1 Exception in thread background thread for pid 23538:
|
66
|
+
Traceback (most recent call last):
|
67
|
+
|
68
|
+
:
|
69
|
+
|
70
|
+
File "/home/ubun/.local/lib/python3.8/site-packages/sh.py", line 877, in handle_command_exit_code
|
71
|
+
raise exc
|
72
|
+
sh.ErrorReturnCode_1:
|
73
|
+
|
74
|
+
:
|
75
|
+
|
76
|
+
STDOUT:
|
77
|
+
warning: [options] bootstrap class path not set in conjunction with -source 1.7
|
78
|
+
1 warning
|
79
|
+
running build_ext
|
80
|
+
building 'jnius' extension
|
81
|
+
/usr/bin/ccache /android-ndk-r17c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -I/home/ubun/ProgramFiles/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include -DANDROID -D__ANDROID_API__=21 -I/android-ndk-r17c/sysroot/usr/include/arm-linux-androideabi -I/home/ubun/ProgramFiles/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/testapp/include/python3.8 -fPIC -I/usr/lib/jvm/java-8-openjdk-amd64/include -I/usr/lib/jvm/java-8-openjdk-amd64/include/linux -I/home/ubun/ProgramFiles/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/ubun/ProgramFiles/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build -c jnius/jnius.c -o build/temp.linux-x86_64-3.8/jnius/jnius.o
|
82
|
+
clang: error: no such file or directory: 'jnius/jnius.c'
|
83
|
+
clang: error: no input files
|
84
|
+
error: command '/usr/bin/ccache' failed with exit status 1
|
85
|
+
|
86
|
+
|
87
|
+
STDERR:
|
88
|
+
[INFO]: pyjnius first build failed (as expected)
|
89
|
+
[INFO]: Running cython where appropriate
|
90
|
+
[INFO]: Cythonize jnius/jnius.pyx
|
91
|
+
[INFO]: -> running python3 -m Cython.Build.Cythoni...(and 20 more)
|
92
|
+
|
93
|
+
working: /usr/local/bin/python3: Error while findi...(and 100 more) Exception in thread background thread for pid 23562:
|
94
|
+
Traceback (most recent call last):
|
95
|
+
|
96
|
+
:
|
97
|
+
|
98
|
+
File "/home/ubun/.local/lib/python3.8/site-packages/sh.py", line 877, in handle_command_exit_code
|
99
|
+
raise exc
|
100
|
+
sh.ErrorReturnCode_1:
|
101
|
+
RAN: /usr/local/bin/python3 -m Cython.Build.Cythonize ./jnius/jnius.pyx
|
102
|
+
|
103
|
+
STDOUT:
|
104
|
+
/usr/local/bin/python3: Error while finding module specification for 'Cython.Build.Cythonize' (ModuleNotFoundError: No module named 'Cython')
|
105
|
+
|
106
|
+
STDERR:
|
107
|
+
Traceback (most recent call last):
|
108
|
+
|
109
|
+
:
|
110
|
+
|
111
|
+
File "/home/ubun/.local/lib/python3.8/site-packages/sh.py", line 877, in handle_command_exit_code
|
112
|
+
raise exc
|
113
|
+
sh.ErrorReturnCode_1:
|
114
|
+
RAN: /usr/local/bin/python3 -m Cython.Build.Cythonize ./jnius/jnius.pyx
|
115
|
+
|
116
|
+
STDOUT:
|
117
|
+
/usr/local/bin/python3: Error while finding module specification for 'Cython.Build.Cythonize' (ModuleNotFoundError: No module named 'Cython')
|
118
|
+
|
119
|
+
STDERR:
|
120
|
+
# Command failed: /usr/local/bin/python3.8 -m pythonforandroid.toolchain create --dist_name=testapp --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/ubun/ProgramFiles/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21
|
121
|
+
:
|
122
|
+
# Buildozer failed to execute the last command
|
123
|
+
# The error might be hidden in the log above this error
|
124
|
+
# Please read the full log, and search for it before
|
125
|
+
# raising an issue with buildozer itself.
|
126
|
+
# In case of a bug report, please add a full log with log_level = 2
|
127
|
+
```
|
128
|
+
何が原因でエラーになってるかわかりません。
|
129
|
+
|
209
130
|
詳しい方アドバイスお願いします。
|