Kivy Buildozer Permission Denied on ./distribute.sh -1 - android

Ok so first before anything let me show the error
# Android packages installation done.
# Check application requirements
# Run './distribute.sh -l'
# Cwd /media/jonathon/Data Volume/Python Projects/Kivy Tutorial/.buildozer/android/platform/python-for-android
/bin/sh: 1: ./distribute.sh: Permission denied
# Command failed: ./distribute.sh -l
The command I am running is sudo buildozer android debug so I know I am running sudo and have root permissions.

Based on the file path in your error, you may be using a shared drive or remote file system. These can cause problems with permissions when buildozer tries to run and compile things. Try deleting ~/.buildozer, the .buildozer dir in your project, then moving the files to a local hard drive and running buildozer without sudo.

Related

Permission denied from Bitbucket pipeline

I am trying to use the bitbucket pipeline to upload my build apk to hockey app but when i try to run my script i get
bash: ./deploy-hockey-dev.sh: Permission denied
this is the deploy-hockey-dev.sh :
#!/bin/sh
# upload apk to hockey app
curl \
-F "status=2" \
-F "notify=0" \
-F "ipa=#app/build/outputs/apk/debug/app-debug.apk" \
-H "X-HockeyAppToken: myToken" \
https://rink.hockeyapp.net/api/2/apps/upload
Does any one know what the problem here is ?
The issue is that the file was not given the correct execution permissions before it was checked into BitBucket.
If you are developing locally in a unix environment, you would normally set execute permissions (ie. chmod 755) on the script file so you can test it locally before committing. With this approach you would not experience the permission denied error in pipeline build when you check it in.
However, sometimes we are authoring our scripts on Windows without a unix emulator, so we can only test our scripts in a pipeline environment. Even though Windows does not support execute permissions in its file system, we can still use git to show and set these execute permissions.
cd <dir-with-shell-scripts>
git ls-files --stage # show file permissions (last 3 digits of first number)
git update-index --chmod=+x <files> # set execute permissions
Commit the updated files as per your normal process.
It turns out that right before i execute the script i had to use - chmod +x deploy-hockey-dev.sh so the .yml file that is used in bitbucket should have this line before the execution of the script. I made a tutorial of how to make the entire process hope it help some one.
This looks like Linux permissions problem to me rather than programming. Check if the script has executable permission (the x bit in ls -l). You can consult chmod (man chmod) or the Internet for details how Linux permissions work, as I believe that is offtopic for this site.
This worked for me.
In your code terminal, you need to update the permissions for the files to be executable (x in them)
chmod +x path/to/file
Then commit and push. The pipeline should pass for this issue

pip install broken on ArchLinux under Termux

With python 3.6.4:
In a fresh Termux installation I do accordnung to https://wiki.termux.com/wiki/Arch
pkg install wget
wget https://raw.githubusercontent.com/sdrausty/TermuxArch/master/setupTermuxArch.sh
bash setupTermuxArch.sh
After that in ArchLinux:
$ pacman -S python python-pip
(success)
$ pip install simplejson (or any other package)
And always get:
running install_egg_info
running egg_info
writing simplejson.egg-info/PKG-INFO
writing dependency_links to simplejson.egg-info/dependency_links.txt
writing top-level names to simplejson.egg-info/top_level.txt
reading manifest file 'simplejson.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'simplejson.egg-info/SOURCES.txt'
Copying simplejson.egg-info to /root/.local/lib/python3.6/site-packages/simplejson-3.13.2-py3.6.egg-info
error: [Errno 13] Permission denied: '/root/.local/lib/python3.6/site-packages/simplejson-3.13.2-py3.6.egg-info/PKG-INFO'
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-r_x__623/simplejson/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-4dfnzavt-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-r_x__623/simplejson/
Also --user or pyvenv don't help at all. Any suggestions, what am I doing wrong?
Please note:
Android device is not rooted
The ArchLinux user is root (default)
Permissions look good. I can copy files manually to the destination directory just ok.
UPDATE: With python 2.7.14 everything works well.

Tool unzip is missing, buildozer, kivy

I am new to kivy, and try to build an app for android using kivy.
When i was creating an apk for the app
buildozer android debug
with log_level=2
it shows:
Tool unzip is missing
Command failed: ./distribute.sh -m "kivy" -d "kivytut"
Buildozer failed to execute the last command
The error might be hidden in the log above this error
Please read the full log, and search for it before
raising an issue with buildozer itself.
In case of a bug report, please add a full log with log_level = 2
I'm unable to find any tool called upzip for buidozer(python-for-android) on the internet.
Help.
install unzip using:
sudo apt-get install unzip
moreover following are the tools that must be installed:
git
ant
python2
cython (can be installed via pip)
a Java JDK (e.g. openjdk-7)
zlib (including 32 bit)
libncurses (including 32 bit)
unzip
virtualenv (can be installed via pip)
ccache (optional)
These are several dependencies for python-for-android

Command failed: ./distribute.sh -m "kivy" -d

I am trying to follow the instructions on https://kivy.org/docs/guide/packaging-android-vm.html to create kivy android applications. I installed Kivy Buildozer VM and was following instructions on the Readme file. Created the buildozer.spec file using buildozer init command but buildozer android debug is failing with following output
(cd /media/sf_virtual_box/organizer/2nd_vid_tute/step07_padding/.buildozer/android/platform/python-for-android/build/python-install/bin; ln python2.7 python)
ln: failed to create hard link ‘python’ => ‘python2.7’: Operation not permitted
make: *** [bininstall] Error 1
Leaving ARM environment
cp: cannot stat ‘build/lib.*-2.7/_ctypes*.so’: No such file or directory
# Command failed: ./distribute.sh -m "kivy" -d "myapp1"
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2
How can I fix this?
This will occur if the kivy project on the Virtual Machine is in a shared folder with the host machine.
(In my case the host is Windows.)
If this is the case, try copying the kivy project folder to /home/, and make sure this is not shared.
Make sure the permissions are set to 777.

Command failed: tar xzf android-sdk_r20-linux.tgz

I was trying to build kivy app to android and got this error
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Install platform
# Apache ANT found at /home/ali/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK is missing, downloading
# Unpacking Android SDK
# Command failed: tar xzf android-sdk_r20-linux.tgz
#
# Buildozer failed to execute the last command
# If the error is not obvious, please raise the log_level to 2
# and retry the latest command.
# In case of a bug report, please add a full log with log_level = 2
command
$ buildozer android_new debug
log:
http://paste.ubuntu.com/20850804/
want any details? request in the comments
The machine fails to properly download the android SDK.
You can confirm this by checking the md5 sum of the file :
wget -O - http://dl.google.com/android/android-sdk_r20-linux.tgz | md5sum
This should output : 22a81cf1d4a951c62f71a8758290e9bb
If it doesn't, my first guess would be that you're blocked by some kind of proxy or firewall. A proxy can be configured to limit the maximum size of a a file you're trying to download. Check the logs or contact your sysadmins if you're not the administrator of the machine.
I figured it out!
the problem was some google services are not available where i live due to USA sanctions on my country (Sudan) and the returned response is html (not in gzip format).
the solution is to use vpn.

Categories

Resources