question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

p4a apk crash "IndexError: list index out of range"

See original GitHub issue

I probe compile hello world with env by @JonasT in docker: https://github.com/JonasT/p4a-build-spaces/

./p4aspaces shell p4a-py3-api28ndk21 #p4a apk

log:

[INFO]:    -> running mv /root/.local/share/python-for-android/dists/unnamed_dist_1/_python_bundle/_python_bundle/site-packages/kivy/_clock.cpython-37m-x86_64-linux-gnu.so /root/.local/share/python-for-android/...(and 79 more)
[INFO]:    -> running mv /root/.local/share/python-for-android/dists/unnamed_dist_1/_python_bundle/_python_bundle/site-packages/kivy/weakproxy.cpython-37m-x86_64-linux-gnu.so /root/.local/share/python-for-andro...(and 85 more)
[INFO]:    -> running mv /root/.local/share/python-for-android/dists/unnamed_dist_1/_python_bundle/_python_bundle/site-packages/kivy/properties.cpython-37m-x86_64-linux-gnu.so /root/.local/share/python-for-andr...(and 87 more)
[INFO]:    <- directory context /root/test
[INFO]:    Stripping libraries
[INFO]:    -> running find /root/.local/share/python-for-android/dists/unnamed_dist_1/_python_bundle/_python_bundle/modules /root/.local/share/python-for-android/dists/unnamed_dist_1/libs -iname *.so
[INFO]:    Stripping libraries in private dir                                                                                                                                                                                                
[INFO]:    Frying eggs in /root/.local/share/python-for-android/dists/unnamed_dist_1/_python_bundle/_python_bundle/site-packages
[INFO]:    -> directory context /root/.local/share/python-for-android/dists/unnamed_dist_1
[INFO]:    Saving distribution info
[INFO]:    <- directory context /root/test
[INFO]:    # Your distribution was created successfully, exiting.
[INFO]:    Dist can be found at (for now) /root/.local/share/python-for-android/dists/unnamed_dist_1
[INFO]:    Of the existing distributions, the following meet the given requirements:
[INFO]:         unnamed_dist_1: min API 21, includes recipes (hostpython3, sdl2_image, sdl2_mixer, sdl2_ttf, python3, sdl2, six, pyjnius, kivy, requests3), built for archs (armeabi-v7a)
[INFO]:    unnamed_dist_1 has compatible recipes, using this one
Traceback (most recent call last):
  File "/usr/local/bin/p4a", line 11, in <module>
    load_entry_point('python-for-android==0.6.0', 'console_scripts', 'p4a')()
  File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 1033, in main
    ToolchainCL()
  File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 553, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 151, in wrapper_func
    func(self, args)
  File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 776, in apk
    unknown_args[i+1] = realpath(expanduser(unknown_args[i+1]))
IndexError: list index out of range

real    21m16.842s
user    13m15.721s
sys     3m53.464s
root@da199853fc95:~/test# cat .p4a 
--arch=armeabi-v7a
--name 'test'
--package com.example.test
--version 1
--permission=INTERNET
--requirements=python3,kivy,requests3
--private


root@da199853fc95:~/test#

Build without error:

#p4a apk --private .

.p4a file:

#cat .p4a
--arch=armeabi-v7a
--name 'test'
--package com.example.test
--version 1
--permission=INTERNET
--requirements=python3,kivy,requests3
root@da199853fc95:~/test#

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Jan 15, 2019

@homdx I made an attempt to fix the odd backtrace here: https://github.com/kivy/python-for-android/pull/1591

0reactions
inclementcommented, Jan 26, 2019

Closed by #1591

Read more comments on GitHub >

github_iconTop Results From Across the Web

List Index Out of Range – Python Error [Solved] - freeCodeCamp
The easy fix is to always use an index that exists in a list when trying to access items in the list. How...
Read more >
buildozer - PyPI
The goal is to have one "buildozer.spec" file in your app directory, ... Buildozer 0.35 with IndexError: list index out of range on...
Read more >
Python IndexError: List Index Out of Range [Easy Fix] - Finxter
To solve the “IndexError: list index out of range”, avoid do not access a non-existing list index. For example, my_list[5] causes an error...
Read more >
Exception IndexError: 'list index out of range' in 'kivy.graphics ...
I'm making a game in kivy. Up until now I've been working with only one screen - the game. Today I've been trying...
Read more >
List index out of range error when canceling filechooser in Kivy
There are many dependencies in your code, try removing them and post only the minimal code that raised the error. – ApuCoder. Jan...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found