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.

Multiple issues with latest Android SDK

See original GitHub issue

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:

  1. Build fail at ant call because android-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	
  1. 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:closed
  • Created 6 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
lrq3000commented, Dec 31, 2017

@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 --bootstrap=webview, if I try to use pygame or sdl2 I get the errors described here: https://github.com/kivy/python-for-android/issues/1191#issuecomment-354580017

Would it be possible to fix these? Why are these assets required even though I don’t use them?

0reactions
inclementcommented, Jan 30, 2019

Closing as stale, everything seems to be working fine right now.

Read more comments on GitHub >

github_iconTop 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 >

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