Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'str' object has no attribute 'decode' #756

Closed
Petar-Luketina opened this issue Nov 30, 2018 · 3 comments
Closed

AttributeError: 'str' object has no attribute 'decode' #756

Petar-Luketina opened this issue Nov 30, 2018 · 3 comments

Comments

@Petar-Luketina
Copy link

Error

[INFO]:    Prebuilding android for armeabi-v7a
[INFO]:    android has no prebuild_armeabi_v7a, skipping
Traceback (most recent call last):
  File "/home/pl/anaconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
...
... skipping to show recent call and the resulting error
...
  File "/home/pl/python-for-android-master/pythonforandroid/recipes/android/__init__.py", line 33, in prebuild_arch
    bootstrap = bootstrap_name = self.ctx.bootstrap.name.decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'

Versions

  • Python: 2.7
  • OS: Ubuntu
  • Kivy: 1.10

Description

Previously, I was regularly building two apps, and even published one to the Play Store. Recently, I received this error and couldn't continue with either app. Any insight would be greatly appreciated!

buildozer.spec

Command:

buildozer android debug

Spec file:

requirements = kivy,hostpython2,android,plyer
android.permissions = INTERNET, ACCESS_WIFI_STATE, ACCESS_NETWORK_STATE, VIBRATE1

# (int) Android API to use
android.api = 27
# (int) Minimum API required
android.minapi = 19

# (int) Android SDK version to use
android.sdk = 23

# (str) Android NDK version to use
android.ndk = r16b

# (str) Android NDK directory (if empty, it will be automatically downloaded.)
android.ndk_path = ~/.buildozer/android/android-ndk-r16b

# (str) Android SDK directory (if empty, it will be automatically downloaded.)
android.sdk_path = ~/.buildozer/android/platform/android-sdk-23

# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86
android.arch = armeabi-v7a

p4a.source_dir = ~/python-for-android-master
p4a.bootstrap = sdl2
p4a.branch = master
@AndreMiras
Copy link
Member

Thanks for the bug report. Yes this is a bug recently introduced in kivy/python-for-android#1475
Until this is fixed, you can edit pythonforandroid/recipes/android/__init__.py and remove decode('utf-8') part from the self.ctx.bootstrap.name.decode('utf-8') line

@Petar-Luketina
Copy link
Author

@AndreMiras , nice catch. Thank you for letting me know!!

@AndreMiras
Copy link
Member

Fixed in kivy/python-for-android#1512

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants