user4618429
user4618429

Reputation:

AOSP Android 12 Beta version build fails

I've tried to compile AOSP android 12 beta branches with no success.

I cloned the repo using:

repo init -u https://android.googlesource.com/platform/manifest -b refs/tags/android-s-beta-3
repo sync

and then used:

source build/envsetup.sh
lunch aosp_blueline-userdebug
m

now when it starts to run, after a while, it fails because there's duplication at the stub libraries:

[ 95% 86/90] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
cd "$(dirname "out/soong/.bootstrap/bin/soong_build")" && BUILDER="$PWD/$(basename "out/soong/.bootstrap/bin/soong_build")" && cd / && env -i "$BUILDER"     --top "$TOP"     --out "out/soong"     -n "out"     -d "out/soong/build.ninja.d"     -t -l out/.module_paths/Android.bp.list -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja --available_env out/soong/soong.environment.available --used_env out/soong/soong.environment.used Android.bp
error: build/soong/java/core-libraries/Android.bp:130:1: module "legacy.core.platform.api.stubs" already defined
       libcore/mmodules/core_platform_api/Android.bp:182:1 <-- previous definition here
error: build/soong/java/core-libraries/Android.bp:146:1: module "stable.core.platform.api.stubs" already defined
       libcore/mmodules/core_platform_api/Android.bp:198:1 <-- previous definition here
error: build/soong/java/core-libraries/Android.bp:164:1: module "legacy-core-platform-api-stubs-system-modules" already defined
       libcore/mmodules/core_platform_api/Android.bp:216:1 <-- previous definition here
error: build/soong/java/core-libraries/Android.bp:180:1: module "stable-core-platform-api-stubs-system-modules" already defined
       libcore/mmodules/core_platform_api/Android.bp:232:1 <-- previous definition here
error: libcore/JavaLibrary.bp:994:1: module "core.current.stubs" already defined
       build/soong/java/core-libraries/Android.bp:27:1 <-- previous definition here
error: libcore/JavaLibrary.bp:1015:1: module "core-current-stubs-for-system-modules" already defined
       build/soong/java/core-libraries/Android.bp:48:1 <-- previous definition here
error: libcore/JavaLibrary.bp:1041:1: module "core-current-stubs-system-modules" already defined
       build/soong/java/core-libraries/Android.bp:74:1 <-- previous definition here

I've also tried to change the build/soong branch to master and I've got another build faliure.

How do I compile those beta versions? what am I missing??

Moreover, all the Android 12 betas I've tried are broken. For example, another beta 1 question

Thanks!

Upvotes: 1

Views: 2200

Answers (2)

Varun RTR
Varun RTR

Reputation: 29

Actual problem is that this AOSP 12 Beta 3 is not fully synced and few of the modules were mentioned on different-2 files due to that you are getting these errors. I was also getting the same errors. enter image description here

To get rid of these errors by commenting these modules in these files.

error: build/soong/java/core-libraries/Android.bp:130:1: module "legacy.core.platform.api.stubs" already defined

libcore/mmodules/core_platform_api/Android.bp:182:1 <-- previous definition here

build/soong/java/core-libraries/Android.bp line 130 you can comment this module. /*java_library { name: "legacy.core.platform.api.stubs", visibility: core_platform_visibility, hostdex: true, compile_dex: true,

sdk_version: "none",
system_modules: "none",
static_libs: [
    "art.module.public.api.stubs.module_lib",
    "conscrypt.module.platform.api.stubs",
    "legacy.i18n.module.platform.api.stubs",
],
patch_module: "java.base",

}*/ Same you have to do with other modules too.

https://stackoverflow.com/users/4618429/omribager Have you build AOSP 12 Beta 3 successfully if yes, please mention the process because after these fixes also I am getting other modules issue.

[100% 1/1] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja FAILED: out/soong/build.ninja cd "$(dirname "out/soong/.bootstrap/bin/soong_build")" && BUILDER="$PWD/$(basename "out/soong/.bootstrap/bin/soong_build")" && cd / && env -i "$BUILDER" --top "$TOP" --out "out/soong" -n "out" -d "out/soong/build.ninja.d" -t -l out/.module_paths/Android.bp.list -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja --available_env out/soong/soong.environment.available --used_env out/soong/soong.environment.used Android.bp error: external/rust/crates/zip/Android.bp:21:1: "libzip" depends on undefined module "libflate2" 01:00:29 soong bootstrap failed with: exit status 1

failed to build some targets (01:08 (mm:ss))

Upvotes: 0

user4618429
user4618429

Reputation:

Ok so finally I've got this beta version compiled. The thing I've found is that beta branch/ tag is not necessarily compiling.

So what I did is looking at: https://android.googlesource.com/platform/

and when I ran into errors I've tried to checkout a later commit for this problematic sub-module that fixes this compilation. Doing this until finding a combination of commits that compiled together did the magic.

If someone would like to know which specific commit I've checkout in order to get Android 12 beta 2 compiled just tell me

Upvotes: 1

Related Questions