4

I got the following error when I try to build A7.1.

[ 15% 1827/11495] target Package: framework-res ...bj/APPS/framework-res_intermediates/package.apk)
warning: string 'candidates_style' has no default translation.
warning: string 'candidates_style' is missing 41 required localizations: az_AZ be_BY bn_BD bs_BA en_AU en_CA en_GB en_IN en_NZ en_SG en_US eo_EU et_EE eu_ES gl_ES gu_IN hy_AM is_IS ka_GE kk_KZ km_KH kn_IN ky_KG lo_LA mk_MK ml_IN mn_MN mr_IN ms_MY my_MM ne_NP pa_IN si_LK sq_AL ta_IN te_IN ur_PK uz_UZ zh_CN zh_HK zh_TW
warning: string 'gsm_alphabet_default_charset' has no default translation.
warning: string 'gsm_alphabet_default_charset' is missing 90 required localizations: af_ZA am_ET ar_EG az_AZ be_BY bg_BG bn_BD bs_BA ca_ES cs_CZ da_DK de_AT de_CH de_DE de_LI el_GR en_AU en_CA en_GB en_IN en_NZ en_SG en_US eo_EU es_ES es_US et_EE eu_ES fa_IR fi_FI fr_BE fr_CA fr_CH fr_FR gl_ES gu_IN hi_IN hr_HR hu_HU hy_AM in_ID is_IS it_CH it_IT iw_IL ja_JP ka_GE kk_KZ km_KH kn_IN ky_KG lo_LA lt_LT lv_LV mk_MK ml_IN mn_MN mr_IN ms_MY my_MM nb_NO ne_NP nl_BE nl_NL pa_IN pl_PL pt_BR pt_PT ro_RO ru_RU si_LK sk_SK sl_SI sq_AL sr_RS sv_SE sw_TZ ta_IN te_IN th_TH tl_PH tr_TR uk_UA ur_PK uz_UZ vi_VN zh_CN zh_HK zh_TW zu_ZA
warning: string 'wfcSpnFormat' has no default translation.
warning: string 'wfcSpnFormat' is missing 41 required localizations: az_AZ be_BY bn_BD bs_BA en_AU en_CA en_GB en_IN en_NZ en_SG en_US eo_EU et_EE eu_ES gl_ES gu_IN hy_AM is_IS ka_GE kk_KZ km_KH kn_IN ky_KG lo_LA mk_MK ml_IN mn_MN mr_IN ms_MY my_MM ne_NP pa_IN si_LK sq_AL ta_IN te_IN ur_PK uz_UZ zh_CN zh_HK zh_TW
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

But the really strange thing is that.

I have two SDK directories like /projects/SDK3288A71/ and /projects/SRC3288A71/ also, try to build this each SDK and one SDK was successfully built but others happened above ninja error.

I have tried:

  1. heap size up to 4g,6g
  2. size up to swap to 16GB
  3. make installclean -j64
  4. re-cloning from git server

but I got the same error. This error point is not the same.

Sometimes it got to 2% , 10%, 51%, 14%, 15%.... I don't know why and what happened to this.

Please advise me.

robsiemb
  • 6,157
  • 7
  • 32
  • 46
busybong
  • 41
  • 1
  • 2
  • 1
    Post the full error log. The problem is not visible in the snippet you posted, it probably is somewhere before that. When you use -jN in make, errors don't always appear as the last line – Rick Sanchez Nov 16 '19 at 08:46

1 Answers1

5

why does building fail?

Make sure to sync to a good branch, such as android-10.0.0_r25 Not all branch can be built successfully.

My Laptop is 12G (8G + 4G), I found when I compile , It always fails. (the java heap sizeis big enough, it's 4G, and I set the environment variable JAVA_TOOL_OPTIONS)

and I check the verbose log under out dir. And I can't find any clue to fix error.

see my error logs:

FAILED: out/soong/.intermediates/frameworks/base/test-mock/android.test.mock.docs.system/android_common/android.test.mock.docs.system-stubs.srcjar out/soong/.intermediates/frameworks/base/test-mock/android.test.mock.docs.system/android_common/android.test.mock.docs.system_api.txt out/soong/.intermediates/frameworks/base/test-mock/android.test.mock.docs.system/android_common/android.test.mock.docs.system_removed.txt Picked up _JAVA_OPTIONS: -Xmx4096m Killed

I compiled again and again , it failed again and again , until I ran top command and looked the ninja and java processes memory usage, and I found the reason that they run out of memory , made the building process stuck.

specially when building //frameworks/base:system-api-stubs-docs Metalava, when building this project, the memory usage is up to 6~7GB, and ninja kill the stuck building process, so building fails.

So, when error occurs , I ran make -j1 command instead of default make, only one java and ninja process run, so don't need so many memory , It's compiled succeed.

You can try my ways

when error occurs, you can run the make -j1 command instead of default command make, so only one buiding process is running, it won't run out of your memory, the building system will continue to build the left projects when error occurs.

after pass the project which cause failure , you can type CTRL + C to interrupt building process. remember just type once, and wait the all java process exit to avoid introducing unexpected errors. after that, type the make command again without -j1 to use 4 threads to building the left projects again.

finally, you will see:

build completed successfully (10:48 (mm:ss))
Kevin Ding
  • 568
  • 5
  • 9