简体   繁体   English

为armeabi-v7a构建hostpython3 — RuntimeError:释放解锁的锁

[英]building hostpython3 for armeabi-v7a — RuntimeError: release unlocked lock

I am attempting to make some progress on my other issue here --> Kivy Launcher - AttributeError: 'MyInputs' object has no attribute 'get_focus_next' 我正在尝试在这里的其他问题上取得一些进展-> Kivy Launcher-AttributeError:“ MyInputs”对象没有属性“ get_focus_next”

My intent now is to build Kivy Launcher (alternate suggestions on ways to prototype android python apps are welcome, but regardless I still would like to complete this). 我现在的意图是构建Kivy Launcher(欢迎使用有关原型化android python应用程序的方法的替代建议,但无论我是否仍想完成此操作)。 However, I've hit a new roadblock. 但是,我遇到了一个新的障碍。 Python-for-android is failing a long ways through the build, specifically it is failing as shown below. 适用于Android的Python在构建过程中失败了很多,特别是失败,如下所示。

The build command: 构建命令:

p4a apk --requirements=python2,kivy --permission WRITE_EXTERNAL_STORAGE --name="R Kivy Launcher" --package=com.kivy.rkivylauncher --version=0.0.1 --android_api 28 --bootstrap=pygame --launcher --minsdk 13

The error stuff (below that, is the system and configuration stuff I think might be important): 错误的东西(下面是我认为可能很重要的系统和配置东西):

    [INFO]:    Building hostpython3 for armeabi-v7a
[INFO]:    -> directory context /home/Me/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3
[INFO]:    -> directory context /home/Me/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build
[INFO]:    -> running configure
           working: checking for dup3... yes                                                                                                                                                                             raceback (most recent call last):
  File "/usr/lib/python3.7/queue.py", line 179, in get
    self.not_empty.wait(remaining)
  File "/usr/lib/python3.7/threading.py", line 288, in wait
    raise RuntimeError("cannot wait on un-acquired lock")
RuntimeError: cannot wait on un-acquired lock

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/p4a", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3.7/site-packages/pythonforandroid/toolchain.py", line 1075, in main
    ToolchainCL()
  File "/usr/lib/python3.7/site-packages/pythonforandroid/toolchain.py", line 577, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/usr/lib/python3.7/site-packages/pythonforandroid/toolchain.py", line 151, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/usr/lib/python3.7/site-packages/pythonforandroid/toolchain.py", line 200, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "/usr/lib/python3.7/site-packages/pythonforandroid/build.py", line 562, in build_recipes
    recipe.build_arch(arch)
  File "/usr/lib/python3.7/site-packages/pythonforandroid/python.py", line 417, in build_arch
    sh.Command(join(recipe_build_dir, 'configure')))
  File "/usr/lib/python3.7/site-packages/pythonforandroid/logger.py", line 178, in shprint
    for line in output:
  File "/usr/lib/python3.7/site-packages/sh.py", line 857, in next
    chunk = self.process._pipe_queue.get(True, 0.001)
  File "/usr/lib/python3.7/queue.py", line 182, in get
    return item
  File "/usr/lib/python3.7/threading.py", line 244, in __exit__
    return self._lock.__exit__(*args)
RuntimeError: release unlocked lock

System: Cygwin 3.0.3 系统:Cygwin 3.0.3

Configuration: - Python 3.7 - python-for-android 0.7.1 - buildozer 0.39 - sdk-tools-linux-4333796.zip - android-ndk-r19b-linux-x86_64.zip (is there an AMD specific variant? So far, Google says no...) 配置:-Python 3.7-python-for-android 0.7.1-buildozer 0.39-sdk-tools-linux-4333796.zip-android-ndk-r19b-linux-x86_64.zip(是否有AMD特定版本?到目前为止,谷歌说不...)

Happy to share more, just not really sure what else is important / potentially related. 乐于分享更多,只是不确定是否还有其他重要/潜在的相关内容。 I have some totally wild suspicions (Cygwin and threading / lock incompatibilities?), but that's all I got. 我完全怀疑(Cygwin和线程/锁不兼容?),但这就是我的全部。

Help? 救命?

