ponces / treble_aosp

Script and patches for building TrebleDroid AOSP
Other
189 stars 47 forks source link

Build instructions incomplete #11

Closed whymartha closed 11 months ago

whymartha commented 11 months ago

Can the creator of this repo please say what OS, packages and build environment he uses to build this android 14 and treble app?

I have tried Debian and Arch Linux with, official instructions, different versions of Java and other packages but there seems to be a problem with libcrypto and Gradle.

Please more specific advice on environment.

boydaihungst commented 11 months ago

I'm also building this rom in arch based distro (endeavour OS). You need to install these packages: https://aur.archlinux.org/packages/android-sdk-build-tools/ https://aur.archlinux.org/packages/android-sdk-platform-tools/ https://archlinux.org/packages/extra/x86_64/android-tools/

Then install packages in this Building section from arch wiki: aosp-devel ttf-dejavu lineageos-devel jdk11-openjdk repo base-devel

Run cmd: archlinux-java set java-11-openjdk Put this in ~/.profile file and reboot. export JAVA_HOME=/usr/lib/jvm/default

Why java 11? In the build.sh file, it compiled treble app. Treble app config Edit: if you have 16Gb ram or less. You properly need to use swapfile otherwise, it will crash without any error message. 16Gb ram + 20Gb swapfile is NOT enough. I have to use up to 32gb swapfile

boydaihungst commented 11 months ago

The official instructions you mentioned is out dated or not apply to every rom. Read the build.sh file, each functions in the file runs from the top to bottom. This guide explains what those steps do. https://github.com/naz664/crDroid_gsi/blob/13/README.md

whymartha commented 11 months ago

I'm also building this rom in arch based distro (endeavour OS). You need to install these packages: https://aur.archlinux.org/packages/android-sdk-build-tools/ https://aur.archlinux.org/packages/android-sdk-platform-tools/ https://archlinux.org/packages/extra/x86_64/android-tools/

Then install packages in this Building section from arch wiki: aosp-devel ttf-dejavu lineageos-devel jdk11-openjdk repo base-devel

Run cmd: archlinux-java set java-11-openjdk Put this in ~/.profile file and reboot. export JAVA_HOME=/usr/lib/jvm/default

Why java 11? In the build.sh file, it compiled treble app. Treble app config Edit: if you have 16Gb ram or less. You properly need to use swapfile otherwise, it will crash without any error message. 16Gb ram + 20Gb swapfile is NOT enough. I have to use up to 32gb swapfile

Thank you so much for the info I will try this right away and report back.

You are right. The build Gradle section of the treble app config says java version 11

compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
    kotlinOptions {
        jvmTarget = '11'
    }

I didnt even know this. On Debian Bookworm default java jdk is version 17. This was not a problem for android 13 build though, because I also tried 13 and build was fine. Only 14 fails on Debian for me.

And yes thank you I also had to use huge swap file.

This needs to be updated in the Readme because I am sure other people will be confused too.

I will try out your advice thank you!

whymartha commented 11 months ago

The official instructions you mentioned is out dated or not apply to every rom. Read the build.sh file, each functions in the file runs from the top to bottom. This guide explains what those steps do. https://github.com/naz664/crDroid_gsi/blob/13/README.md

Hey man, I tried your suggestions but unfortunately I get the same build error again. Also the treble_app build fails with the same error as described in my other issue.

[ 83% 151235/182125] Install: out/target/product/tdgsi_arm64_ab/system/system_ext/apex/com.android.vndk.current/lib64/libdmabufheap.so
[ 83% 151236/182125] target Prebuilt: libdmabufheap.vendor.com.android.vndk.current (out/target/product/tdgsi_arm64_ab/obj/SHARED_LIBRARIES/libdmabufheap.vendor.com.android.vndk.current_intermediates/libdmabufheap.so)
[ 83% 151237/182125] //external/boringssl:libcrypto header-abi-diff libcrypto.so.abidiff
FAILED: out/soong/.intermediates/external/boringssl/libcrypto/android_vendor.34_arm64_armv8-a_shared/libcrypto.so.abidiff
(prebuilts/clang-tools/linux-x86/bin/header-abi-diff -target-version current -allow-unreferenced-changes -allow-unreferenced-elf-symbol-changes -lib libcrypto -arch arm64 -o out/soong/.intermediates/external/boringssl/libcrypto/android_vendor.34_arm64_armv8-a_shared/libcrypto.so.abidiff -new out/soong/.intermediates/external/boringssl/libcrypto/android_vendor.34_arm64_armv8-a_shared/libcrypto.so.lsdump -old prebuilts/abi-dumps/vndk/34/64/arm64/source-based/libcrypto.so.lsdump)|| (echo 'error: Please update ABI references with: $ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libcrypto' && (mkdir -p $DIST_DIR/abidiffs && cp out/soong/.intermediates/external/boringssl/libcrypto/android_vendor.34_arm64_armv8-a_shared/libcrypto.so.abidiff $DIST_DIR/abidiffs/) && exit 1)
******************************************************
error: libcrypto's ABI has EXTENDING CHANGES. Please check compatibility report at: out/soong/.intermediates/external/boringssl/libcrypto/android_vendor.34_arm64_armv8-a_shared/libcrypto.so.abidiff
******************************************************
error: Please update ABI references with: $ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libcrypto
[ 83% 151238/182125] Install: out/target/product/tdgsi_arm64_ab/apex/com.android.vndk.current/lib64/libdmabufheap.so
[ 83% 151239/182125] //external/libevent:libevent link libevent.so
[ 83% 151240/182125] //frameworks/compile/libbcc/bcinfo:libbcinfo header-abi-linker libbcinfo.so.lsdump
ninja: build stopped: subcommand failed.
00:28:00 ninja failed with: exit status 1

