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 build instructions out of date #267

Open
tellypresence opened this issue Jun 5, 2020 · 1 comment
Open

Android build instructions out of date #267

tellypresence opened this issue Jun 5, 2020 · 1 comment

Comments

@tellypresence
Copy link

tellypresence commented Jun 5, 2020

The android build instructions date from the Exlipse era and no longer work.

The android NDK has moved on, now

  • uses "side by side"
  • new folder structure
  • clang toolchain

so scripts/install_jni.sh is completely broken.

Please modernize android build instructions for Android Studio and modern NDK

@JMLX42
Copy link
Member

JMLX42 commented Jun 5, 2020

Yes that is correct.

As a workaround, here is the Docker container Dockerfile we use to target Android using CMake:

FROM lakoo/android-ndk:26-27.0.3-r17

# Intall make
RUN apt-get update && apt-get install make

# Install CMake
RUN cd / && \
    wget -q https://cmake.org/files/v3.9/cmake-3.9.6-Linux-x86_64.sh -O cmake.sh && \
    chmod +x ./cmake.sh && \
    ./cmake.sh --skip-license && \
    rm -rf cmake.sh

# Install the platform-tools
RUN cd /opt/android-sdk-linux/tools/bin && \
    echo "y" | ./sdkmanager "platform-tools" && \
    echo "y" | ./sdkmanager "platforms;android-25"

# Install ant
RUN apt-get -y install ant

# Install zipalign
RUN apt-get -y install zipalign

# Install freetype
RUN apt-get -y install libfreetype6

# Install old tool directory
RUN wget -q https://dl.google.com/android/repository/tools_r25.2.5-linux.zip && \
    unzip tools_r25.2.5-linux.zip && \
    rm -rf android-sdk-linux/tools tools_r25.2.5-linux.zip && \
    mv tools android-sdk-linux

CMD ["/bin/bash"]

and then the command lines:

mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=OFF -DWITH_PLUGINS=ON -DWITH_NODEJS_WORKER=ON -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk-linux/build/cmake/android.toolchain.cmake ..
make

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

No branches or pull requests

2 participants