Re: ModuleNotFoundError: No module named 'kivy.graphics.instructions'

713 views
Skip to first unread message
Message has been deleted

Robert

unread,
Jul 28, 2022, 1:04:13 PM7/28/22
to Kivy users support
There is some odd stuff in the .spec


Don't know what happens if this is commented
#android.api = 21
use
android.api = 33

buildozer appclean before the next build

If you still have an issue try to build Hello World

On Thursday, July 28, 2022 at 2:22:48 AM UTC-10 kavise...@gmail.com wrote:
Hi. My kivy app works just fine before building it. When I try to build it into an apk using buildozer I get this error when i open the app.


This is the log:-
--------- beginning of system
--------- beginning of main
07-28 17:49:41.671  9059  9101 I python  : [INFO   ] [Logger      ] Record log in /data/user/0/org.praanesh.maxclient/files/app/.kivy/logs/kivy_22-07-28_2.txt
07-28 17:49:41.671  9059  9101 I python  : [INFO   ] [Kivy        ] v2.0.0
07-28 17:49:41.672  9059  9101 I python  : [INFO   ] [Kivy        ] Installed at "/data/user/0/org.praanesh.maxclient/files/app/_python_bundle/site-packages/kivy/__init__.pyc"
07-28 17:49:41.672  9059  9101 I python  : [INFO   ] [Python      ] v3.9.9 (main, Jul 28 2022, 11:37:10)
07-28 17:49:41.672  9059  9101 I python  : [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d
07-28 17:49:41.672  9059  9101 I python  : [INFO   ] [Python      ] Interpreter at ""
07-28 17:49:41.672  9059  9101 I python  : [INFO   ] [Logger      ] Purge log fired. Analysing...
07-28 17:49:41.673  9059  9101 I python  : [INFO   ] [Logger      ] Purge finished!
07-28 17:49:41.677  9059  9101 I python  : [INFO   ] [KivyMD      ] 0.104.2, git-bc7d1f5, 2021-06-06 (installed at "/data/user/0/org.praanesh.maxclient/files/app/_python_bundle/site-packages/kivymd/__init__.pyc")
07-28 17:49:41.683  9059  9101 I python  : [INFO   ] [Factory     ] 186 symbols loaded
07-28 17:49:41.709  9059  9101 I python  :  Traceback (most recent call last):
07-28 17:49:41.710  9059  9101 I python  :    File "/content/.buildozer/android/app/main.py", line 3, in <module>
07-28 17:49:41.711  9059  9101 I python  :    File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/maxclient/arm64-v8a/kivymd/__init__.py", line 67, in <module>
07-28 17:49:41.711  9059  9101 I python  :    File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/maxclient/arm64-v8a/kivymd/font_definitions.py", line 10, in <module>
07-28 17:49:41.712  9059  9101 I python  :    File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/maxclient/arm64-v8a/kivy/core/text/__init__.py", line 85, in <module>
07-28 17:49:41.712  9059  9101 I python  :    File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/maxclient/arm64-v8a/kivy/graphics/__init__.py", line 89, in <module>
07-28 17:49:41.713  9059  9101 I python  :  ModuleNotFoundError: No module named 'kivy.graphics.instructions'
07-28 17:49:41.713  9059  9101 I python  : Python for android ended.
logcat: Unexpected EOF!

Praanesh Selvaraj

unread,
Jul 28, 2022, 9:48:13 PM7/28/22
to Kivy users support
Hey Robert,
I tried by setting the android.api = 32 on buildozer.spec and it still don't work.
Then I tried building Hello world, got the same error on log.

07-29 07:17:31.444 23721 23763 I python  :  ModuleNotFoundError: No module named 'kivy.graphics.instructions'
07-29 07:17:31.444 23721 23763 I python  : Python for android ended.

Robert

unread,
Jul 28, 2022, 11:00:54 PM7/28/22
to Kivy users support
OK usually that would mean a Buildozer install error, a buildozer.spec error, or some file management issue.

0) Recheck this


1) Test buildozer.spec :

With Hello World create a new buildozer.spec , change only android.api = 32 , nothing else.
buildozer appclean
buildozer android debug

Then share the full build log and run log.

2)  Look at file management, I notice the project directory is '/content'

What directory is used for Hello World? 
Does the user have write permission?
What is the build platform?
Is this running as root?

Praanesh Selvaraj

unread,
Jul 29, 2022, 3:53:51 AM7/29/22
to Kivy users support
Ok I just switched my hello world program to another directory and used buildozer there.

Everything works pretty fine. The hello world app opens on my mobile phone. This time I didn't get any error.

I am going to copy my project files to this directory and try to build it.

 I will notify you when something happens.
buildozer.spec
buildlog.txt
runlog.txt
main.py

Praanesh Selvaraj

unread,
Jul 29, 2022, 4:34:40 AM7/29/22
to Kivy users support
Robert, You are a life saver.

Everything works like a charm.

Thank You, Robert.

Antonio Escamilla

unread,
Aug 7, 2022, 4:56:18 PM8/7/22
to Kivy users support

Hi, 
I am experiencing the same error as you. I am running buildozer in Colab, so I don't need to create a virtual machine with Linux. The thing is that the same exact code was working yesterday, but it is not today. I see you have solved the problem changing the directory, but can you be more explicit about it, please? In the picture attached you can see my directory arragement. Big Thanks! 
directory.png

Aqeglipa beast

unread,
Oct 19, 2022, 7:24:35 PM10/19/22
to Kivy users support
Hi I am experiencing the same problem as yours can you explain how did you manage to solve the error because it's frustrating 

Robert

unread,
Oct 19, 2022, 11:00:37 PM10/19/22
to Kivy users support
The OP presumably had something corrupted.
He (apparently) fixed it by moving his design files to a new directory, and building there.
The fix might be as simple as 'buildozer appclean'
Reply all
Reply to author
Forward
0 new messages