Here is exactly what I did to set up the build environment on EndeavorOS like you advised:

All this is running in a script, in case that's important.

bash treble_build_aosp/build.sh | tee build.log

Have you actually tried to build AOSP14 from this repository? I think it's impossible.

I have now read every guide and done all the research to understand that this issue lies with the code itself.

This repo creator has not built android 14 with treble_app using the build script that's offered here.

The treble_app is broken here and I believe that applying these patches is what breaks the entire aosp 14 build.

The prebuilt images that are offered here are either built without patches & treble_app or he most definitely didn't use this script to build it. I'm telling you, this sh*t is not working.

boydaihungst commented 11 months ago

I did with out any error. Here is my packages: https://sourceforge.net/projects/nubia-6s-pro-pixel-gsi/files/aosp_android_14/ Check the build number Screenshot_20231014-065356~2

whymartha commented 11 months ago

I did with out any error. Here is my packages: https://sourceforge.net/projects/nubia-6s-pro-pixel-gsi/files/aosp_android_14/ Check the build number

That's so strange. Did I miss something above? I did exactly what you said to setup the build environment, right? I really don't understand where my mistake lies. I installed all the packages and setup jdk11. What am I missing omg.

Maybe you can share your build script that sets up the environment?

Google20202 commented 11 months ago

I did with out any error. Here is my packages: https://sourceforge.net/projects/nubia-6s-pro-pixel-gsi/files/aosp_android_14/ Check the build number Screenshot_20231014-065356~2

Sir, please build this Android14 GSI for Legion Y700 (2023), ROM:https://dantmnf-my.sharepoint.com/personal/dant_local_cirno_xyz/_layouts/15/onedrive.aspx?id=%2Fpersonal%2Fdant%5Flocal%5Fcirno%5Fxyz%2FDocuments%2Fy700&ga=1 https://pan.whatsblog.site/s/L7F4 thanks

boydaihungst commented 11 months ago

I did with out any error. Here is my packages: https://sourceforge.net/projects/nubia-6s-pro-pixel-gsi/files/aosp_android_14/ Check the build number

That's so strange. Did I miss something above? I did exactly what you said to setup the build environment, right? I really don't understand where my mistake lies. I installed all the packages and setup jdk11. What am I missing omg.

Maybe you can share your build script that sets up the environment?

I use my own pc, not virtual or cloud, so there is no setup file to share. How about removing out folder and then building it again?

Google20202 commented 11 months ago

btw Is the aosp_android_14 you shared above universal for Android?

boydaihungst commented 11 months ago

btw Is the aosp_android_14 you shared above universal for Android?

No. I hardcode fingerprint position for my own device, so if you want to try a14 use the one from release page https://github.com/ponces/treble_build_aosp/releases

Google20202 commented 11 months ago

顺便说一句,你上面分享的aosp_android_14是Android通用的吗?

不。我为自己的设备硬编码了指纹位置因此,如果您想尝试a14,请使用发布页面https://github.com/ponces/treble_build_aosp/releases中的指纹位置

okay

Google20202 commented 11 months ago

btw Is the aosp_android_14 you shared above universal for Android?

No. I hardcode fingerprint position for my own device, so if you want to try a14 use the one from release page https://github.com/ponces/treble_build_aosp/releases

sry I am not good at this. Is it possible to compile the latest release page? Just latest date and Gapps

boydaihungst commented 11 months ago

Yes. Use the bgN file which contains gapps

Google20202 commented 11 months ago

Yes. Use the bgN file which contains gapps

Please build GSI with Gapps for October 13, 2023

whymartha commented 11 months ago

I did with out any error. Here is my packages: https://sourceforge.net/projects/nubia-6s-pro-pixel-gsi/files/aosp_android_14/ Check the build number

That's so strange. Did I miss something above? I did exactly what you said to setup the build environment, right? I really don't understand where my mistake lies. I installed all the packages and setup jdk11. What am I missing omg. Maybe you can share your build script that sets up the environment?

I use my own pc, not virtual or cloud, so there is no setup file to share. How about removing out folder and then building it again?

One thing I should mention is that I do the whole build on a EndeavorOS live boot with copytoram=y option enabled, so it's using tmpfs to load the whole system in a ramdisk. I have a 40GB swap partition on my build drive which I just pop in after the live system is booted.

I read in the arch guide that the android build heavily uses tmpfs. Do you think there could be a conflict in that area somehow?

Another thing I noticed is that the arch guide says to export java like this: export JAVA_HOME=/usr/lib/jvm/java-11-openjdk

But you wrote above to use default instead: export JAVA_HOME=/usr/lib/jvm/default

Could this be why the treble app build failed?

boydaihungst commented 11 months ago

I'm not sure about tmpfs. About java. "default" is the one you set with "archlinux-java set"

boydaihungst commented 11 months ago

The log is showing that the is problem with boringssl, which is a fork from openssl. Try to install both, may be fix your problem

boydaihungst commented 11 months ago

Yes. Use the bgN file which contains gapps

Please build GSI with Gapps for October 13, 2023

It takes so long to compile on my own (5-7 hours). And it doesn't different from the one from release page. If you want lastest, you have to build it your self.

Google20202 commented 11 months ago

Yes. Use the bgN file which contains gapps

Please build GSI with Gapps for October 13, 2023

It takes so long to compile on my own (5-7 hours). And it doesn't different from the one from release page. If you want lastest, you have to build it your self.

okay

ponces commented 11 months ago

If you believe instructions could be improved, please open a PR on phh's wiki as every GSI builder can take profit of this. I agree it could be updated. You can also refer to the regular building environment wiki. Thank you for your collaboration! Closed.