0

I'm packaging my kivy application using buildozer. My app uses Google Cloud Firestore and Cloud Storage. When I try to deploy it on my android phone I get the error ModuleNotFoundError: No module named 'google.cloud'. I've got the below requirements line in my buildozer.spec file:

requirements = python3,kivy,kivymd,requests,google-auth,google-oauthlib,firebase-admin,google-cloud-firestore,cachetools,google-cloud,firebase-client,google-cloud-storage

After google-auth I just sort of started adding any requirements I could find from people asking this question previously. From these links:

KivyMD Buildozer Android and firebase-admin

how to correctly implement the google API on a Kivy application compiling with buildozer?

Error message in buildozer:

File "/home/user/buildozer/appname/.buildozer/android/app/main.py", line 26, in <module. python : ModuleNotFoundError: No module named 'google.cloud'

I assume by this error it's something to do with the main.py file? These are my imports in the main.py file:

from kivymd.toast import toast #loads of kivy and kivymd imports but haven't included them all
from google.cloud import firestore
from plyer import filechooser
import os
import pyrebase
import requests
import json
import datetime
import pytz
import threading
from functools import partial
import postcodes_io_api
import pgeocode

from my_firestore import Firestore
Callum
  • 195
  • 2
  • 22
  • https://www.youtube.com/watch?v=V-uVhlns3hE&t=314s the tutorials cover a range of errors but unfortunately it doesn't used Firestore so there's nothing specific to this issue – Callum Oct 21 '20 at 19:36
  • I'm thinking if you are following steps on a web site to create the project so that we can narrow down the focus. – MrTech Oct 23 '20 at 16:08
  • 1
    Oh no it's my own project I am just following the above tutorial in order to deploy on Android. I have no idea why the google.cloud module is not recognised when I try to deploy, I think I've added all the requirements to the buildozer.spec file – Callum Oct 23 '20 at 16:44
  • I might need a recipe to be able to use Firestore in my app, although one of my requirements I've already specified in my buildozer.spec file is google-cloud-firestore. I would have assumed this would have covered it off – Callum Oct 23 '20 at 17:51
  • I've found https://stackoverflow.com/questions/36183486/importerror-no-module-named-google There are a few solutions you may try. pip install google-cloud – MrTech Oct 26 '20 at 16:56

1 Answers1

2

Here is the solution that worked just fine:
I have found out that google modules are, or i can say module like
google.cloud, google.storage and etc

Are stored in a file named google you can navigate it in your environment
"env/../../site-packages/google"
So what i did i went in this path in my .buildozer folder
.buildozer/android/platform/build-armeabi-v7a/build/python-installs/yummycom/google
yummycom is my project name ignore it

So i compared it with my google folder in my env and i just copy whats in it
and i pasted there and it worked just fine for me
because when its goes in that directory they are missing though you include them in your requirement
100% WORKED

  • Thanks for the reply. I can't find the PATH you are referring to .buildozer/android/platform/build-armeabi-v7a/build/python-installs/yummycom/google. I can't see a folder called android in my buildozer folder, just folders called "libs", "scripts", "targets" and "tools". Do you know where I should copy the google folder into? – Callum Jun 12 '21 at 20:51
  • sorry for late reply hope your doing well, yeah I meant in your .buildozer mostly it is found at the same location in your project but hidden so you can unhide it and 'yummycom' it is not part of the path you will find yours – Aqeglipa beast Jun 25 '21 at 23:23
  • Ah I see, thanks. I found the hidden .buildozer file and found the PATH .buildozer/android/platform but then I don't have a folder called build-armeabi-v7a there. I've got android-ndk-r19c which has a load of folders but I can't see one called python-installs (there's one called python-packages). There's also a folder called android-sdk – Callum Jun 29 '21 at 13:16