diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 9914000..b36b3d7 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -850,10 +850,11 @@ class TargetAndroid(Target): # recreate the project.properties with io.open(project_fn, 'w', encoding='utf-8') as fd: - try: - fd.writelines((line.encode('utf-8') for line in content)) - except: - fd.writelines(content) + lines = [ + line if isinstance(line, unicode) else line.decode('utf-8') + for line in content + ] + fd.writelines(lines) if not content[-1].endswith(u'\n'): fd.write(u'\n') for index, ref in enumerate(references):