Multiple issues with latest Android SDK
See original GitHub issueI 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:
- Build fail at
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:
BUILD FAILED
/home/kivy/.local/share/python-for-android/dists/unnamed_dist_2/build.xml:93: Cannot find /home/kivy/android/android-sdk/tools/ant/build.xml imported from /home/kivy/.local/share/python-for-android/dists/unnamed_dist_2/build.xml
- The build of Java classes is done with enforcement of v1.5 (-source 1.5), but
kivy/android/PythonService.java
includes a multi-catch statement that works only from v1.7 onwards.
Example error:
[INFO]: STDOUT (last 20 lines of 79):
-pre-compile:
-compile:
[javac] Compiling 22 source files to /home/kivy/.local/share/python-for-android/dists/unnamed_dist_1/bin/classes
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] /home/kivy/.local/share/python-for-android/dists/unnamed_dist_1/tmp-src/org/kivy/android/PythonService.java:107: error: multi-catch statement is not supported in -source 1.5
[javac] } catch (NoSuchMethodException | IllegalAccessException |
[javac] ^
[javac] (use -source 7 or higher to enable multi-catch statement)
[javac] 1 error
[javac] 3 warnings
BUILD FAILED
/home/kivy/android/android-sdk-r25.2.5/tools/ant/build.xml:716: The following error occurred while executing this line:
/home/kivy/android/android-sdk-r25.2.5/tools/ant/build.xml:730: Compile failed; see the compiler error output for details.
I’m stuck at this point, as I could not locate where the v1.5 enforcement takes place.
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (2 by maintainers)
Top Results From Across the Web
Known issues with Android Studio and Android Gradle Plugin
Find out about current known issues with Android Studio and the Android Gradle Plugin. ... "peer not authenticated" errors from Gradle sync or...
Read more >Multiple instances of Android SDK Build-Tools, Bug or Feature?
if i have downloaded multiple versions of the SDK Build-tools, do you think ADT would automatically use only the latest one to build...
Read more >Android Emulator Troubleshooting - Xamarin - Microsoft Learn
This article explains how to diagnose and work around problems that may occur when using the Android Emulator.
Read more >Fix an installed Android app that isn't working - Google Help
Fix an installed Android app that isn't working ... After each step, restart your phone to see if it fixed the issue. ......
Read more >Solving Android SDK Problems - YouTube
Fix Android Fragment Error · Swift Programming Tutorial for Beginners (Full Tutorial) · Better Sounding Subwoofer Arrays Part 2 - Sub Arcs, Delay ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@defacto133 Thanks a lot! I did not think to look inside ant/build.xml !
I fixed it by replacing:
by:
And now it works! I got no additional error, the APK was compiled alright!
However, it works only with
--bootstrap=webview
, if I try to usepygame
orsdl2
I get the errors described here: https://github.com/kivy/python-for-android/issues/1191#issuecomment-354580017Would it be possible to fix these? Why are these assets required even though I don’t use them?
Closing as stale, everything seems to be working fine right now.