ninja: error: unknown target 'chrome_public_apk'

2,472 views
Skip to first unread message

Zelong

unread,
Oct 12, 2019, 4:48:55 AM10/12/19
to Chromium-dev
I try to build a full browser of Chromimum for Android, but fails.

zelong@zelong-ThinkPad-T430:/media/zelong/2828a0f1-cc41-4428-854d-a7a18c59f5c6/Code/chromium/src$
autoninja -C out/Default chrome_public_apk
ninja: Entering directory `out/Default'
ninja: error: unknown target 'chrome_public_apk'

Anyone knows how to fix it?

Zelong

unread,
Oct 12, 2019, 4:51:47 AM10/12/19
to Chromium-dev

Daniel Bratell

unread,
Oct 12, 2019, 10:36:59 AM10/12/19
to gongz...@gmail.com, Chromium-dev
That target only exists if you build for Android so my first guess is
that you are building for the host platform (Linux).

Make sure you set the appropriate flags as documented in
https://chromium.googlesource.com/chromium/src/+/master/docs/android_build_instructions.md#Setting-up-the-build
and then regenerate the ninja files (which should happen automatically
but look out for the messages about it).

If that is not it, I can only recommend going through the instructions
and make sure you did not miss anything.

/Daniel

Xianzhu Wang

unread,
Oct 13, 2019, 5:41:25 PM10/13/19
to gongz...@gmail.com, Chromium-dev
Please check the following in your directory:
1. Does .gclient file (in the directory above src) contain "target_os = [ 'android' ]"?
2. Does your out/Default/args.gn contain "target_os = "android""?

If either is no, you probably missed some steps in the instructions. You can fix this by adding the lines into the files and updating the checkout.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
    http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/b6477940-a8bd-8cf2-9aa3-65d1a189203c%40gmail.com.

Zelong

unread,
Oct 14, 2019, 11:27:08 PM10/14/19
to Daniel Bratell, Chromium-dev

Hi, Daniel

Good to hear you again.

It works.  I remembered I set the target_os and target_cpu, but it somehow did not work.
That may be the reason why I failed.

I fixed it like this:
==========================================================================================================================================


zelong@zelong-ThinkPad-T430:/media/zelong/2828a0f1-cc41-4428-854d-a7a18c59f5c6/Code/chromium/src$ autoninja -C out/Default chrome_public_apk
ninja: Entering directory `out/Default'

[1/1] Regenerating ninja files


ninja: error: unknown target 'chrome_public_apk'

zelong@zelong-ThinkPad-T430:/media/zelong/2828a0f1-cc41-4428-854d-a7a18c59f5c6/Code/chromium/src$ gn args out/Default

# Build arguments go here.
# See "gn args <out_dir> --list" for available build arguments.

target_os = "android"
target_cpu = "arm64"

Waiting for editor on "/media/zelong/2828a0f1-cc41-4428-854d-a7a18c59f5c6/Code/chromium/src/out/Default/args.gn"...
Generating files...
Done. Made 28904 targets from 1842 files in 26823ms


zelong@zelong-ThinkPad-T430:/media/zelong/2828a0f1-cc41-4428-854d-a7a18c59f5c6/Code/chromium/src$ autoninja -C out/Default chrome_public_apk
ninja: Entering directory `out/Default'

[1/1] Regenerating ninja files

==========================================================================================================================================

And it began to build normally.

  

Zelong

unread,
Oct 14, 2019, 11:42:29 PM10/14/19
to Xianzhu Wang, Chromium-dev

Oh, Xianzhu

Almost missed your reply. Yes, you are also right. Thanks, I guess the reason is that I do not contain "target_os = "android"" under out/Default/args.gn

Satish Nada

unread,
May 11, 2021, 2:30:55 AM5/11/21
to Chromium-dev, gongz...@gmail.com, Chromium-dev, Xianzhu Wang
Hello Respected,
We tried to build separate chromium build APK for android using Android studio for ARM 64 we able run project build but its not working on my Android device (ARM 64 ABI) its give error as i have attached images 

We followed below steps 
https://chromium.googlesource.com/chromium/src/+/master/docs/android_build_instructions.md

For build apk we user this
autoninja -C out/Default chrome_public_apk

We used below GN files for build project for ABI ARM64 configuration.


target_os = "android"
target_cpu = "arm64"
is_debug = false
android_channel = "stable"
is_official_build = true
is_component_build = false
is_clang = true
symbol_level = 0
blink_symbol_level=0
use_unofficial_version_number = false
v8_use_external_startup_data = true
fieldtrial_testing_like_official_build = true
icu_use_data_file = false
ffmpeg_branding = "Chrome"
proprietary_codecs = true
multidex_in_release = true
exclude_unwind_tables = true

The below is Android Gradle Configuration for NDK 

For ARM 64 
ndk {
       abiFilters 'arm64-v8a'
}

and added SO files in 'arm64-v8a' directory under jniLibs directory
as below files name 
jniLibs/arm64-v8a
                    libchrome.so
                    libchrome__combined.so
                    libchrome_crashpad_handler.so
                    libchrome_pak_allowlist_inputs.so
                    libchromium_android_linker.so

Can any one share solution for this or any suggestions to resolve this issue

Thank you very much in advance.
chromium error 1.jpg
chromium error 2.jpg
Reply all
Reply to author
Forward
0 new messages