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 on Linux compiler configuration error #167

Open
Moe-Baker opened this issue Jan 7, 2023 · 16 comments
Open

Android on Linux compiler configuration error #167

Moe-Baker opened this issue Jan 7, 2023 · 16 comments
Labels
android Build issue documentation Improvements or additions to documentation

Comments

@Moe-Baker
Copy link

Moe-Baker commented Jan 7, 2023

Hello,
I'm using Ubuntu 16.04.6 32bit in VirtualBox, I followed the how to build instructions and I managed to build for Linux successfully, but android builds are giving me a compiler configuration error.

I'm using:
-gcc v5.4.0
-g++ v5.4.0
-clang v3.8.0-2

Here's the build log: https://pastebin.com/fqvRicQe.

The problem seems to be with the Android NDK, I downloaded android-ndk-r10e-linux-x86_64.zip as instructed, decompressed the files, ran chmod +x /ANDROID_NDK_DIRECTORY -R.

I'm noticing that the build script is looking for a folder that doesn't exist in my Android NDK, specifically:
android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86
I have
android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
Instead, did I download the wrong NDK, do I need to further setup the NDK?

Thank you for your time.

@stephen-cusi
Copy link

stephen-cusi commented Jan 8, 2023

It is better not to use Android emulation X86 architecture to compile, because it is very inefficient and error-prone, it is recommended to use CI to assist your compilation

@Moe-Baker
Copy link
Author

It is better not to use Android emulation X86 architecture to compile, because it is very inefficient and error-prone, it is recommended to use CI to assist your compilation

I'm running Ubuntu on a Windows host, not via Android termux.
Thank you for the CI/CD tip, but I'm trying to build an APK not just verify build reports.

@stephen-cusi
Copy link

Try the following command, recommended for Ubuntu 20.04 or 22.04

#Install dependent libraries
sudo apt update; sudo apt upgrade -y ;apt install g++ gcc
wget https://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip -o /dev/null
sudo apt update;sudo apt upgrade;sudo apt install ccache
unzip android-ndk-r10e-linux-x86_64.zip > /dev/null
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.1.0/clang+llvm-11.1.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz -o /dev/null
tar xvf clang+llvm-11.1.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz > /dev/null
mv clang+llvm-11.1.0-x86_64-linux-gnu-ubuntu-16.04 clang/
export PATH=$(pwd)/clang/bin:$PATH
mv android-ndk-r10e ndk/
export ANDROID_NDK_HOME=$(pwd)/ndk
mkdir ./andriod
git submodule init;git submodule update

@Moe-Baker
Copy link
Author

Thanks, I'll give it a try

@Moe-Baker
Copy link
Author

Try the following command, recommended for Ubuntu 20.04 or 22.04

The same problem remains, here's a build log.
I noticed you recommended using Ubuntu 20.04 or 22.04, but the build tutorial suggests using Ubuntu 16.04, is this no longer the case?
Also issue #69 suggests using Ubuntu 32 bit, using 64 bit Ubuntu gave me the same freetype not found error mentioned on that issue.

@Moe-Baker
Copy link
Author

Do you have the project setup correctly to export to android? I have this small modification I want to try and I'd really appreciate it if you can build it for me

@nillerusr
Copy link
Owner

nillerusr commented Jan 8, 2023

Well, i should update wiki and workflow scripts. I don't using gcc from ndk to build anymore

@nillerusr nillerusr added android Build issue documentation Improvements or additions to documentation labels Jan 8, 2023
@Moe-Baker
Copy link
Author

Moe-Baker commented Jan 9, 2023

Following the instructions mentioned in this Fork
I managed to get the install process to finish, but I end up with these .so files for the android architecture used as shown here, how can I get an APK?
Built using ./waf configure -T release --togles --android=armeabi-v7a-hard,host,21 --prefix=/home/mob/Workspace/Output.
Here's the Build Log.

@stephen-cusi
Copy link

stephen-cusi commented Jan 10, 2023

Following the instructions mentioned in this Fork I managed to get the install process to finish, but I end up with these .so files for the android architecture used as shown here, how can I get an APK? Built using ./waf configure -T release --togles --android=armeabi-v7a-hard,host,21 --prefix=/home/mob/Workspace/Output. Here's the Build Log.

https://github.com/nillerusr/srceng-android
Its compilation method is a bit troublesome.

@Moe-Baker
Copy link
Author

https://github.com/nillerusr/srceng-android Its compilation method is a bit troublesome.

I couldn't find build instructions, so I tried following the GitHub build action by using these commands.

Which gave me this error:
./scripts/workflow.sh: line 8: cd: jni/src/tierhook: No such file or directory make: *** No targets specified and no makefile found. Stop.
when trying to execute the ./scripts/workflow.sh shell script.

No jni/ directory exists in the srceng-android directory.
Are there any build instructions out there? or a fix for this?

@Moe-Baker
Copy link
Author

I just noticed that the Github action specifies the con-wrappers branch for the build, I missed that at first, that branch has the jni directory.
I'll try building that.

@Moe-Baker
Copy link
Author

I just managed to build the nillerusr/srceng-android project on the con-wrappers branch, but it's the old version that emulated the nvidia tegra, is the new version based on the source leak located on a different branch or something?

@stephen-cusi
Copy link

stephen-cusi commented Jan 11, 2023

我刚刚设法nillerusr/srceng-android在分支上构建项目con-wrappers,但它是模拟 nvidia tegra 的旧版本,基于源泄漏的新版本位于不同的分支上还是什么?

I just managed to build the "nillerusr/srceng-android" project on the "con-wrappers" branch, but it is the old version that emulates the nvidia tegra, is the new version based on the source code leak that is on a different branch or something?

andriod-fixes

I just managed to build the nillerusr/srceng-android project on the con-wrappers branch, but it's the old version that emulated the nvidia tegra, is the new version based on the source leak located on a different branch or something?

The default branch "Android-fixrs" is the new port starter.

@Moe-Baker
Copy link
Author

Alright, so I managed to build the android-fixes branch; the APK installs and opens fine, but whenever I try to launch the engine I get this SDL error.

SDL Error
Error: dlopen failed: library "libSDL2.so" not found

I noticed that the official APK has that .so file and some more, but my compilation of nillerusr/source-engine didn't produce some of these .so files.
I need to modify the SDL2 library directly, so I need a fresh libSDL2.so file, how can I compile that?

@stephen-cusi
Copy link

./waf -h

@nillerusr
Copy link
Owner

nillerusr commented Jan 14, 2023

@Moe-Baker
better build it with cmake and android-ndk-r20b. Well i need build scripts for building thirdpardy i think.

Metaphorme added a commit to Metaphorme/build-source-engine that referenced this issue Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Build issue documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants