-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Multiple issues with latest Android SDK #1212
Comments
Also when trying to compile a simple Hello World application using Kivy and python-for-android, here is the error I get (whenever I use SDL2 as a backend):
|
For the 2nd problem, just look in For your last problem, as a workaround, just create the directory and the file with touch, then there's should be another problem with a |
@defacto133 Thanks a lot! I did not think to look inside ant/build.xml ! I fixed it by replacing: <property name="java.target" value="1.5" />
<property name="java.source" value="1.5" /> by: <property name="java.target" value="7" />
<property name="java.source" value="7" /> And now it works! I got no additional error, the APK was compiled alright! However, it works only with Would it be possible to fix these? Why are these assets required even though I don't use them? |
I'm not sure what's goign on with this assets directory error, I haven't been able to reproduce it. I did just push a partial fix for the java version issue with gradle, though, and I'll look to add your ant fix as well - thanks for that. |
I have also had the issue with the assets directory and the icon file. Supposedly this was fixed by a recent pull request 1204, but following the instruction to install directly from here (pip install git+https://github.com/kivy/python-for-android.git) did not fix the problem for me. |
@Rybec I did not fix these issues, I only compiled with webview, which does not require these assets. Apparently it should be fixed by #1204 and #1205 but I did not test them out yet. It's weird it's difficult to reproduce as I simply used the Kivy Virtual Machine using the latest version of VirtualBox, normally this should be a pretty reproducible environment. |
No, according to #1204 QuadTriangle fixed it and inclement merged the fix commit into master. I'll give some background that I probably should have included before, since this is so hard to reproduce. The command I used to compile is this: My program is in ANDROIDAPI is 21, ANDROIDNDKVER is r16b, and TARGET is armeabi-v7a. I hope this helps. |
Ok, one more critical piece of information: I just got past another issue that was causing build problems, but now my APK files have a totally different name. I just noticed that it is using Gradle now. Before, it was using Ant. I did not have Gradle installed (and to be honest, I am not sure what I did that installed it, unless it is included with texlive and I just didn't notice it in massive list of dependencies I installed). Anyhow, now that it is using Gradle, this issue is not happening anymore. It did happen when Ant was used during the build. Perhaps this is why it is hard to reproduce! |
@Rybec how did you fix this private.mp3 problem? |
@feelfreelinux It wasn't a problem. It was just unclear how it worked. I will explain: private.mp3 is actually a zip file, but for some reason Android does not like to package or allow access to certain file types (I forget the details...). Renaming it to .mp3 makes Android think it is just a media asset, so it plays nice with it. This is why p4a uses private.mp3. This zip file is where all assets, some bits of the Python interpreter, and other things are stored, by python-for-android. This means that assets for your projects won't be found where you normally expect them. Instead, you will find them in this zip file. If you want to verify that a particular file is there, extract private.mp3 from the APK, rename it to private.zip, and open it. You should be able to browse it freely from there. |
@Rybec I do not understand. I get exactly the same error about the missing "private.mp3". I've already asked on https://groups.google.com/forum/#!forum/kivy-users. There are two or three other people affected by the issue. What are we doing wrong? Where should we look for what, and why? |
That's a separate issue from what I have been having. I did end up with it too though. I forget exactly what the solution was, but I think you just have to put an empty private.mp3 file somewhere. I believe it needs to go in the assets folder of the directory Kivy makes to compile your project into, but I don't recall what that directory was called. Basically, when you tell python-for-android to compile your project, it will create a directory where everything goes, and then it generates the APK from that. For some reason, when python-for-android tries to start putting stuff in private.mp3 (I think...), it just assumes the file is already there, and if it is not, it fails. The solution is to create the file, but leave it empty. I don't know where this directory is anymore though (and I was doing this on Debian, so if you are using OSX or Windows, it is probably in a different location anyway). Sorry I cannot provide more information, but maybe this will be enough to get you headed in the right direction. |
Thank you for trying to help. Is there anyone who had success in using kivy with python-for-android. And when so which way did you do it? Which operationg system, which version of installed packages, which command to build/install the "hello world" py program? |
Closing as stale, everything seems to be working fine right now. |
I tried to compile an APK using python-for-android for the first time, using the Kivy Virtual Machine.
I have updated python-for-android to the latest github version (commit 8829312fd187121384939627ec09354657821ae9) to avoid the "Invalid or unsupported command list" error.
Since then, I faced two additional issues:
ant
call becauseandroid-sdk/tools/ant/build.xml
does not exist anymore in latest releases of Android SDK. The only workaround I have found was to install an older SDK version prior to this change, such as android-sdk-r25.2.5. See here, here and here.Example error:
kivy/android/PythonService.java
includes a multi-catch statement that works only from v1.7 onwards.Example error:
I'm stuck at this point, as I could not locate where the v1.5 enforcement takes place.
The text was updated successfully, but these errors were encountered: