Skip to content
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

Android cross compiler installation woes #419

Open
cazzullo opened this issue Jun 2, 2021 · 8 comments
Open

Android cross compiler installation woes #419

cazzullo opened this issue Jun 2, 2021 · 8 comments
Labels

Comments

@cazzullo
Copy link

cazzullo commented Jun 2, 2021

Hello.
I am trying to install the LambdaNative cross-compile environment for Android under a Linux machine running Ubuntu 20.04. I am following the info shown in the page: https://github.com/part-cw/lambdanative/wiki/Getting-Started
where the following text could be found:
"Extract the contents of the Command Line tools, which will give a tools directory. Move this to a new directory so that the path to it is /usr/local/android-sdk-macosx/cmdline-tools/ (so that in it should be a tools/ directory), then run the following to change the ownership of this directory to your current account [username]."
I am having two problems here:

  1. I have a Linux machine yet the text asks me to create a "/usr/local/android-sdk-macosx" directory. This is at least odd.
  2. the text is telling me that there should be a "tools/" directory in the command line tools archive but I could not find it (I downloaded the file: commandlinetools-linux-7302050_latest.zip)
    Is anyone able to help me on the installation? Many thanks for any help provided.
@mgorges
Copy link
Contributor

mgorges commented Jun 2, 2021

  1. I can change the text in the wiki to say /usr/local/android-sdk-[platform] - the example provided uses macOS but the folder name is not hardcoded; the SETUP#L6 code autodetects this with wildcards so it shouldn't matter? You could even have it in a different place as long as you modify the SETUP to point to the right place.
  2. We still build using ant and not gradle and don't have the resources to switch soon as the gradle complexity is staggering. targets/android/build-binary#L108 aims to download and add an ant-based tools folder from the last version that contained it automatically, so not sure why that doesn't work for you?

@cazzullo
Copy link
Author

cazzullo commented Jun 2, 2021

Thanks for the help, I appreciate it.
The point 1 is clearer now, it just seemed odd that the OS name were different and I feared there could have been some hard-coded filename path somewhere. Point solved.
As for the point 2, please forgive me if I am merely restating what you said but I need it to grasp it, I cannot use the latest android cmdline tool that it is using another build tool (gradle instead of ant) so I must revert to an old version of the tools that could be recovered using the "targets/android/build-binary#L108" script; if this is the case then no problem, I will try to use the tool or just download an old version of the tools. Hope you understand that I was blindly following the web page when I just hit the "missing tools/" wall and stopped on my track.

@mgorges
Copy link
Contributor

mgorges commented Jun 2, 2021

We can try if the script still works with the latest command line tools - I am using a version from September 2020 but I don't quite know what version of the SDK that actually is? I don't have the linux machine in front of me (or SSHable) but this is on my mac:

/usr/local/android-sdk-macosx/cmdline-tools/tools/bin %./sdkmanager --version
4.0.1

@cazzullo
Copy link
Author

cazzullo commented Jun 3, 2021

My real problem is that, for what both you and the 'Getting started' guide are telling me the final structure of the cmdline tools should be akin to:
<some path, usually /usr/local>/android-sdk-[platform]/cmdline-tools/tools/
while the archive I have downloaded contains:
unzip -l commandlinetools-linux-7302050_latest.zip
Length Date Time Name


 5312  2010-01-01 00:00   cmdline-tools/bin
 1155  2010-01-01 00:00   cmdline-tools/lib
   84  2010-01-01 00:00   cmdline-tools/source.properties
70001  2010-01-01 00:00   cmdline-tools/NOTICE.txt

with no tools directory (except in: cmdline-tools/lib/external/com/android/tools/build/aapt2-proto/4.1.0-alpha01-6193524/aapt2-proto-4.1.0-alpha01-6193524.jar but I do not think it matters) an so I fear the lambdanative scripts will not find the desidered directory

@mgorges
Copy link
Contributor

mgorges commented Jun 3, 2021

We could change the script to look somewhere else too - as this simply re-building a place it used to be in historically?

I believe you might have missed a part of the 5th point of Wiki:Getting-Started guide: Move this to a new directory so that the path to it is /usr/local/android-sdk-[platform]/cmdline-tools/ (so that in it should be a tools/ directory),[...] - for me this means that /usr/local/android-sdk-macosx/cmdline-tools/tools/bin contains sdkmanager, avdmanager and the other executables.

@mgorges
Copy link
Contributor

mgorges commented Jun 3, 2021

I think I have figured it out - this is a somewhat odd workaround for the ./sdkmanager --list behaviour, which requires a structure of <sdk>/cmdline-tools/[whatever]/bin/sdkmanager to work around the missing 'sdk_root' definition, as illustrated by Error: Either specify it explicitly with --sdk_root= or move this package into its expected location: <sdk>/cmdline-tools/latest/. We call the [whatever] tools, the current Google example calls that latest.

@cazzullo
Copy link
Author

cazzullo commented Jun 4, 2021

Thanks, I will report as soon as I will have tested it. Anyway I suspect you are right.

@cazzullo
Copy link
Author

cazzullo commented Jun 6, 2021

Hello and thanks for the help, the installation ended well and now I am able to develop for Linux. Next step, trying to compile an android application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants