`lime build android` fails after `lime setup android`


#1

I’m using Arch Linux. When running lime setup android, I set the following paths.

Path to Android SDK [/opt/android-sdk]:
Path to Android NDK [/opt/android-ndk]:
Path to Java JDK [/usr/lib/jvm/java-8-openjdk]:

Setup complete.

Then I run lime build android, and I get this error.

Error: You need to run "lime setup android" before you can use the Android target

Is there a way to enable verbose debugging so I can see why lime thinks I didn’t run the setup?

EDIT: Running strace lime build android reveals that lime is not even loading the ~/.lime/config.xml file with the path information, so how is it able to know where my Android SDK is installed?


#2

What does lime build android -v say?


#3
~/src/js/atlas/haxe/HelloWorld ❯ lime build android -v
_/\\\\\\______________________________________________
_\////\\\______________________________________________
_____\/\\\_____/\\\_____________________________________
______\/\\\____\///_____/\\\\\__/\\\\\_______/\\\\\\\\___
_______\/\\\_____/\\\__/\\\///\\\\\///\\\___/\\\/////\\\__
________\/\\\____\/\\\_\/\\\_\//\\\__\/\\\__/\\\\\\\\\\\___
_________\/\\\____\/\\\_\/\\\__\/\\\__\/\\\_\//\\///////____
________/\\\\\\\\\_\/\\\_\/\\\__\/\\\__\/\\\__\//\\\\\\\\\\__
________\/////////__\///__\///___\///___\///____\//////////___

Lime Command-Line Tools (6.3.0)

Initializing project...
Using project file: /home/vortico/src/js/atlas/haxe/HelloWorld/Project.xml
Reading Lime config: /home/vortico/.lime/config.xml
Error: You need to run "lime setup android" before you can use the Android target

#4

Try lime config ANDROID_SETUP true as a workaround (or manually add <set name="ANDROID_SETUP" value="true" /> to “~/.lime/config.xml”)


#5

It seems to already be set, so that didn’t seem to have an effect. Here is my ~/.lime/config.xml.

<?xml version="1.0" encoding="utf-8"?>
<config>
	
	<section id="defines">
		
		<set name="SDK_ROOT" value="/home/vortico/SDKs/" />
		<set name="ANDROID_NDK_DIR" value="/home/vortico/SDKs/" />
		<set name="ANDROID_SDK" value="/opt/android-sdk" />
		<set name="JAVA_HOME" value="/usr/lib/jvm/java-8-openjdk" />
		
	</section>
	<define name="ANDROID_NDK_ROOT" value="/opt/android-ndk" />
	<define name="ANDROID_SETUP" value="true" />
	
</config>

The SDK_ROOT and ANDROID_NDK_DIR values don’t seem to be correct, but changing them have no effect.


Installed Android support, now I can't build to windows
#6

The list of installed Android-related packages (through pacman) are

android-ndk
android-platform-19
android-platform-26
android-sdk
android-sdk-build-tools
android-sdk-build-tools-24.0.1
android-sdk-platform-tools
android-tools

Am I missing something? If I were to modify the source of lime to enable more verbose debugging before printing the ‘You need to run “lime setup android” before you can use the Android target’ message, how would I start?

It also seems that lime build android is in fact reading ~/.lime/config.xml because if I change the file to include incorrect syntax, it fails with a different error message. My use of strace must be incorrect…


#7

Aha! Resolved. The correct form of ~/.lime/config.xml is

<?xml version="1.0" encoding="utf-8"?>
<config>
	<section id="defines">
		<set name="SDK_ROOT" value="/home/vortico/SDKs/" />
		<set name="ANDROID_NDK_DIR" value="/home/vortico/SDKs/" />
		<set name="ANDROID_SDK" value="/opt/android-sdk" />
		<set name="JAVA_HOME" value="/usr/lib/jvm/java-8-openjdk" />
		<set name="ANDROID_SETUP" value="true" />
		<set name="ANDROID_NDK_ROOT" value="/opt/android-ndk" />
	</section>
</config>

It seems that lime setup android does not generate a valid config.xml. And my guess is that SDK_ROOT and ANDROID_NDK_DIR are no longer used or set, and should be removed.


#8

Lime on GIT is now fixed, the behavior of <define /> was not fully the behavior of both <haxedef /> and <set /> together, which was the intention. No need for a <section />, but the current release does work with <set /> but not <define />. This will be fixed next release to support either