Answering my own question (sort of) above: While I now understand there are a lot of set up requirements that are possible to allow direct use of p4a, in the end I realized the following in general: 回答我上面的问题(某种):虽然我现在理解了许多设置要求,可以直接使用p4a,但最终我总体上意识到了以下几点:

  1. My dedicated Linux box with 'Buildozer Android' turned out to be (eventually) the fastest / easiest to manage option for me. 事实证明,我专用的带有“ Buildozer Android”的Linux机器对我来说(最终)是最快/最容易管理的选择。 It just handles all the proper downloading and aligning of the components needed to make the build happen right. 它只是处理正确完成构建所需的所有组件的正确下载和对齐。 The new python3 version of Kivy Launcher installs, and starts with a list of apps available just like the one in the App Store, but alas it still crashes (and I'm still trying to figure out why, but I'm closer...) 将安装新的python3版本的Kivy Launcher,并从一系列可用的应用程序开始,就像App Store中的应用程序一样,但是可惜它仍然崩溃(我仍在努力找出原因,但我离它更近了。 。)

On the path to this realization, I found: 在实现这一目标的过程中,我发现:

  1. Cygwin has some deep seated issues creating apk's - I'm still not certain whether the issues I experienced were directly due to the Cygwin environment, my Cygwin setup, my test App and the depreciated ListView stuff I had in it, my Computer Virus protection or a strong and unmanageable combination of the above. Cygwin在创建apk时存在一些深层次的问题-我仍然不确定我遇到的问题是否直接是由于Cygwin环境,我的Cygwin设置,我的测试应用程序以及其中包含的已贬值的ListView东西,计算机病毒防护或以上这些的强大而难以管理的组合。

  2. I also struggled for a while trying to get MSYS2 and Mingw-w64 64 bit to build kivy stuff natively and for Android, but the whole Windows vs Unix pathname mixing, environment setup and a hundred other things proved too much of a distraction from my real goal : building an App to run natively on many platforms --> Mingw may still end up playing a role in the future but it's on the bookshelf for now. 我也尝试了一段时间,试图让MSYS2和Mingw-w64 64位本机构建并为Android构建kivy东西,但是整个Windows vs Unix路径混合,环境设置和其他一百件事证明了我的不满。目标:构建一个可以在许多平台上本地运行的应用程序-> Mingw在将来可能仍会发挥作用,但目前仍在书架上。

  3. I also tried Termux. 我也尝试过Termux。 And Eclipse. 和Eclipse。 And looked into ways to make the new Android Studio work with Python. 并研究了使新的Android Studio与Python配合使用的方法。 All might be possible (or none), and I really see the value in the idea of Eclipse and Android Studio for creating visual app front ends, so again those may find a future use as this project matures. 一切皆有可能(或没有),我真的看到了Eclipse和Android Studio创建可视化应用程序前端的想法的价值,因此随着该项目的成熟,它们又可能会找到未来的用途。

All in all, I want to thank many hundreds of people all over the internet - I had almost 80 tabs open at one time (plus multi-tab bookmarks saved!) to get to this point : With all the info available on Buildozer and why it works so well on a Linux machine, I ended where I probably should have started. 总而言之,我要感谢互联网上成百上千的人-一次打开了将近80个标签(保存了多标签书签!),到这一点:有了Buildozer上的所有可用信息以及为什么它在Linux机器上运行得很好,我结束了可能应该开始的地方。 My prototype kivy app runs on an Android phone, and (I hope soon) the Kivy Launcher will also. 我的原型kivy应用程序可在Android手机上运行,​​(希望很快),Kivy Launcher也将运行。 It seems the new relaunched Kivy Launcher fails in a way that makes me believe the 'ListView" depreciation is the reason it's crashing (it builds, starts to load the sample apps included, but then crashes and the logs are not so helpful as I'd hoped). If I can confirm and refactor it to fix this, I'll have something real to contribute back myself. 重新启动的新Kivy Launcher似乎以某种方式失败,这使我相信“​​ ListView”折旧是它崩溃的原因(它生成,开始加载所包含的示例应用程序,但随后崩溃并且日志没有我所提供的帮助那么大) d希望)。如果我可以确认并重构它以解决此问题,我将有一些真正的东西可以回馈自己。

Stay tuned to the first link in my original post above if you care more about a new Kivy Launcher than you care about tools to build apk's - I'm hoping to add one more entry if I do indeed get Kivy Launcher working again with all the new kivy and python3 functionality I need. 如果您更关心新的Kivy Launcher而不是构建APK的工具,请继续关注我上面原始文章中的第一个链接-如果我确实希望Kivy Launcher再次与所有其他工具一起使用,我希望再添加一个条目我需要的新的kivy和python3功能。 Now I just have to figure out RecycleView... 现在我只需要弄清楚RecycleView ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM