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

building for android fails #104

Open
devriesewouter89 opened this issue Oct 18, 2022 · 5 comments
Open

building for android fails #104

devriesewouter89 opened this issue Oct 18, 2022 · 5 comments

Comments

@devriesewouter89
Copy link

Hi All
I'm trying to build LSL for android to be able to use it in a Unity VR app (android device).
I'm assuming I need an .aar or .so file within my unity environment to be able to build a VR app for android.

I'm posting this in the 'main' repo as I have the issue in both liblsl-Android as well as liblsl-Java.
I've tested this issue on multiple devices as well as Ubuntu 22.04 and Windows 10.
When I try to build via Android studio as well as via command line gradle, I encounter the next message:
com.intellij.openapi.externalSystem.model.ExternalSystemException (no error message)
Which isn't really helpful :)

I've adapted my local.properties file so it targets:
android SDK & Ndk (ndk version 21.0.6113669)
cmake 3.22.1
java 11.0.16

Are there some prerequisites missing from the instructions to be able to build?

Am I correct assuming that I need the .aar or .so file to use from unity to an android device?

Sincerely
Wouter

@cboulay
Copy link
Collaborator

cboulay commented Oct 18, 2022

I can't help you because I don't have an Android build environment setup and I don't have the bandwidth to maintain it.

Have you seen the following docs? Are you saying the instructions are no longer working? If so then maybe we can convince someone with a working Android build to look into it.

https://labstreaminglayer.readthedocs.io/dev/build_android.html

@devriesewouter89
Copy link
Author

Hi Chadwick
thanks for the response (also on other subject). I've seen the documentation. The build android documentation is not working for me. On slack there was an other person with the same error, in channel 'users' at October 6, who based himself on the documentation.
I'm not very familiar in the android environment, yet can't find anything useful on this error elsewhere. I think it could already help to diagnose if the problem persists if I can check with exact same setup of someone who has a working version (Unity version, Android SDK/Ndk , CMake version, JDK) as now I don't know where to look to debug.

@devriesewouter89
Copy link
Author

I can't help you because I don't have an Android build environment setup and I don't have the bandwidth to maintain it.

Have you seen the following docs? Are you saying the instructions are no longer working? If so then maybe we can convince someone with a working Android build to look into it.

https://labstreaminglayer.readthedocs.io/dev/build_android.html

I've poked around a bit more. On Ubuntu 22.04 to be specific.
I've tested multiple versions of Android Sdk ndk (all 21.x.x versions) and Cmake 3.18 as well as 3.22

The error I now get is:

* What went wrong:
Could not determine the dependencies of task ':generateJsonModelRelease'.
> Invalid revision: 3.18.1-g262b901

This is with a clean clone of the labstreamlayer repo with liblsl-Java submodule.
my local.properties are:

ndk.dir=/home/scoot/Android/Sdk/ndk/21.0.6113669
android.ndkVersion=21.0.6113669
sdk.dir=/home/scoot/Android/Sdk
cmake.dir=/home/scoot/Android/Sdk/cmake/3.18.1

Is there someone on the labstreamlayer project who could help with checking if the:

  • the documentation is up to date (and if perhaps some dependencies are missing)
  • the repo is still functional
    ?

I'm aware that maintaining is a drag so I understand it if there's no room now to look into it. If so, then I have to look elsewhere and perhaps just implement a websocket.

Sincerely
Wouter

@devriesewouter89
Copy link
Author

I can't help you because I don't have an Android build environment setup and I don't have the bandwidth to maintain it.

Have you seen the following docs? Are you saying the instructions are no longer working? If so then maybe we can convince someone with a working Android build to look into it.

https://labstreaminglayer.readthedocs.io/dev/build_android.html

Just gave another option a try: github actions. I get the same error about the invalid revision there:
https://github.com/luca-arts/android_-ci_test
(Note, this is a quick and dirty setup, with copying of the specific repos. I'll remove this in near future, but could perhaps help finding the issue?)

Sincerely
Wouter

@Dazzle995
Copy link

Dazzle995 commented Nov 25, 2022

Hi everyone,
I was confronted with the same problem and found a solution for me.

I had to change the android gradle dependecy in liblsl-Java/build.gradle from
classpath 'com.android.tools.build:gradle:4.0.1' to classpath 'com.android.tools.build:gradle:8.0.0-alpha01'.

I was going through the dependency chain from Unity to Android Sdk to cmake and finally to java and gradle.
Depending on the versions other people are using, a different version might be necessary.

Hopefully this is useful for people struggling with this :)

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

No branches or pull requests

3 participants