How to Compile Android Lollipop (5.1.1) Contacts onWindows OS

This is the modified build system to be used to compile existing APK from Android Lollipop 5.1.1 Framework. In this example it is used to compile Android’s Contacts.apk.

You can used it also to compile another Android packages.

The build system is taken from android-5.1.1_r38 source tree. Basically the compile error is not finding which module that is required, the slash or backslash problem and certain script code that is not supported by bash shell on Windows OS.

There’s also the problem when unzipping the download *.gz file from Android source repository. You should use the gzip and tar command line program from MSYS or GNUWIN32.

The build script is proven to be successfully run on windows version 7-6.1.7601-SP1.

The modified build scripts already uploaded to github:

https://github.com/surya-rakanta/AndroidBuildSystemOnWindows

Below is the log of compiling session from start to finish and how to solve each compiling issue one by one.

The script is checked and revised using the probe text such as until …, etc, so you will see some weird output such as until herexxy9aay2, etc, in the compiling session log below. Ignore it.

You can examine the final modified build system in the downloaded from github.

Retrieve the source from:

https://android.googlesource.com/platform/packages/apps/Contacts/+/android-5.1.1_r38

Put it into structures here:

D:\Projects\Lollipop\platform\packages\apps\Contacts

Download build system:

https://android.googlesource.com/platform/build/+/android-5.1.1_r38

Put it here:

D:\Projects\Lollipop\platform\build

Perform modification in envsetup.sh, but first copy this shell file into back up file

Execute envsetup.sh, and we have:

D:\Projects\Lollipop\platform\build>bash
bash-3.1$ ./envsetup.sh
./envsetup.sh: line 1134: unexpected argument `(‘ to conditional binary operator

./envsetup.sh: line 1134: syntax error near `(^’
./envsetup.sh: line 1134: ` if [[ $CPU_ABI =~ (^|,)arm64 ]]; then’

Remark it

We have:

bash-3.1$ ./envsetup.sh
./envsetup.sh: line 1184: unexpected argument `(‘ to conditional binary operator

./envsetup.sh: line 1184: syntax error near `(^’
./envsetup.sh: line 1184: ` if [[ $EXE =~ (^|/)(app_process|dalvikvm)(|32|64)$
]]; then’

Remark again:

We have:

bash-3.1$ ./envsetup.sh
./envsetup.sh: line 1279: unexpected argument `(‘ to conditional binary operator

./envsetup.sh: line 1279: syntax error near `(^’
./envsetup.sh: line 1279: ` if [[ $EXE =~ (^|/)(app_process|dalvikvm)(|32|
64)$ ]]; then’

Remark

We have:

bash-3.1$ ./envsetup.sh
ps: illegal option — o
Usage ps [-aefl] [-u uid]
-f = show process uids, ppids
-l = show process uids, ppids, pgids, winpids
-u uid = list processes owned by uid
-a, -e = show processes of all users
-s = show process summary
-W = show windows as well as cygwin processes
WARNING: Only bash is supported, use of other shell would lead to erroneous resu
lts
make: Entering directory `/d/Projects/Lollipop/platform’
build/core/envsetup.mk:67: *** Unable to determine HOST_OS from uname -sm: MINGW
32_NT-6.1 i686!. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

#### make failed to build some targets ####

Modify in D:\Projects\Lollipop\platform\build\core\envsetup.mk:

We have:

bash-3.1$ ./envsetup.sh
ps: illegal option — o
Usage ps [-aefl] [-u uid]
-f = show process uids, ppids
-l = show process uids, ppids, pgids, winpids
-u uid = list processes owned by uid
-a, -e = show processes of all users
-s = show process summary
-W = show windows as well as cygwin processes
WARNING: Only bash is supported, use of other shell would lead to erroneous resu
lts
make: Entering directory `/d/Projects/Lollipop/platform’
build/core/envsetup.mk:94: *** Unable to determine HOST_ARCH from uname -sm: MIN
GW32_NT-6.1 i686!. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

#### make failed to build some targets ####

Modify in D:\Projects\Lollipop\platform\build\core\envsetup.mk:

HOST_ARCH := x86

We have:

bash-3.1$ ./envsetup.sh
ps: illegal option — o
Usage ps [-aefl] [-u uid]
-f = show process uids, ppids
-l = show process uids, ppids, pgids, winpids
-u uid = list processes owned by uid
-a, -e = show processes of all users
-s = show process summary
-W = show windows as well as cygwin processes
WARNING: Only bash is supported, use of other shell would lead to erroneous resu
lts
make: Entering directory `/d/Projects/Lollipop/platform’
build/core/config.mk:454: *** Error: could not find jdk tools.jar, please check
if your JDK was installed correctly. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

#### make failed to build some targets (1 seconds) ####

Checking:

D:\Projects\Lollipop\platform>bash
bash-3.1$ build/core/find-jdk-tools-jar.sh
/c/Program Files (x86)/Java/jdk1.6.0_26/lib/tools.jar

Remark in D:\Projects\Lollipop\platform\build\core\config.mk:

We have:

bash-3.1$ ./envsetup.sh
ps: illegal option — o
Usage ps [-aefl] [-u uid]
-f = show process uids, ppids
-l = show process uids, ppids, pgids, winpids
-u uid = list processes owned by uid
-a, -e = show processes of all users
-s = show process summary
-W = show windows as well as cygwin processes
WARNING: Only bash is supported, use of other shell would lead to erroneous resu
lts
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.1.1
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86
HOST_OS=windows
HOST_OS_EXTRA=Windows-7-6.1.7601-SP1
HOST_BUILD_TYPE=release
BUILD_ID=LMY49M
OUT_DIR=out
============================================
Checking build tools versions…
************************************************************
You are attempting to build with the incorrect version
of java.

Your version is: java version “1.8.0_131” Java(TM) SE Runtime Environment (build
1.8.0_131-b11) Java HotSpot(TM) Client VM (build 25.131-b11, mixed mode, sharin
g).
The required version is: “1.7.x”

Please follow the machine setup instructions at
https://source.android.com/source/initializing.html
************************************************************
make: Entering directory `/d/Projects/Lollipop/platform’
build/core/main.mk:167: *** stop. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

#### make failed to build some targets (6 seconds) ####

bash-3.1$

Install jdk-7u79-windows-i586.exe, change windows path environment and verify:

C:\Windows\System32>java -version
java version “1.7.0_79”
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) Client VM (build 24.79-b02, mixed mode, sharing)

We have:

bash-3.1$ ./envsetup.sh
ps: illegal option — o
Usage ps [-aefl] [-u uid]
-f = show process uids, ppids
-l = show process uids, ppids, pgids, winpids
-u uid = list processes owned by uid
-a, -e = show processes of all users
-s = show process summary
-W = show windows as well as cygwin processes
WARNING: Only bash is supported, use of other shell would lead to erroneous resu
lts
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.1.1
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86
HOST_OS=windows
HOST_OS_EXTRA=Windows-7-6.1.7601-SP1
HOST_BUILD_TYPE=release
BUILD_ID=LMY49M
OUT_DIR=out
============================================
Checking build tools versions…
make: Entering directory `/d/Projects/Lollipop/platform’
build/core/main.mk:459: sdk/build/windows_sdk_whitelist.mk: No such file or dire
ctory
build/core/main.mk:460: development/build/windows_sdk_whitelist.mk: No such file
or directory
including build/tools/acp\Android.mk …

#### make failed to build some targets (32 seconds) ####

bash-3.1$

And the windows crash:

The cause of this crash is located at D:\Projects\Lollipop\platform\build\core\base_rules.mk:

gpl_license_file := $(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*_GPL* MODULE_LICENSE*_MPL* MODULE_LICENSE*_LGPL*)

Create a test make file called mktest.mk inside D:\Projects\Lollipop\platform with content as follows:

#SHELL := /bin/bash

###########################################################
## Scan through each directory of $(1) looking for files
## that match $(2) using $(wildcard). Useful for seeing if
## a given directory or one of its parents contains
## a particular file. Returns the first match found,
## starting furthest from the root.
###########################################################
$(info until herexxy9aa1)

define find-parent-file
$(strip \
$(eval _fpf := $(wildcard $(foreach f, $(2), $(strip $(1))/$(f)))) \
$(if $(_fpf),$(_fpf), \
$(if $(filter-out ./ .,$(1)), \
$(call find-parent-file,$(patsubst %/,%,$(dir $(1))),$(2)) \
) \
) \
)
endef

LOCAL_PATH := “build/tools/acp\”
$(info until $(LOCAL_PATH))

gpl_license_file := $(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*_GPL* MODULE_LICENSE*_MPL* MODULE_LICENSE*_LGPL*)

The cause of make program crash is present of unwanted backslash in build/tools/acp\

Remark by making gpl_license_file blank for the moment, we have:

bash-3.1$ ./envsetup.sh
ps: illegal option — o
Usage ps [-aefl] [-u uid]
-f = show process uids, ppids
-l = show process uids, ppids, pgids, winpids
-u uid = list processes owned by uid
-a, -e = show processes of all users
-s = show process summary
-W = show windows as well as cygwin processes
WARNING: Only bash is supported, use of other shell would lead to erroneous resu
lts
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.1.1
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86
HOST_OS=windows
HOST_OS_EXTRA=Windows-7-6.1.7601-SP1
HOST_BUILD_TYPE=release
BUILD_ID=LMY49M
OUT_DIR=out
============================================
make: Entering directory `/d/Projects/Lollipop/platform’
build/core/main.mk:459: sdk/build/windows_sdk_whitelist.mk: No such file or dire
ctory
build/core/main.mk:460: development/build/windows_sdk_whitelist.mk: No such file
or directory
including build/tools/acp\Android.mk …
until herexxy9aay2
make: *** No rule to make target `development/build/windows_sdk_whitelist.mk’.
Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

#### make failed to build some targets (13 seconds) ####

Retrieve sdk tree.

Place it in in local directory

Retrieve development tree from:

Place it in:

Change envsetup.sh script inside function make():

local start_time=$(date +”%s”)
#$(get_make_command) “$@”
command make -C /d/Projects/Lollipop/platform -f build/core/main.mk BUILD_MODULES_IN_PATHS=d:/Projects/Lollipop/platform/packages/apps/Contacts -p > myMake1.txt

We have:

bash-3.1$ ./envsetup.sh
ps: illegal option — o
Usage ps [-aefl] [-u uid]
-f = show process uids, ppids
-l = show process uids, ppids, pgids, winpids
-u uid = list processes owned by uid
-a, -e = show processes of all users
-s = show process summary
-W = show windows as well as cygwin processes
WARNING: Only bash is supported, use of other shell would lead to erroneous resu
lts
/bin/bash: line 0: cd: development/appsBluetoothDebug : No such file or director
y
/bin/bash: line 0: cd: development/appsBuildWidget : No such file or directory
find: src: No such file or directory
build/core/java.mk:23: *** development/apps\BuildWidget\: Invalid LOCAL_SDK_VERS
ION ‘current’ Choices are: . Stop.

#### make failed to build some targets (11 seconds) ####

Checking the included sub directories in D:\Projects\Lollipop\platform\build\core\main.mk using info statement:

D:\Projects\Lollipop\platform\build\core\main.mk

We get the result:

the sub dirs external/openssl prebuilt prebuilts build/libs/host build/tools/z
ipalign dalvik/dexdump dalvik/libdex dalvik/tools/dmtracedump dalvik/tools/hprof
-conv development/host development/tools/etc1tool development/tools/line_endings
external/clang external/easymock external/expat external/gtest external/libcxx
external/libcxxabi external/compiler-rt external/libpng external/llvm external/s
qlite/dist external/zlib external/zopfli frameworks/base frameworks/compile fram
eworks/native frameworks/rs frameworks/tools system/core/adb system/core/fastboo
t system/core/libcutils system/core/liblog system/core/libsparse system/core/lib
ziparchive system/core/libzipfile system/core/libutils system/extras/ext4_utils
build/tools/signapk dalvik/dx libcore development/apps development/tools/mkstubs
frameworks/compile/libbcc packages build/tools/acp

Probing with:

$(info the sub dir make file $(subdir_makefiles))

We get:

the sub dir make file build/libs/host\Android.mk build/tools/acp\Android.mk buil
d/tools/signapk\Android.mk build/tools/zipalign\Android.mk development/apps\Blue
toothDebug\Android.mk development/apps\BuildWidget\Android.mk development/apps\C
ustomLocale\Android.mk development/apps\DevelopmentSettings\Android.mk developme
nt/apps\Development\Android.mk development/apps\Fallback\Android.mk development/
apps\GestureBuilder\Android.mk development/apps\NinePatchLab\Android.mk developm
ent/apps\OBJViewer\Android.mk development/apps\SdkSetup\Android.mk development/a
pps\SettingInjectorSample\Android.mk development/apps\WidgetPreview\Android.mk d
evelopment/apps\launchperf\Android.mk development/host\Android.mk development/to
ols/etc1tool\Android.mk development/tools/line_endings\Android.mk development/to
ols/mkstubs\Android.mk packages\apps\ContactsCommon\Android.mk packages\apps\Con
tacts\Android.mk

Most of the program is not needed, so just re-assign the subdir_makefiles in D:\Projects\Lollipop\platform\build\core\main.mk:

subdir_makefiles := packages/apps/ContactsCommon/Android.mk packages/apps/Contacts/Android.mk

Now we have:

bash-3.1$ ./envsetup.sh
ps: illegal option — o
Usage ps [-aefl] [-u uid]
-f = show process uids, ppids
-l = show process uids, ppids, pgids, winpids
-u uid = list processes owned by uid
-a, -e = show processes of all users
-s = show process summary
-W = show windows as well as cygwin processes
WARNING: Only bash is supported, use of other shell would lead to erroneous resu
lts
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.1.1
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86
HOST_OS=windows
HOST_OS_EXTRA=Windows-7-6.1.7601-SP1
HOST_BUILD_TYPE=release
BUILD_ID=LMY49M
OUT_DIR=out
============================================
including packages/apps/ContactsCommon/Android.mk …
find: ../PhoneCommon/src: No such file or directory
including packages/apps/Contacts/Android.mk …
find: ../PhoneCommon/src: No such file or directory
make: Entering directory `/d/Projects/Lollipop/platform’
make: *** No rule to make target `prebuilts/sdk/api/.txt’, needed by `out/target
/common/obj/PACKAGING/checkpublicapi-last-timestamp’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

#### make failed to build some targets (14 seconds) ####

bash-3.1$

Retrieve PhoneCommon source tree from:

Place it in:

We have:

bash-3.1$ ./envsetup.sh
ps: illegal option — o
Usage ps [-aefl] [-u uid]
-f = show process uids, ppids
-l = show process uids, ppids, pgids, winpids
-u uid = list processes owned by uid
-a, -e = show processes of all users
-s = show process summary
-W = show windows as well as cygwin processes
WARNING: Only bash is supported, use of other shell would lead to erroneous resu
lts
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.1.1
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86
HOST_OS=windows
HOST_OS_EXTRA=Windows-7-6.1.7601-SP1
HOST_BUILD_TYPE=release
BUILD_ID=LMY49M
OUT_DIR=out
============================================
including packages/apps/ContactsCommon/Android.mk …
including packages/apps/Contacts/Android.mk …
make: Entering directory `/d/Projects/Lollipop/platform’
make: *** No rule to make target `prebuilts/sdk/api/.txt’, needed by `out/target
/common/obj/PACKAGING/checkpublicapi-last-timestamp’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

#### make failed to build some targets (15 seconds) ####

bash-3.1$

Copy files from:

Place it in:

We have:

bash-3.1$ ./envsetup.sh
ps: illegal option — o
Usage ps [-aefl] [-u uid]
-f = show process uids, ppids
-l = show process uids, ppids, pgids, winpids
-u uid = list processes owned by uid
-a, -e = show processes of all users
-s = show process summary
-W = show windows as well as cygwin processes
WARNING: Only bash is supported, use of other shell would lead to erroneous resu
lts
make: *** No rule to make target `out/target/common/obj/PACKAGING/public_api.txt
‘, needed by `out/target/common/obj/PACKAGING/checkpublicapi-last-timestamp’. S
top.

#### make failed to build some targets (14 seconds) ####

out/target/common/obj/PACKAGING/checkpublicapi-last-timestamp: prebuilts/sdk/api/22.txt out/target/common/obj/PACKAGING/public_api.txt frameworks/base/api/removed.txt out/host/windows-x86/bin/apicheck.exe out/target/common/docs/api-stubs-timestamp
# Implicit rule search has not been done.
# File does not exist.
# File has not been updated.
# variable set hash-table stats:
# Load=0/32=0%, Rehash=0, Collisions=0/0=0%
# commands to execute (from `build/core/tasks/apicheck.mk’, line 46):
@echo “Checking API:” checkpublicapi-last
@ ( out/host/windows-x86/bin/apicheck.exe -JXmx1024m -J”classpath /c/Program Files (x86)/Java/jdk1.7.0_79/lib/tools.jar:out/host/windows-x86/framework/doclava.jar:out/host/windows-x86/framework/jsilver.jar” -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 -error 16 -error 17 -error 18 prebuilts/sdk/api/22.txt out/target/common/obj/PACKAGING/public_api.txt frameworks/base/api/removed.txt out/target/common/obj/PACKAGING/removed.txt || ( cat build/core/apicheck_msg_last.txt ; exit 38 ) )
@ mkdir -p $(dir $@)
@ touch $@

# INTERNAL_PLATFORM_API_FILE is the one build by droiddoc.
# Note that since INTERNAL_PLATFORM_API_FILE is the byproduct of api-stubs module,
# (See frameworks/base/Android.mk)
# we need to add api-stubs as additional dependency of the api check.

# Check that the API we’re building hasn’t broken the last-released
# SDK version.
$(eval $(call check-api, \
checkpublicapi-last, \
$(SRC_API_DIR)/$(last_released_sdk_version).txt, \
$(INTERNAL_PLATFORM_API_FILE), \
frameworks/base/api/removed.txt, \
$(INTERNAL_PLATFORM_REMOVED_API_FILE), \
-hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 \
-error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
-error 16 -error 17 -error 18 , \
cat $(BUILD_SYSTEM)/apicheck_msg_last.txt, \
check-public-api, \
$(call doc-timestamp-for,api-stubs) \
))

The out/target/common/obj/PACKAGING/public_api.txt is generated by the command:

update-public-api: out/target/common/obj/PACKAGING/public_api.txt | out/host/-x86/bin/acp
# Phony target (prerequisite of .PHONY).
# Implicit rule search has not been done.
# File does not exist.
# File has not been updated.
# commands to execute (from `build/core/tasks/apicheck.mk’, line 79):
@echo Copying current.txt
$(hide) $(ACP) $(INTERNAL_PLATFORM_API_FILE) frameworks/base/api/current.txt
@echo Copying removed.txt
$(hide) $(ACP) $(INTERNAL_PLATFORM_REMOVED_API_FILE) frameworks/base/api/removed.txt

Retrieve source tree from:

Place it in:

But we still have:

make: *** No rule to make target `out/target/common/obj/PACKAGING/public_api.txt
‘, needed by `out/target/common/obj/PACKAGING/checkpublicapi-last-timestamp’. S
top.

Let’s try to build ACP first, but we have:

# ACP is always for the build OS, not for the host OS
ACP := $(BUILD_OUT_EXECUTABLES)/acp$(BUILD_EXECUTABLE_SUFFIX)

BUILD_OUT_EXECUTABLES := out/host/-x86/bin

Which is:

BUILD_OUT_EXECUTABLES := $(BUILD_OUT)/bin

Where as:

BUILD_OUT := $(OUT_DIR)/host/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)

Modify in D:\Projects\Lollipop\platform\build\core\envsetup.mk:

Let’s revert to original one:

command make -C /d/Projects/Lollipop/platform -f build/core/main.mk all_modules BUILD_MODULES_IN_PATHS= build/d:/Projects/Lollipop/platform/packages/apps/Contacts -p > myMake2.txt

We have:

bash-3.1$ ./envsetup.sh
ps: illegal option — o
Usage ps [-aefl] [-u uid]
-f = show process uids, ppids
-l = show process uids, ppids, pgids, winpids
-u uid = list processes owned by uid
-a, -e = show processes of all users
-s = show process summary
-W = show windows as well as cygwin processes
WARNING: Only bash is supported, use of other shell would lead to erroneous resu
lts
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.1.1
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86
HOST_OS=windows
HOST_OS_EXTRA=Windows-7-6.1.7601-SP1
HOST_BUILD_TYPE=release
BUILD_ID=LMY49M
OUT_DIR=out
============================================
including build/libs/host\Android.mk …
including build/tools/acp\Android.mk …
including build/tools/signapk\Android.mk …
including build/tools/zipalign\Android.mk …
including development/apps\BluetoothDebug\Android.mk …
/bin/bash: line 0: cd: development/appsBluetoothDebug : No such file or director
y
including development/apps\BuildWidget\Android.mk …
/bin/bash: line 0: cd: development/appsBuildWidget : No such file or directory
find: src: No such file or directory
make: Entering directory `/d/Projects/Lollipop/platform’
build/core/java.mk:23: *** development/apps\BuildWidget\: Invalid LOCAL_SDK_VERS
ION ‘current’ Choices are: . Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

#### make failed to build some targets (11 seconds) ####

bash-3.1$

Check environment variables:

Choices are: $(TARGET_AVAILABLE_SDK_VERSIONS))

# makefile (from `build/core/config.mk’, line 599)
TARGET_AVAILABLE_SDK_VERSIONS :=

TARGET_AVAILABLE_SDK_VERSIONS := $(call numerically_sort,\
$(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/android.jar,%, \
$(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/android.jar)))

HISTORICAL_SDK_VERSIONS_ROOT := $(TOPDIR)prebuilts/sdk

Download from:

Place it in:

We have:

bash-3.1$ ./envsetup.sh
ps: illegal option — o
Usage ps [-aefl] [-u uid]
-f = show process uids, ppids
-l = show process uids, ppids, pgids, winpids
-u uid = list processes owned by uid
-a, -e = show processes of all users
-s = show process summary
-W = show windows as well as cygwin processes
WARNING: Only bash is supported, use of other shell would lead to erroneous resu
lts
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.1.1
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86
HOST_OS=windows
HOST_OS_EXTRA=Windows-7-6.1.7601-SP1
HOST_BUILD_TYPE=release
BUILD_ID=LMY49M
OUT_DIR=out
============================================
including build/libs/host\Android.mk …
including build/tools/acp\Android.mk …
including build/tools/signapk\Android.mk …
including build/tools/zipalign\Android.mk …
including development/apps\BluetoothDebug\Android.mk …
/bin/bash: line 0: cd: development/appsBluetoothDebug : No such file or director
y
including development/apps\BuildWidget\Android.mk …
/bin/bash: line 0: cd: development/appsBuildWidget : No such file or directory
find: src: No such file or directory
make: Entering directory `/d/Projects/Lollipop/platform’
build/core/java.mk:23: *** development/apps\BuildWidget\: Invalid LOCAL_SDK_VERS
ION ‘current’ Choices are: 21. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

#### make failed to build some targets (11 seconds) ####

bash-3.1$

Edit the subdir_makefiles to:

subdir_makefiles := build/libs/host\Android.mk build/tools/acp\Android.mk build/tools/signapk\Android.mk build/tools/zipalign\Android.mk development/apps/BluetoothDebug\Android.mk development/apps/BuildWidget\Android.mk development/apps/CustomLocale\Android.mk development/apps\DevelopmentSettings\Android.mk development/apps/Development\Android.mk development/apps/Fallback\Android.mk development/apps/GestureBuilder\Android.mk development/apps/NinePatchLab\Android.mk development/apps/OBJViewer\Android.mk development/apps/SdkSetup\Android.mk development/apps/SettingInjectorSample\Android.mk development/apps/WidgetPreview\Android.mk development/apps/launchperf\Android.mk development/host\Android.mk development/tools/etc1tool\Android.mk development/tools/line_endings\Android.mk development/tools/mkstubs\Android.mk packages/apps/ContactsCommon\Android.mk packages/apps/Contacts\Android.mk

And change the command inside function make():

command make -C /d/Projects/Lollipop/platform -f build/core/main.mk all_modules BUILD_MODULES_IN_PATHS= d:/Projects/Lollipop/platform/packages/apps/Contacts

bash-3.1$ ./envsetup.sh
ps: illegal option — o
Usage ps [-aefl] [-u uid]
-f = show process uids, ppids
-l = show process uids, ppids, pgids, winpids
-u uid = list processes owned by uid
-a, -e = show processes of all users
-s = show process summary
-W = show windows as well as cygwin processes
WARNING: Only bash is supported, use of other shell would lead to erroneous resu
lts
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.1.1
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86
HOST_OS=windows
HOST_OS_EXTRA=Windows-7-6.1.7601-SP1
HOST_BUILD_TYPE=release
BUILD_ID=LMY49M
OUT_DIR=out
============================================
including build/libs/host\Android.mk …
including build/tools/acp\Android.mk …
including build/tools/signapk\Android.mk …
including build/tools/zipalign\Android.mk …
including development/apps/BluetoothDebug\Android.mk …
including development/apps/BuildWidget\Android.mk …
including development/apps/CustomLocale\Android.mk …
including development/apps\DevelopmentSettings\Android.mk …
including development/apps/Development\Android.mk …
including development/apps/Fallback\Android.mk …
including development/apps/GestureBuilder\Android.mk …
including development/apps/NinePatchLab\Android.mk …
including development/apps/OBJViewer\Android.mk …
including development/apps/SdkSetup\Android.mk …
including development/apps/SettingInjectorSample\Android.mk …
including development/apps/WidgetPreview\Android.mk …
including development/apps/launchperf\Android.mk …
including development/host\Android.mk …
including development/tools/etc1tool\Android.mk …
including development/tools/line_endings\Android.mk …
including development/tools/mkstubs\Android.mk …
including packages/apps/ContactsCommon\Android.mk …
including packages/apps/Contacts\Android.mk …
make: Entering directory `/d/Projects/Lollipop/platform’
Import includes file: out/host/windows-x86/obj/STATIC_LIBRARIES/libhost_intermed
iates/import_includes
host C: libhost <= build/libs/host\/CopyFile.c
build/libs/host/CopyFile.c:1:0: warning: -fPIC ignored for target (all code is p
osition independent) [enabled by default]
gcc.exe: warning: out/host/windows-x86/obj/STATIC_LIBRARIES/libhost_intermediate
s: linker input file unused because linking not done
Export includes file: build/libs/hostAndroid.mk — out/host/windows-x86/obj/STAT
IC_LIBRARIES/libhost_intermediates/export_includes
host StaticLib: libhost (out/host/windows-x86/obj/STATIC_LIBRARIES/libhost_inter
mediates/libhost.a)
Import includes file: out/host/windows-x86/obj/EXECUTABLES/acp_intermediates/imp
ort_includes
host C: acp /dev/null))
subdirs += \
# external/ant-glob \
# external/eclipse-windowbuilder/propertysheet \
# external/hamcrest \
# external/junit \
# sdk/apkbuilder \
# sdk/eclipse/scripts/rcp \
# sdk/testutils

subdirs += \
prebuilt \
prebuilts \
build/libs/host \
build/tools/zipalign \
dalvik/dexdump \
dalvik/libdex \
dalvik/tools/dmtracedump \
dalvik/tools/hprof-conv \
development/host \
development/tools/etc1tool \
development/tools/line_endings \
external/clang \
external/easymock \
external/expat \
external/gtest \
external/libcxx \
external/libcxxabi \
external/compiler-rt \
external/libpng \
external/llvm \
external/sqlite/dist \
external/zlib \
external/zopfli \
frameworks/base \
frameworks/compile \
frameworks/native \
frameworks/rs \
frameworks/tools \
system/core/adb \
system/core/fastboot \
system/core/libcutils \
system/core/liblog \
system/core/libsparse \
system/core/libziparchive \
system/core/libzipfile \
system/core/libutils \
system/extras/ext4_utils

subdirs += \
build/tools/signapk \
dalvik/dx \
libcore \
development/apps \
development/tools/mkstubs \
frameworks/compile/libbcc \
packages

Building Contacts.apk:

command make -C /d/Projects/Lollipop/platform -f build/core/main.mk out/target/product/generic/obj/APPS/Contacts_intermediates/package.apk

out/target/product/generic/system/priv-app/Contacts/Contacts.apk: out/target/product/generic/obj/APPS/Contacts_intermediates/package.apk | out/host/windows-x86/bin/acp out/target/product/generic/obj/NOTICE_FILES/src//system/priv-app/Contacts/Contacts.apk.txt

make: *** No rule to make target `out/host/windows-x86/bin/aapt.exe’, needed by
`out/target/common/obj/APPS/Contacts_intermediates/src/R.stamp’. Stop.
./envsetup.sh: line 1704: out/target/product/generic/obj/APPS/Contacts_intermedi
ates/package.apk: No such file or directory

Copy existing aapt.exe from latest Android tools sdk to the directory.

We have:

make: Entering directory `/d/Projects/Lollipop/platform’
target R.java/Manifest.java: Contacts (out/target/common/obj/APPS/Contacts_inter
mediates/src/R.stamp)
ERROR: resource directory ‘frameworks\support\v7\cardview\res’ does not exist
make: *** [out/target/common/obj/APPS/Contacts_intermediates/src/R.stamp] Error
1
make: Leaving directory `/d/Projects/Lollipop/platform’
./envsetup.sh: line 1704: out/target/product/generic/obj/APPS/Contacts_intermedi
ates/package.apk: No such file or directory

#### make failed to build some targets (17 seconds) ####

Copy from:

We have:

make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/sdk_v21_i
ntermediates/classes.jar’, needed by `out/target/common/obj/APPS/Contacts_interm
ediates/classes-full-debug.jar’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’
./envsetup.sh: line 1704: out/target/product/generic/obj/APPS/Contacts_intermedi
ates/package.apk: No such file or directory

full_java_lib_deps := out/target/common/obj/JAVA_LIBRARIES/android.test.runner_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/com.android.contacts.common.test_intermediates/javalib.jar out/target/common/obj/APPS/Contacts_intermediates/classes.jar

including build/libs/host\Android.mk …
the full java libx
including build/tools/acp\Android.mk …
the full java libx
including build/tools/signapk\Android.mk …
the full java libx
including build/tools/zipalign\Android.mk …
the full java libx out/host/common/obj/JAVA_LIBRARIES/bouncycastle-host_interm
ediates/javalib.jar out/host/common/obj/JAVA_LIBRARIES/bouncycastle-bcpkix-host
_intermediates/javalib.jar
including development/apps/BluetoothDebug\Android.mk …
the full java libx out/host/common/obj/JAVA_LIBRARIES/bouncycastle-host_interm
ediates/javalib.jar out/host/common/obj/JAVA_LIBRARIES/bouncycastle-bcpkix-host
_intermediates/javalib.jar
including development/apps/BuildWidget\Android.mk …
the full java libx out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/cl
asses.jar
including development/apps/CustomLocale\Android.mk …
the full java libx out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/cl
asses.jar
including development/apps\DevelopmentSettings\Android.mk …
the full java libx out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/cl
asses.jar
including development/apps/Development\Android.mk …
the full java libx out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/cl
asses.jar
including development/apps/Fallback\Android.mk …
the full java libx out/target/common/obj/JAVA_LIBRARIES/android.test.runner_inte
rmediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates
/classes.jar out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates
/classes.jar
including development/apps/GestureBuilder\Android.mk …
the full java libx out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/cl
asses.jar
including development/apps/NinePatchLab\Android.mk …
the full java libx out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/cl
asses.jar
including development/apps/OBJViewer\Android.mk …
including development/apps/SdkSetup\Android.mk …
the full java libx out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/cl
asses.jar
including development/apps/SettingInjectorSample\Android.mk …
the full java libx out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/cl
asses.jar
including development/apps/WidgetPreview\Android.mk …
the full java libx out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/cl
asses.jar
including development/apps/launchperf\Android.mk …
the full java libx out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/cl
asses.jar
including development/host\Android.mk …
including development/tools/etc1tool\Android.mk …
the full java libx out/target/common/obj/JAVA_LIBRARIES/android.test.runner_inte
rmediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates
/classes.jar
including development/tools/line_endings\Android.mk …
the full java libx out/target/common/obj/JAVA_LIBRARIES/android.test.runner_inte
rmediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates
/classes.jar
including development/tools/mkstubs\Android.mk …
the full java libx out/target/common/obj/JAVA_LIBRARIES/android.test.runner_inte
rmediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates
/classes.jar
including packages/apps/ContactsCommon\Android.mk …
the full java libx out/host/common/obj/JAVA_LIBRARIES/asm-4.0_intermediates/ja
valib.jar
the full java libx out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/cl
asses.jar out/target/common/obj/JAVA_LIBRARIES/com.android.vcard_intermediates/
javalib.jar out/target/common/obj/JAVA_LIBRARIES/guava_intermediates/javalib.ja
r out/target/common/obj/JAVA_LIBRARIES/android-common_intermediates/javalib.jar
out/target/common/obj/JAVA_LIBRARIES/android-support-v13_intermediates/javalib
.jar out/target/common/obj/JAVA_LIBRARIES/android-support-v4_intermediates/java
lib.jar out/target/common/obj/JAVA_LIBRARIES/libphonenumber_intermediates/javal
ib.jar out/target/common/obj/JAVA_LIBRARIES/libgeocoding_intermediates/javalib.
jar
the full java libx out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/cl
asses.jar out/target/common/obj/JAVA_LIBRARIES/com.android.vcard_intermediates/
javalib.jar out/target/common/obj/JAVA_LIBRARIES/guava_intermediates/javalib.ja
r out/target/common/obj/JAVA_LIBRARIES/android-common_intermediates/javalib.jar
out/target/common/obj/JAVA_LIBRARIES/android-support-v13_intermediates/javalib
.jar out/target/common/obj/JAVA_LIBRARIES/android-support-v4_intermediates/java
lib.jar out/target/common/obj/JAVA_LIBRARIES/libphonenumber_intermediates/javal
ib.jar out/target/common/obj/JAVA_LIBRARIES/libgeocoding_intermediates/javalib.
jar
the full java libx out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/cl
asses.jar out/target/common/obj/JAVA_LIBRARIES/com.android.vcard_intermediates/
javalib.jar out/target/common/obj/JAVA_LIBRARIES/guava_intermediates/javalib.ja
r out/target/common/obj/JAVA_LIBRARIES/android-common_intermediates/javalib.jar
out/target/common/obj/JAVA_LIBRARIES/android-support-v13_intermediates/javalib
.jar out/target/common/obj/JAVA_LIBRARIES/android-support-v4_intermediates/java
lib.jar out/target/common/obj/JAVA_LIBRARIES/libphonenumber_intermediates/javal
ib.jar out/target/common/obj/JAVA_LIBRARIES/libgeocoding_intermediates/javalib.
jar
the full java libx out/target/common/obj/JAVA_LIBRARIES/android.test.runner_inte
rmediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/guava_intermediates/c
lasses.jar out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/classes.ja
r out/target/common/obj/APPS/com.android.contacts.common_intermediates/classes
.jar
including packages/apps/Contacts\Android.mk …
the full java libx out/target/common/obj/JAVA_LIBRARIES/android.test.runner_inte
rmediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates
/classes.jar out/target/common/obj/JAVA_LIBRARIES/com.android.contacts.common.t
est_intermediates/javalib.jar out/target/common/obj/APPS/com.android.contacts.c
ommon_intermediates/classes.jar
the full java libx out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/cl
asses.jar out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/cl
asses.jar out/target/common/obj/JAVA_LIBRARIES/voip-common_intermediates/classes
.jar out/target/common/obj/JAVA_LIBRARIES/com.android.vcard_intermediates/javal
ib.jar out/target/common/obj/JAVA_LIBRARIES/android-common_intermediates/javali
b.jar out/target/common/obj/JAVA_LIBRARIES/guava_intermediates/javalib.jar out
/target/common/obj/JAVA_LIBRARIES/android-support-v13_intermediates/javalib.jar
out/target/common/obj/JAVA_LIBRARIES/android-support-v7-cardview_intermediates/
javalib.jar out/target/common/obj/JAVA_LIBRARIES/android-support-v7-palette_int
ermediates/javalib.jar out/target/common/obj/JAVA_LIBRARIES/android-support-v4_
intermediates/javalib.jar out/target/common/obj/JAVA_LIBRARIES/libphonenumber_i
ntermediates/javalib.jar out/target/common/obj/JAVA_LIBRARIES/libgeocoding_inte
rmediates/javalib.jar
make: Entering directory `/d/Projects/Lollipop/platform’
make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/sdk_v21_i
ntermediates/classes.jar’, needed by `out/target/common/obj/APPS/Contacts_interm
ediates/classes-full-debug.jar’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’
./envsetup.sh: line 1704: out/target/product/generic/obj/APPS/Contacts_intermedi
ates/package.apk: No such file or directory

#### make failed to build some targets (17 seconds) ####

bash-3.1$

The sdk_v21 is the result of:

$(LOCAL_JAVA_LIBRARIES)

Which is from D:\Projects\Lollipop\platform\build\core\java.mk:

LOCAL_JAVA_LIBRARIES := sdk_v$(LOCAL_SDK_VERSION) $(LOCAL_JAVA_LIBRARIES)

Try copy Android.mk and CleanSpec.mk from:

To:

markerxy core-libart conscrypt okhttp core-junit bouncycastle ext

We have:

============================================
including packages/apps/ContactsCommon/Android.mk …
including packages/apps/Contacts/Android.mk …
including prebuilts/sdk/Android.mk …
make: Entering directory `/d/Projects/Lollipop/platform’
make: *** No rule to make target `out/target/common/obj/APPS/framework-res_inter
mediates/src/R.stamp’, needed by `out/target/common/obj/APPS/Contacts_intermedia
tes/src/R.stamp’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

#### make failed to build some targets (30 seconds) ####

# makefile (from `build/core/package_internal.mk’, line 303)
framework_res_package_export_deps := out/target/common/obj/APPS/framework-res_intermediates/src/R.stamp

Perform some changes inside D:\Projects\Lollipop\platform\build\core\package_internal.mk:

useful command:

$(info the localsdkresy $(LOCAL_SDK_RES_VERSION))

Now we have:

including packages/apps/ContactsCommon/Android.mk …
including packages/apps/Contacts/Android.mk …
including prebuilts/sdk/Android.mk …
make: Entering directory `/d/Projects/Lollipop/platform’
make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/core-juni
t_intermediates/classes.jar’, needed by `out/target/common/obj/APPS/com.android.
contacts.common_intermediates/classes-full-debug.jar’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

out/target/common/obj/APPS/com.android.contacts.common_intermediates/classes-full-debug.jar: out/target/common/obj/JAVA_LIBRARIES/core-junit_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/com.android.vcard_intermediates/javalib.jar out/target/common/obj/JAVA_LIBRARIES/guava_intermediates/javalib.jar out/target/common/obj/JAVA_LIBRARIES/android-common_intermediates/javalib.jar out/target/common/obj/JAVA_LIBRARIES/android-support-v13_intermediates/javalib.jar out/target/common/obj/JAVA_LIBRARIES/android-support-v4_intermediates/javalib.jar out/target/common/obj/JAVA_LIBRARIES/libphonenumber_intermediates/javalib.jar out/target/common/obj/JAVA_LIBRARIES/libgeocoding_intermediates/javalib.jar out/target/common/obj/APPS/com.android.contacts.common_intermediates/src/R.stamp

Copy the required junit from platform/external/junit:

We have:

including external/junit/Android.mk …
the full java libx2 out/host/common/obj/JAVA_LIBRARIES/core-libart-hostdex_inter
mediates/javalib.jar
the full java libx2 out/host/common/obj/JAVA_LIBRARIES/core-libart-hostdex_inter
mediates/javalib.jar
the full java libx2 out/host/common/obj/JAVA_LIBRARIES/core-junit-hostdex_interm
ediates/javalib.jar out/host/common/obj/JAVA_LIBRARIES/core-libart-hostdex_inter
mediates/javalib.jar
make: Entering directory `/d/Projects/Lollipop/platform’
build/core/java.mk:23: *** external/junit: Invalid LOCAL_SDK_VERSION ‘4’ Choices
are: current 21. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

#### make failed to build some targets (7 seconds) ####

Download version of 4 of local sdk, we have:

make: Entering directory `/d/Projects/Lollipop/platform’
make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/core-liba
rt_intermediates/classes.jar’, needed by `out/target/common/obj/JAVA_LIBRARIES/c
ore-junit_intermediates/classes-full-debug.jar’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

Copy from:

We have:

including prebuilts/sdk/Android.mk …
make: *** No rule to make target `external/stlport/libstlport.mk’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

copy from:

https://android.googlesource.com/platform/external/stlport/+/android-5.1.1_r38

We have:

target Java: core-libart (out/target/common/obj/JAVA_LIBRARIES/core-libart_inter
mediates/classes)
cygwin warning:
MS-DOS style path detected: d:/Projects/Lollipop/platform
Preferred POSIX equivalent is: /cygdrive/d/Projects/Lollipop/platform
CYGWIN environment variable option “nodosfilewarning” turns off this warning.
Consult the user’s guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
sh: /cygdrive/c/Program Files (x86)/Java/jdk1.7.0_79/bin/javac: Argument list to
o long

Checking:

# makefile (from `build/core/definitions.mk’, line 1617)
define transform-java-to-classes.jar
@echo “target Java: $(PRIVATE_MODULE) ($(PRIVATE_CLASS_INTERMEDIATES_DIR))”
$(call compile-java,$(TARGET_JAVAC),$(PRIVATE_BOOTCLASSPATH))
endef

target Java: core-libart (out/target/common/obj/JAVA_LIBRARIES/core-libart_inter
mediates/classes Compile with development/host/windows/prebuilt/javawrap.exe -J-
Xmx256m -source 1.7 -target 1.7 -Xmaxerrs 9999999 and parameter -bootclasspath o
ut/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar)
cygwin warning:

From command line we have:

D:\Projects\Lollipop\platform>bash
bash-3.1$ d:/Projects/Lollipop/platform/development/host/windows/prebuilt/javaw
rap.exe -J-Xmx256m -source 1.7 -target 1.7 -Xmaxerrs 9999999 -encoding UTF-8 -g
-bootclasspath out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/
classes.jar -extdirs “””” -d out/target/common/obj/JAVA_LIBRARIES/core-libart_i
ntermediates/classes -encoding UTF-8 -Xmaxwarns 9999999 @out/target/common/obj/
JAVA_LIBRARIES/core-libart_intermediates/classes/java-source-list-uniq
cygwin warning:
MS-DOS style path detected: d:/Projects/Lollipop/platform
Preferred POSIX equivalent is: /cygdrive/d/Projects/Lollipop/platform
CYGWIN environment variable option “nodosfilewarning” turns off this warning.
Consult the user’s guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
sh: /cygdrive/c/Program Files (x86)/Java/jdk1.7.0_79/bin/javac: Argument list to
o long

Uses javac.exe:

make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/ext_inter
mediates/classes.jar’, needed by `out/target/common/obj/APPS/Contacts_intermedia
tes/classes-full-debug.jar’. Stop.

Problem starts at:

out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar: out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/emma_out/lib/classes-jarjar.jar | out/host/windows-x86/bin/acp

out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/emma_out/lib/classes-jarjar.jar: out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes-jarjar.jar | out/host/windows-x86/bin/acp

out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes-jarjar.jar: out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes-full-debug.jar | out/host/windows-x86/bin/acp

out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes-full-debug.jar: …

is generated via:

# commands to execute (from `build/core/java.mk’, line 345):
$(transform-java-to-classes.jar)

Where the classes.jar is malformed

But eventually changes inside D:\Projects\Lollipop\platform\build\core\definitions.mk:

Makes it work !

Remove the modifications LOCAL_SDK_RES_VERSION on D:\Projects\Lollipop\platform\build\core\package_internal.mk. And compile using:

subdir_makefiles := libcore/Android.mk external/junit/Android.mk frameworks/base/Android.mk packages/apps/ContactsCommon/Android.mk packages/apps/Contacts/Android.mk prebuilts/sdk/Android.mk

But we have:

/bin/bash: line 0: cd: frameworks/base/../../external/libphonenumber/java/src: N
o such file or directory
make: Entering directory `/d/Projects/Lollipop/platform’
build/core/java.mk:267: *** frameworks/base: Target java module does not define
any source or resource files. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

Which cause by this logic in D:\Projects\Lollipop\platform\build\core\java.mk:

Causes by blank in:

need_compile_java := $(strip $(all_java_sources)$(all_res_assets))$(LOCAL_STATIC_JAVA_LIBRARIES)$(filter true,$(LOCAL_SOURCE_FILES_ALL_GENERATED))

all_java_sources := $(subst ,, )

But let’s see if we try to resolve the find errors as in:

find: phone/java: No such file or directory
find: ../../external/apache-http/src/org/apache/http: No such file or directory
find: ../opt/telephony/src/java/android/provider: No such file or directory
find: ../opt/telephony/src/java/android/telephony: No such file or directory
find: ../opt/telephony/src/java/android/telephony/gsm: No such file or directory

find: ../opt/net/voip/src/java/android/net/rtp: No such file or directory
find: ../opt/net/voip/src/java/android/net/sip: No such file or directory
find: ../../external/apache-http/src/org/apache/http: No such file or directory
find: ../opt/telephony/src/java/android/provider: No such file or directory
find: ../opt/telephony/src/java/android/telephony: No such file or directory
find: ../opt/telephony/src/java/android/telephony/gsm: No such file or directory

find: ../opt/net/voip/src/java/android/net/rtp: No such file or directory
find: ../opt/net/voip/src/java/android/net/sip: No such file or directory
find: ../../frameworks/multidex/library/src: No such file or directory
find: ../../frameworks/multidex/instrumentation/src: No such file or directory
find: ../../external/apache-http/src/org/apache/http: No such file or directory
find: ../opt/telephony/src/java/android/provider: No such file or directory
find: ../opt/telephony/src/java/android/telephony: No such file or directory
find: ../opt/telephony/src/java/android/telephony/gsm: No such file or directory

find: ../opt/net/voip/src/java/android/net/rtp: No such file or directory
find: ../opt/net/voip/src/java/android/net/sip: No such file or directory
find: ../../external/nist-sip/java: No such file or directory
find: ../../external/apache-http/src: No such file or directory
find: ../../external/tagsoup/src: No such file or directory
find: ../../external/libphonenumber/java/src: No such file or directory
/bin/bash: line 0: cd: frameworks/base/../../external/libphonenumber/java/src: N
o such file or directory
the allx
make: Entering directory `/d/Projects/Lollipop/platform’
build/core/java.mk:267: *** frameworks/base: Target java module does not define
any source or resource files. Stop.

framework_docs_LOCAL_DROIDDOC_SOURCE_PATH := frameworks/base/core/java frameworks/base/graphics/java frameworks/base/location/java frameworks/base/media/java frameworks/base/media/mca/effect/java frameworks/base/media/mca/filterfw/java frameworks/base/media/mca/filterpacks/java frameworks/base/drm/java frameworks/base/opengl/java frameworks/base/sax/java frameworks/base/telecomm/java frameworks/base/telephony/java frameworks/base/phone/java frameworks/base/wifi/java frameworks/base/keystore/java frameworks/base/rs/java

FRAMEWORKS_BASE_SUBDIRS := core/java graphics/java location/java media/java media/mca/effect/java media/mca/filterfw/java media/mca/filterpacks/java drm/java opengl/java sax/java telecomm/java telephony/java phone/java wifi/java keystore/java rs/java

FRAMEWORKS_BASE_JAVA_SRC_DIRS := frameworks/base/core/java frameworks/base/graphics/java frameworks/base/location/java frameworks/base/media/java frameworks/base/media/mca/effect/java frameworks/base/media/mca/filterfw/java frameworks/base/media/mca/filterpacks/java frameworks/base/drm/java frameworks/base/opengl/java frameworks/base/sax/java frameworks/base/telecomm/java frameworks/base/telephony/java frameworks/base/phone/java frameworks/base/wifi/java frameworks/base/keystore/java frameworks/base/rs/java

Download from:

https://android.googlesource.com/platform/external/apache-http/+/android-5.1.1_r38

https://android.googlesource.com/platform/frameworks/opt/telephony/+/android-5.1.1_r38

https://android.googlesource.com/platform/frameworks/opt/net/voip/+/android-5.1.1_r38

https://android.googlesource.com/platform/frameworks/multidex/+/android-5.1.1_r38

https://android.googlesource.com/platform/external/nist-sip/+/android-5.1.1_r38

Now we have:

Clean step: rm -rf out/target/common/obj/JAVA_LIBRARIES/telephony-common_interme
diates
Clean step: rm -rf out/target/common/obj/JAVA_LIBRARIES/telephony-common_interme
diates
Clean step: rm -rf out/target/common/obj/JAVA_LIBRARIES/telephony-common_interme
diates
including frameworks/base/Android.mk …
find: ../../external/tagsoup/src: No such file or directory
find: ../../external/libphonenumber/java/src: No such file or directory
/bin/bash: line 0: cd: frameworks/base/../../external/libphonenumber/java/src: N
o such file or directory
including libcore/Android.mk …
including external/junit/Android.mk …
including packages/apps/ContactsCommon/Android.mk …
including packages/apps/Contacts/Android.mk …
including prebuilts/sdk/Android.mk …
make: Entering directory `/d/Projects/Lollipop/platform’
make: *** No rule to make target `out/target/common/obj/APPS/framework-res_inter
mediates/src/R.stamp’, needed by `out/target/common/obj/APPS/Contacts_intermedia
tes/src/R.stamp’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

Download from:

https://android.googlesource.com/platform/external/tagsoup/+/android-5.1.1_r38

https://android.googlesource.com/platform/external/libphonenumber/+/android-5.1.1_r38

But this time we still have:

including frameworks/base/Android.mk …
including libcore/Android.mk …
including external/junit/Android.mk …
including packages/apps/ContactsCommon/Android.mk …
including packages/apps/Contacts/Android.mk …
including prebuilts/sdk/Android.mk …
make: Entering directory `/d/Projects/Lollipop/platform’
make: *** No rule to make target `out/target/common/obj/APPS/framework-res_inter
mediates/src/R.stamp’, needed by `out/target/common/obj/APPS/Contacts_intermedia
tes/src/R.stamp’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

Checking:

out/target/common/obj/APPS/framework-res_intermediates/src/R.stamp

# Not a target:
out/target/common/obj/APPS/framework-res_intermediates/src/R.stamp:

# makefile (from `build/core/package_internal.mk’, line 305)
framework_res_package_export_deps := out/target/common/obj/APPS/framework-res_intermediates/src/R.stamp

# makefile (from `frameworks/base/Android.mk’, line 415)
framework_res_R_stamp := out/target/common/obj/APPS/framework-res_intermediates/src/R.stamp

# makefile (from `build/core/package_internal.mk’, line 313)
all_library_res_package_export_deps := out/target/common/obj/APPS/framework-res_intermediates/src/R.stamp

# makefile (from `frameworks/base/Android.mk’, line 27)
framework_res_source_path := APPS/framework-res_intermediates/src

curious one:
let’s check whether it is executed.

D:\Projects\Lollipop\platform\frameworks\base\core\res\Android.mk(20):LOCAL_PACKAGE_NAME := framework-res

Let’s dump again the subdirs this time:

the subdirsx build/libs/host\Android.mk build/tools/acp\Android.mk build/tools/s
ignapk\Android.mk build/tools/zipalign\Android.mk development/apps\BluetoothDebu
g\Android.mk development/apps\BuildWidget\Android.mk development/apps\CustomLoca
le\Android.mk development/apps\DevelopmentSettings\Android.mk development/apps\D
evelopment\Android.mk development/apps\Fallback\Android.mk development/apps\Gest
ureBuilder\Android.mk development/apps\NinePatchLab\Android.mk development/apps\
OBJViewer\Android.mk development/apps\SdkSetup\Android.mk development/apps\Setti
ngInjectorSample\Android.mk development/apps\WidgetPreview\Android.mk developmen
t/apps\launchperf\Android.mk development/host\Android.mk development/tools/etc1t
ool\Android.mk development/tools/line_endings\Android.mk development/tools/mkstu
bs\Android.mk frameworks/base\Android.mk libcore\Android.mk packages\apps\Contac
tsCommon\Android.mk packages\apps\Contacts\Android.mk packages\apps\PhoneCommon\
Android.mk prebuilts\sdk\Android.mk

Modify:

subdir_makefiles := frameworks/base/core/res/Android.mk frameworks/base/Android.mk libcore/Android.mk external/junit/Android.mk packages/apps/ContactsCommon/Android.mk packages/apps/Contacts/Android.mk prebuilts/sdk/Android.mk

Now we have:

including frameworks/base/core/res/Android.mk …
including frameworks/base/Android.mk …
including libcore/Android.mk …
including external/junit/Android.mk …
including packages/apps/ContactsCommon/Android.mk …
including packages/apps/Contacts/Android.mk …
including prebuilts/sdk/Android.mk …
make: Entering directory `/d/Projects/Lollipop/platform’
target Export Resources: framework-res (out/target/common/obj/APPS/framework-res
_intermediates/package-export.apk)
/bin/bash: zip: command not found
make: *** [out/target/common/obj/APPS/framework-res_intermediates/package-export
.apk] Error 127
make: *** Deleting file `out/target/common/obj/APPS/framework-res_intermediates/
package-export.apk’
make: Leaving directory `/d/Projects/Lollipop/platform’

#### make failed to build some targets (39 seconds) ####

Checking:

# commands to execute (from `build/core/package_internal.mk’, line 265):
@echo “target Export Resources: $(PRIVATE_MODULE) ($@)”
$(create-empty-package)
$(add-assets-to-package)

Download zip.exe from gnuwin32.

There’s some long process of java compilation, and then we arrive at:

target Java: ext (out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes
Compile with development/host/windows/prebuilt/javawrap.exe -J-Xmx256m -source
1.7 -target 1.7 -Xmaxerrs 9999999 and parameter -bootclasspath out/target/common
/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar on out/target/common/o
bj/APPS/ContactsTests_intermediates/classes-full-debug.jar )
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Copying: out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes-jarjar.j
ar
Copying: out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/emma_out/lib/cla
sses-jarjar.jar
Copying: out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar
make: *** No rule to make target `out/host/windows-x86/bin/aidl.exe’, needed by
`out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/andr
oid/accessibilityservice/IAccessibilityServiceConnection.java’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

It’s easy, just copy the aidl.exe and it’s corresponding dlls from latest Android SDK’s build-tools to D:\Projects\Lollipop\platform\out\host\windows-x86\bin

Now we have:

logtags: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/j
ava/android/content/EventLogTags.java <= frameworks/base/core/java/android/conte
nt/EventLogTags.logtags
logtags: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/j
ava/android/speech/tts/EventLogTags.java <= frameworks/base/core/java/android/sp
eech/tts/EventLogTags.logtags
logtags: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/j
ava/android/webkit/EventLogTags.java <= frameworks/base/core/java/android/webkit
/EventLogTags.logtags
make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/bouncycas
tle_intermediates/classes.jar', needed by `out/target/common/obj/JAVA_LIBRARIES/
framework_intermediates/classes-full-debug.jar'. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform'

#### make failed to build some targets (1.:17. (mm:ss)) ####

Download from:

https://android.googlesource.com/platform/external/bouncycastle/+/android-5.1.1_r38

Revise:

subdir_makefiles := external/bouncycastle/Android.mk frameworks/base/core/res/Android.mk frameworks/base/Android.mk libcore/Android.mk external/junit/Android.mk packages/apps/ContactsCommon/Android.mk packages/apps/Contacts/Android.mk prebuilts/sdk/Android.mk

Now we have:

============================================
including external/bouncycastle/Android.mk …
make: Entering directory `/d/Projects/Lollipop/platform'
build/core/java.mk:23: *** external/bouncycastle: Invalid LOCAL_SDK_VERSION '9'
Choices are: current 4 21. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform'

#### make failed to build some targets (8 seconds) ####

Just give it what it wants:

Download from:

https://android.googlesource.com/platform/prebuilts/sdk/+/android-5.1.1_r38/9/

We have:

make: Entering directory `/d/Projects/Lollipop/platform'
make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/conscrypt
_intermediates/classes.jar', needed by `out/target/common/obj/JAVA_LIBRARIES/bou
ncycastle_intermediates/classes-full-debug.jar'. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform'

Download from:

https://android.googlesource.com/platform/external/conscrypt/+/android-5.1.1_r38

we have:

make: *** No rule to make target `out/host/windows-x86/framework/jarjar.jar', ne
eded by `out/target/common/obj/JAVA_LIBRARIES/conscrypt_intermediates/classes-ja
rjar.jar'. Stop.

Checking:

out/target/common/obj/JAVA_LIBRARIES/conscrypt_intermediates/classes-jarjar.jar: out/target/common/obj/JAVA_LIBRARIES/conscrypt_intermediates/classes-full-debug.jar external/conscrypt/jarjar-rules.txt | out/host/windows-x86/framework/jarjar.jar

# makefile (from `build/core/config.mk', line 406)
JARJAR := out/host/windows-x86/framework/jarjar.jar

Curious file in:

D:\Projects\Lollipop\platform\build\core\host_dalvik_java_library.mk(34):full_classes_jarjar_jar := $(intermediates.COMMON)/classes-jarjar.jar

Modify subdir:

subdir_makefiles := build/core/host_dalvik_java_library.mk external/conscrypt/Android.mk external/bouncycastle/Android.mk frameworks/base/core/res/Android.mk frameworks/base/Android.mk libcore/Android.mk external/junit/Android.mk packages/apps/ContactsCommon/Android.mk packages/apps/Contacts/Android.mk prebuilts/sdk/Android.mk

But we have:

including build/core/host_dalvik_java_library.mk …
make: Entering directory `/d/Projects/Lollipop/platform'
build/core/host_java_library_common.mk:42: *** : LOCAL_MODULE not defined before
call to local-intermediates-dir. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform'

revert subdir:

subdir_makefiles := build/core/host_dalvik_java_library.mk external/conscrypt/Android.mk external/bouncycastle/Android.mk frameworks/base/core/res/Android.mk frameworks/base/Android.mk libcore/Android.mk external/junit/Android.mk packages/apps/ContactsCommon/Android.mk packages/apps/Contacts/Android.mk prebuilts/sdk/Android.mk

Modify subdir:

subdir_makefiles := libcore/Android.mk external/conscrypt/Android.mk external/bouncycastle/Android.mk frameworks/base/core/res/Android.mk frameworks/base/Android.mk libcore/Android.mk external/junit/Android.mk packages/apps/ContactsCommon/Android.mk packages/apps/Contacts/Android.mk prebuilts/sdk/Android.mk

Download from:

https://android.googlesource.com/platform/external/jarjar/+/android-5.1.1_r38

Modify subdir:

subdir_makefiles := external/jarjar/Android.mk libcore/Android.mk external/conscrypt/Android.mk external/bouncycastle/Android.mk frameworks/base/core/res/Android.mk frameworks/base/Android.mk external/junit/Android.mk packages/apps/ContactsCommon/Android.mk packages/apps/Contacts/Android.mk prebuilts/sdk/Android.mk

But we have compile errors:

^
symbol: variable super
location: class KeepProcessor
100 errors
make: *** [out/host/common/obj/JAVA_LIBRARIES/jarjar_intermediates/javalib.jar]
Error 41

Checking:

# commands to execute (from `build/core/host_java_library.mk', line 84):
$(transform-host-java-to-package)

define transform-host-java-to-package
@echo "host Java: $(PRIVATE_MODULE) ($(PRIVATE_CLASS_INTERMEDIATES_DIR))"
$(call compile-java,$(HOST_JAVAC),$(PRIVATE_BOOTCLASSPATH))
$(if $(PRIVATE_EXTRA_JAR_ARGS), $(call add-java-resources-to-package))
endef

out/host/common/obj/JAVA_LIBRARIES/jarjar_intermediates/javalib.jar: external/jarjar/src/main/com/tonicsystems/jarjar/AbstractDepHandler.java

This is caused by unzip not found. But still we have the error.

Extracting the javac command line using procmon.exe we have:

javac.exe -encoding UTF-8 -g -classpath out/host/windows-x86/framework/jarjar-apache-ant.jar:out/host/windows-x86/framework/jarjar-maven-plugin-api.jar:out/host/common/obj/JAVA_LIBRARIES/jarjar-asm_intermediates/javalib.jar:out/host/common/obj/JAVA_LIBRARIES/jarjar-asm-commons_intermediates/javalib.jar -extdirs """" -d out/host/common/obj/JAVA_LIBRARIES/jarjar_intermediates/classes @out/host/common/obj/JAVA_LIBRARIES/jarjar_intermediates/classes/java-source-list-uniq

After detail checking, it is caused by invalid separator for -classpath in windows environment that should use:

javac.exe -encoding UTF-8 -g -classpath out/host/windows-x86/framework/jarjar-apache-ant.jar;out/host/windows-x86/framework/jarjar-maven-plugin-api.jar;out/host/common/obj/JAVA_LIBRARIES/jarjar-asm_intermediates/javalib.jar;out/host/common/obj/JAVA_LIBRARIES/jarjar-asm-commons_intermediates/javalib.jar -extdirs "" -d out/host/common/obj/JAVA_LIBRARIES/jarjar_intermediates/classes @out/host/common/obj/JAVA_LIBRARIES/jarjar_intermediates/classes/java-source-list-uniq

Now we have:

host Java: jarjar (out/host/common/obj/JAVA_LIBRARIES/jarjar_intermediates/class
es)
/bin/bash: -c: line 1: syntax error: unexpected end of file
make: *** [out/host/common/obj/JAVA_LIBRARIES/jarjar_intermediates/javalib.jar]
Error 2
make: Leaving directory `/d/Projects/Lollipop/platform'

Sample make command for testing:

define transform-host-java-to-packagex
$(hide) if [ -s myTest1.txt ] ; then \
javac -classpath out\a;out\b \
fi
endef

For semi colon problem:

define transform-host-java-to-packagex
$(hide) if [ -s myTest1.txt ] ; then \
javac -classpath out\a\;out\b; \
fi
endef

Original normalize-path:

###########################################################
## Convert "a b c" into "a:b:c"
###########################################################
define normalize-path-list
$(subst $(space),:,$(strip $(1)))
endef

This is caused by use of semi colon without escape character. The routine normalize-path-list should be:

###########################################################
## Convert "a b c" into "a:b:c"
#$(subst $(space),:,$(strip $(1)))
###########################################################
define normalize-path-list
$(subst $(space),\;,$(strip $(1)))
endef

But caution, because it will break in Linux environment.

Now. let's go !

Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
7 errors
make: *** [out/target/common/obj/JAVA_LIBRARIES/bouncycastle_intermediates/class
es-full-debug.jar] Error 41
make: Leaving directory `/d/Projects/Lollipop/platform'

After performing some checking, it is found that the tgz file unzip using 7-zip is causing the truncated file names:

Using the tar command will alleviate the problem:

Report bugs to .

D:\temp>tar -xf test.tar

Now we have:

make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/okhttp_in
termediates/classes.jar’, needed by `out/target/common/obj/JAVA_LIBRARIES/framew
ork_intermediates/classes-full-debug.jar’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

Download from:

https://android.googlesource.com/platform/external/okhttp/+/android-5.1.1_r38

Now we have:

Copying: out/target/common/obj/JAVA_LIBRARIES/okhttp_intermediates/emma_out/lib/
classes-jarjar.jar
Copying: out/target/common/obj/JAVA_LIBRARIES/okhttp_intermediates/classes.jar
make: *** No rule to make target `out/host/windows-x86/bin/rmtypedefs’, needed b
y `out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-deb
ug.jar’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

Change the subdirs, now we have:

make: Entering directory `/d/Projects/Lollipop/platform’
make: *** No rule to make target `out/host/common/obj/JAVA_LIBRARIES/asm-tools_i
ntermediates/javalib.jar’, needed by `out/host/common/obj/JAVA_LIBRARIES/rmtyped
efs_intermediates/javalib.jar’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

Download from:

https://android.googlesource.com/platform/prebuilts/tools/+/android-5.1.1_r38/common/

Then modify:

subdir_makefiles := prebuilts/tools/common/guava-tools/Android.mk prebuilts/tools/common/asm-tools/Android.mk development/tools/rmtypedefs/Android.mk external/okhttp/Android.mk external/jarjar/Android.mk libcore/Android.mk external/conscrypt/Android.mk external/bouncycastle/Android.mk frameworks/base/core/res/Android.mk frameworks/base/Android.mk external/junit/Android.mk packages/apps/ContactsCommon/Android.mk packages/apps/Contacts/Android.mk prebuilts/sdk/Android.mk

After a rather long compilation process, we have:

Deleting out\target\common\obj\JAVA_LIBRARIES\framework_intermediates\classes\an
droid\widget\NumberPicker$OnScrollListener$ScrollState.class
Deleting out\target\common\obj\JAVA_LIBRARIES\framework_intermediates\classes\an
droid\widget\Toast$Duration.class
Copying: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-ja
rjar.jar
Copying: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/emma_out/l
ib/classes-jarjar.jar
Copying: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.ja
r
make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/telephony
-common_intermediates/classes.jar’, needed by `out/target/common/obj/APPS/Contac
ts_intermediates/classes-full-debug.jar’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

Compiled java program to be provided:

out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/classes.jar
out/target/common/obj/JAVA_LIBRARIES/voip-common_intermediates/classes.jar
out/target/common/obj/JAVA_LIBRARIES/com.android.vcard_intermediates/javalib.jar
out/target/common/obj/JAVA_LIBRARIES/android-common_intermediates/javalib.jar
out/target/common/obj/JAVA_LIBRARIES/guava_intermediates/javalib.jar
out/target/common/obj/JAVA_LIBRARIES/android-support-v13_intermediates/javalib.jar
out/target/common/obj/JAVA_LIBRARIES/android-support-v7-cardview_intermediates/javalib.jar out/target/common/obj/JAVA_LIBRARIES/android-support-v7-palette_intermediates/javalib.jar
out/target/common/obj/JAVA_LIBRARIES/android-support-v4_intermediates/javalib.jar
out/target/common/obj/JAVA_LIBRARIES/libphonenumber_intermediates/javalib.jar
out/target/common/obj/JAVA_LIBRARIES/libgeocoding_intermediates/javalib.jar

Revise subdir:

subdir_makefiles := frameworks/opt/telephony/Android.mk prebuilts/tools/common/guava-tools/Android.mk prebuilts/tools/common/asm-tools/Android.mk development/tools/rmtypedefs/Android.mk external/okhttp/Android.mk external/jarjar/Android.mk libcore/Android.mk external/conscrypt/Android.mk external/bouncycastle/Android.mk frameworks/base/core/res/Android.mk frameworks/base/Android.mk external/junit/Android.mk packages/apps/ContactsCommon/Android.mk packages/apps/Contacts/Android.mk prebuilts/sdk/Android.mk

Download from:

https://android.googlesource.com/platform/frameworks/ex/+/android-5.1.1_r38

We have:

make: Entering directory `/d/Projects/Lollipop/platform’
Aidl: telephony-common <= frameworks/opt/telephony/src/java/com/android/internal
/telephony/IIccPhoneBook.aidl
logtags: out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/src
/src/java/com/android/internal/telephony/EventLogTags.java gzip -d test.tar.gz

make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/android-c
ommon_intermediates/javalib.jar’, needed by `out/target/common/obj/APPS/Contacts
_intermediates/classes-full-debug.jar’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

Download from:

https://android.googlesource.com/platform/frameworks/ex/+/android-5.1.1_r38

We have:

including frameworks/ex/common/Android.mk …
make: Entering directory `/d/Projects/Lollipop/platform’
build/core/java.mk:23: *** frameworks/ex/common: Invalid LOCAL_SDK_VERSION ‘8’ C
hoices are: current 4 9 21. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

Download from:

https://android.googlesource.com/platform/prebuilts/sdk/+/android-5.1.1_r38/8/

D:\Projects\Lollipop\platform\prebuilts\sdk\8>gzip -d test.tar.gz

D:\Projects\Lollipop\platform\prebuilts\sdk\8>tar -xf test.tar

After a long compilation process we have:

make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/guava_int
ermediates/javalib.jar’, needed by `out/target/common/obj/APPS/Contacts_intermed
iates/classes-full-debug.jar’. Stop.

Download from:

https://android.googlesource.com/platform/external/guava/+/android-5.1.1_r38

https://android.googlesource.com/platform/frameworks/support/+/android-5.1.1_r38/v13

https://android.googlesource.com/platform/frameworks/support/+/android-5.1.1_r38/v7/

We have:

make: Entering directory `/d/Projects/Lollipop/platform’
make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/jsr305_in
termediates/javalib.jar’, needed by `out/target/common/obj/JAVA_LIBRARIES/guava_
intermediates/classes-full-debug.jar’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

Download from:

https://android.googlesource.com/platform/external/jsr305/+/android-5.1.1_r38

We have:

============================================
including frameworks/support/v13/Android.mk …
make: Entering directory `/d/Projects/Lollipop/platform’
build/core/java.mk:23: *** frameworks/support/v13: Invalid LOCAL_SDK_VERSION ’14
‘ Choices are: current 4 8 9 21. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

Download:

https://android.googlesource.com/platform/prebuilts/sdk/+/android-5.1.1_r38/14/

Download all of those sdk number.

We have now:

make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/android_s
tubs_current_intermediates/classes.jar’, needed by `out/target/common/obj/JAVA_L
IBRARIES/android-support-v4-api22_intermediates/classes-full-debug.jar’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

Download:

https://android.googlesource.com/platform/external/doclava/+/android-5.1.1_r38

make: Entering directory `/d/Projects/Lollipop/platform’
make: *** No rule to make target `out/host/windows-x86/framework/antlr-runtime.j
ar’, needed by `out/host/common/obj/JAVA_LIBRARIES/doclava_intermediates/javalib
.jar’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

Download:

https://android.googlesource.com/platform/external/antlr/+/android-5.1.1_r38

https://android.googlesource.com/platform/external/jsilver/+/android-5.1.1_r38

make: *** No rule to make target `out/host/common/obj/JAVA_LIBRARIES/tagsouplib_
intermediates/javalib.jar’, needed by `out/host/common/obj/JAVA_LIBRARIES/doclav
a_intermediates/javalib.jar’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

external\doclava\src\com\google\doclava\ClassInfo.java:20: error: package com.sun.javadoc does not exist
import com.sun.javadoc.ClassDoc;

This is caused by malformed path to the tools.jar in java path. The command line should be like this:

javac.exe -encoding UTF-8 -g -classpath out/host/windows-x86/framework/antlr-runtime.jar;out/host/windows-x86/framework/guavalib.jar;out/host/windows-x86/framework/jsilver.jar;out/host/common/obj/JAVA_LIBRARIES/tagsouplib_intermediates/javalib.jar;c:\Progra~2\Java\jdk1.7.0_80\lib\tools.jar -extdirs “” -d out/host/common/obj/JAVA_LIBRARIES/doclava_intermediates/classes @out/host/common/obj/JAVA_LIBRARIES/doclava_intermediates/classes/java-source-list-uniq

Perform revision in:

D:\Projects\Lollipop\platform\build\core\config.mk

HOST_JDK_TOOLS_JAR:= c:/Progra~2/Java/jdk1.7.0_80/lib/tools.jar

We have:

Install: out/host/windows-x86/framework/doclava.jar
Aidl Preprocess: out/target/common/obj/framework.aidl
Docs droiddoc: out/target/common/docs/api-stubs

After some long compilation process, we have:

Install: out/host/windows-x86/framework/doclava.jar
Aidl Preprocess: out/target/common/obj/framework.aidl
Docs droiddoc: out/target/common/docs/api-stubs
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
make: *** [out/target/common/docs/api-stubs-timestamp] Error 45
make: Leaving directory `/d/Projects/Lollipop/platform’

Change inD:\Projects\Lollipop\platform\build\core\droiddoc.mk:

-J-Xmx512m

We have:

make: Entering directory `/d/Projects/Lollipop/platform’
Docs droiddoc: out/target/common/docs/api-stubs
javadoc: error – Cannot find doclet class com.google.doclava.Doclava
1 error
make: *** [out/target/common/docs/api-stubs-timestamp] Error 45
make: Leaving directory `/d/Projects/Lollipop/platform’

This again, is caused by invalid separator as in:

javadoc.exe -encoding UTF-8 @out/target/common/obj/JAVA_LIBRARIES/api-stubs_intermediates/droiddoc-src-list -J-Xmx512m -XDignore.symbol.file -quiet -doclet com.google.doclava.Doclava -docletpath out/host/windows-x86/framework/jsilver.jar:out/host/windows-x86/framework/doclava.jar -templatedir build/tools/droiddoc/templates-sdk -htmldir frameworks/base/docs/html -bootclasspath out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar -classpath out/target/common/obj/JAVA_LIBRARIES/bouncycastle_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/conscrypt_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/okhttp_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/voip-common_intermediates/classes.jar: -sourcepath frameworks/base/core/java;frameworks/base/graphics/java;frameworks/base/location/java;frameworks/base/media/java;frameworks/base/media/mca/effect/java;frameworks/base/media/mca/filterfw/java;frameworks/base/media/mca/filterpacks/java;frameworks/base/drm/java;frameworks/base/opengl/java;frameworks/base/sax/java;frameworks/base/telecomm/java;frameworks/base/telephony/java;frameworks/base/phone/java;frameworks/base/wifi/java;frameworks/base/keystore/java;frameworks/base/rs/java:out/target/common/obj/JAVA_LIBRARIES/bouncycastle_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/conscrypt_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/okhttp_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/voip-common_intermediates/classes.jar: -d out/target/common/docs/api-stubs -hdf page.build LMY49M-eng..20170619.162734 -hdf page.now “”19 Jun 2017 16:29″” -knowntags ./frameworks/base/docs/knowntags.txt -hidePackage com.android.org.conscrypt -since prebuilts/sdk/api/1.xml 1 -since prebuilts/sdk/api/2.xml 2 -since prebuilts/sdk/api/3.xml 3 -since prebuilts/sdk/api/4.xml 4 -since prebuilts/sdk/api/5.xml 5 -since prebuilts/sdk/api/6.xml 6 -since prebuilts/sdk/api/7.xml 7 -since prebuilts/sdk/api/8.xml 8 -since prebuilts/sdk/api/9.xml 9 -since prebuilts/sdk/api/10.xml 10 -since prebuilts/sdk/api/11.xml 11 -since prebuilts/sdk/api/12.xml 12 -since prebuilts/sdk/api/13.xml 13 -since prebuilts/sdk/api/14.txt 14 -since prebuilts/sdk/api/15.txt 15 -since prebuilts/sdk/api/16.txt 16 -since prebuilts/sdk/api/17.txt 17 -since prebuilts/sdk/api/18.txt 18 -since prebuilts/sdk/api/19.txt 19 -since prebuilts/sdk/api/20.txt 20 -since prebuilts/sdk/api/21.txt 21 -werror -hide 111 -hide 113 -overview frameworks/base/core/java/overview.html -hdf sdk.version 4.4 -hdf sdk.rel.id 1 -hdf sdk.preview 0 -stubs out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src -api out/target/common/obj/PACKAGING/public_api.txt -removedApi out/target/common/obj/PACKAGING/removed.txt -nodocs

c:\Progra~2\Java\jdk1.7.0_80\bin\javadoc.exe -encoding UTF-8 @out/target/common/obj/JAVA_LIBRARIES/api-stubs_intermediates/droiddoc-src-list -J-Xmx512m -XDignore.symbol.file -quiet -doclet com.google.doclava.Doclava -docletpath out/host/windows-x86/framework/jsilver.jar

Perform necessary modifications in D:\Projects\Lollipop\platform\build\core\droiddoc.mk:

$(full_target): PRIVATE_DOCLETPATH := $(HOST_OUT_JAVA_LIBRARIES)/jsilver$(COMMON_JAVA_PACKAGE_SUFFIX)\;$(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX)
$(full_target): PRIVATE_CLASSPATH := $(subst $(space),\;,$(full_java_libs))

But still we have:

Docs droiddoc: out/target/common/docs/api-stubs
javadoc: error – Cannot find doclet class com.google.doclava.Doclava
1 error
out/host/windows-x86/framework/doclava.jar: out/host/windows-x86/framework/docla
va.jar: cannot execute binary file
make: *** [out/target/common/docs/api-stubs-timestamp] Error 45
make: Leaving directory `/d/Projects/Lollipop/platform’

#### make failed to build some targets (3.:57. (mm:ss)) ####

Perform some modifications to D:\Projects\Lollipop\platform\build\core\droiddoc.mk.

Now we have:

including external/junit/Android.mk …
including packages/apps/ContactsCommon/Android.mk …
including packages/apps/Contacts/Android.mk …
including prebuilts/sdk/Android.mk …
make: Entering directory `/d/Projects/Lollipop/platform’
Docs droiddoc: out/target/common/docs/api-stubs
DroidDoc took 17 sec. to write docs to out/target/common/docs/api-stubs
make: Leaving directory `/d/Projects/Lollipop/platform’

still we have:

make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/android_s
tubs_current_intermediates/classes.jar’, needed by `out/target/common/obj/JAVA_L
IBRARIES/android-support-v4-api22_intermediates/classes-full-debug.jar’. Stop.

android_stubs_current_intermediates

Revise subdir:

subdir_makefiles := development/build/Android.mk external/tagsoup/Android.mk external/antlr/Android.mk external/jsilver/Android.mk external/doclava/Android.mk frameworks/support/v13/Android.mk frameworks/support/v4/Android.mk frameworks/support/v7/cardview/Android.mk external/jsr305/Android.mk external/guava/Android.mk frameworks/ex/common/Android.mk frameworks/opt/vcard/Android.mk frameworks/opt/net/voip/Android.mk frameworks/opt/net/ims/Android.mk frameworks/opt/telephony/Android.mk prebuilts/tools/common/guava-tools/Android.mk prebuilts/tools/common/asm-tools/Android.mk development/tools/rmtypedefs/Android.mk external/okhttp/Android.mk external/jarjar/Android.mk libcore/Android.mk external/conscrypt/Android.mk external/bouncycastle/Android.mk frameworks/base/core/res/Android.mk frameworks/base/Android.mk external/junit/Android.mk packages/apps/ContactsCommon/Android.mk packages/apps/Contacts/Android.mk prebuilts/sdk/Android.mk

Now we have:

make: Entering directory `/d/Projects/Lollipop/platform’
Compiling SDK Stubs: out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_
intermediates/classes.jar
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/android-s
upport-annotations_intermediates/javalib.jar’, needed by `out/target/common/obj/
JAVA_LIBRARIES/android-support-v4-donut_intermediates/classes-full-debug.jar’.
Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

android-support-annotations

Modify subdir.

Now we have:

target Java: android-support-v4 (out/target/common/obj/JAVA_LIBRARIES/android-su
pport-v4_intermediates/classes Compile with javac -J-Xmx256m -source 1.7 -target
1.7 -Xmaxerrs 9999999 and parameter -bootclasspath out/target/common/obj/JAVA_L
IBRARIES/sdk_v4_intermediates/classes.jar on out/target/common/obj/APPS/Contacts
Tests_intermediates/classes-full-debug.jar )
frameworks\support\v4\java\android\support\v4\accessibilityservice\Accessibility
ServiceInfoCompat.java:106: error: cannot find symbol
return AccessibilityServiceInfoCompatJellyBeanMr2.getCapabilities(in
fo);
^
symbol: variable AccessibilityServiceInfoCompatJellyBeanMr2
location: class AccessibilityServiceInfoJellyBeanMr2
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
make: *** [out/target/common/obj/JAVA_LIBRARIES/android-support-v4_intermediates
/classes-full-debug.jar] Error 41
make: Leaving directory `/d/Projects/Lollipop/platform’

#### make failed to build some targets (1.:26. (mm:ss)) ####

bash-3.1$

out/target/common/obj/JAVA_LIBRARIES/android-support-v4_intermediates/classes-full-debug.jar

This is caused by malformed file name again:

redownload and extract with gzip and tar command line, we have:

target Static Jar: android-support-v7-cardview (out/target/common/obj/JAVA_LIBRA
RIES/android-support-v7-cardview_intermediates/javalib.jar)
make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/android-s
upport-v7-palette_intermediates/javalib.jar’, needed by `out/target/common/obj/A
PPS/Contacts_intermediates/classes-full-debug.jar’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

out/target/common/obj/JAVA_LIBRARIES/android-support-v7-palette_intermediates/javalib.jar

Revise subdir:

subdir_makefiles := frameworks/support/v7/palette/Android.mk frameworks/support/annotations/Android.mk development/build/Android.mk external/tagsoup/Android.mk external/antlr/Android.mk external/jsilver/Android.mk external/doclava/Android.mk frameworks/support/v13/Android.mk frameworks/support/v4/Android.mk frameworks/support/v7/cardview/Android.mk external/jsr305/Android.mk external/guava/Android.mk frameworks/ex/common/Android.mk frameworks/opt/vcard/Android.mk frameworks/opt/net/voip/Android.mk frameworks/opt/net/ims/Android.mk frameworks/opt/telephony/Android.mk prebuilts/tools/common/guava-tools/Android.mk prebuilts/tools/common/asm-tools/Android.mk development/tools/rmtypedefs/Android.mk external/okhttp/Android.mk external/jarjar/Android.mk libcore/Android.mk external/conscrypt/Android.mk external/bouncycastle/Android.mk frameworks/base/core/res/Android.mk frameworks/base/Android.mk external/junit/Android.mk packages/apps/ContactsCommon/Android.mk packages/apps/Contacts/Android.mk prebuilts/sdk/Android.mk

We have:

Copying: out/target/common/obj/APPS/Contacts_intermediates/classes-jarjar.jar
Copying: out/target/common/obj/APPS/Contacts_intermediates/emma_out/lib/classes-
jarjar.jar
Copying: out/target/common/obj/APPS/Contacts_intermediates/classes.jar
make: *** No rule to make target `external/proguard/bin/proguard.sh’, needed by
`out/target/common/obj/APPS/Contacts_intermediates/proguard.classes.jar’. Stop.

make: Leaving directory `/d/Projects/Lollipop/platform’

Download from:

https://android.googlesource.com/platform/external/proguard/+/android-5.1.1_r38

We have:

Proguard: out/target/common/obj/APPS/Contacts_intermediates/proguard.classes.jar

ProGuard, version 4.10
Reading input…
Reading program jar [D:\Projects\Lollipop\platform\out\target\common\obj\APPS\Co
ntacts_intermediates\classes.jar]
Reading library jar [D:\Projects\Lollipop\platform\out\target\common\obj\JAVA_LI
BRARIES\core-junit_intermediates\classes.jar]
Reading library jar [D:\Projects\Lollipop\platform\out\target\common\obj\JAVA_LI
BRARIES\core-libart_intermediates\classes.jar]
Reading library jar [D:\Projects\Lollipop\platform\out\target\common\obj\JAVA_LI
BRARIES\ext_intermediates\classes.jar]
Reading library jar [D:\Projects\Lollipop\platform\out\target\common\obj\JAVA_LI
BRARIES\framework_intermediates\classes.jar]
Reading library jar [D:\Projects\Lollipop\platform\out\target\common\obj\JAVA_LI
BRARIES\telephony-common_intermediates\classes.jar]
Reading library jar [D:\Projects\Lollipop\platform\out\target\common\obj\JAVA_LI
BRARIES\voip-common_intermediates\classes.jar]
Initializing…
Ignoring unused library classes…
Original number of library classes: 11333
Final number of library classes: 11333
Shrinking…
Removing unused program classes and class elements…
Original number of program classes: 3195
Final number of program classes: 1222
Writing output…
Preparing output jar [D:\Projects\Lollipop\platform\out\target\common\obj\APPS\C
ontacts_intermediates\proguard.classes.jar]
Copying resources from program jar [D:\Projects\Lollipop\platform\out\target\c
ommon\obj\APPS\Contacts_intermediates\classes.jar]
make: *** No rule to make target `out/host/windows-x86/bin/dx’, needed by `out/t
arget/common/obj/APPS/Contacts_intermediates/with-local/classes.dex’. Stop.
make: Leaving directory `/d/Projects/Lollipop/platform’

#### make failed to build some targets (56 seconds) ####

bash-3.1$

Download from:

https://android.googlesource.com/platform/dalvik/+/android-5.1.1_r38

make: Entering directory `/d/Projects/Lollipop/platform’
host Java: dx (out/host/common/obj/JAVA_LIBRARIES/dx_intermediates/classes)
warning: [options] bootstrap class path not set in conjunction with -source 1.6
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
Install: out/host/windows-x86/framework/dx.jar
Copy: dx (out/host/windows-x86/obj/EXECUTABLES/dx_intermediates/dx)
Notice file: dalvik/dx/NOTICE — out/host/windows-x86/obj/NOTICE_FILES/src//bin/
dx.txt
Install: out/host/windows-x86/bin/dx
target Dex: Contacts
Copying: out/target/common/obj/APPS/Contacts_intermediates/classes.dex
make: *** No rule to make target `out/host/windows-x86/framework/signapk.jar’, n
eeded by `out/target/product/generic/obj/APPS/Contacts_intermediates/package.apk
‘. Stop.

We have:

target Package: Contacts (out/target/product/generic/obj/APPS/Contacts_intermedi
ates/package.apk)
warning: string ‘add_field’ has no default translation.
warning: string ‘add_field’ is missing 87 required localizations: af_ZA am_ET ar
_EG az_AZ bg_BG bn_BD ca_ES cs_CZ da_DK de_AT de_CH de_DE de_LI el_GR en_AU en_C
A 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 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 ko_KR ky_KG lo_LA lt_LT lv_LV mk_MK ml_IN mn_MN mr_I
N ms_MY my_MM nb_NO ne_NP nl_BE nl_NL pl_PL pt_BR pt_PT rm_CH ro_RO ru_RU si_LK
sk_SK sl_SI 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 ‘contact_detail_picture_description’ has no default translation.

warning: string ‘contact_detail_picture_description’ is missing 87 required loca
lizations: af_ZA am_ET ar_EG az_AZ bg_BG bn_BD 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 hi_IN hr_HR hu_HU hy_AM in_ID i
s_IS it_CH it_IT iw_IL ja_JP ka_GE kk_KZ km_KH kn_IN ko_KR 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 pl_PL pt_BR pt_PT
rm_CH ro_RO ru_RU si_LK sk_SK sl_SI sr_RS sv_SE sw_TZ ta_IN te_IN th_TH tl_PH t
r_TR uk_UA ur_PK uz_UZ vi_VN zh_CN zh_HK zh_TW zu_ZA
warning: string ‘contactsAllLabel’ has no default translation.
warning: string ‘contactsAllLabel’ is missing 87 required localizations: af_ZA a
m_ET ar_EG az_AZ bg_BG bn_BD 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 hi_IN hr_HR hu_HU hy_AM in_ID is_IS it_CH it_IT i
w_IL ja_JP ka_GE kk_KZ km_KH kn_IN ko_KR 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 pl_PL pt_BR pt_PT rm_CH ro_RO ru_RU
si_LK sk_SK sl_SI sr_RS sv_SE sw_TZ ta_IN te_IN th_TH tl_PH tr_TR uk_UA ur_PK u
z_UZ vi_VN zh_CN zh_HK zh_TW zu_ZA
warning: string ‘contactsGroupsLabel’ has no default translation.
warning: string ‘contactsGroupsLabel’ is missing 87 required localizations: af_Z
A am_ET ar_EG az_AZ bg_BG bn_BD 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 hi_IN hr_HR hu_HU hy_AM in_ID is_IS it_CH it_I
T iw_IL ja_JP ka_GE kk_KZ km_KH kn_IN ko_KR 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 pl_PL pt_BR pt_PT rm_CH ro_RO ru
_RU si_LK sk_SK sl_SI sr_RS sv_SE sw_TZ ta_IN te_IN th_TH tl_PH tr_TR uk_UA ur_P
K uz_UZ vi_VN zh_CN zh_HK zh_TW zu_ZA
warning: string ‘description_dial_phone_number’ has no default translation.
warning: string ‘description_dial_phone_number’ is missing 87 required localizat
ions: af_ZA am_ET ar_EG az_AZ bg_BG bn_BD 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_E
S fa_IR fi_FI fr_BE fr_CA fr_CH fr_FR gl_ES 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 ko_KR 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 pl_PL pt_BR pt_PT rm_C
H ro_RO ru_RU si_LK sk_SK sl_SI 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 ‘description_send_message’ has no default translation.
warning: string ‘description_send_message’ is missing 87 required localizations:
af_ZA am_ET ar_EG az_AZ bg_BG bn_BD ca_ES cs_CZ da_DK de_AT de_CH de_DE de_LI e
l_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 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 ko_KR ky_KG lo_LA lt_LT lv_LV mk_MK m
l_IN mn_MN mr_IN ms_MY my_MM nb_NO ne_NP nl_BE nl_NL pl_PL pt_BR pt_PT rm_CH ro_
RO ru_RU si_LK sk_SK sl_SI 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 ‘no_contact_details’ has no default translation.
warning: string ‘no_contact_details’ is missing 87 required localizations: af_ZA
am_ET ar_EG az_AZ bg_BG bn_BD ca_ES cs_CZ da_DK de_AT de_CH de_DE de_LI el_GR e
n_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 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 ko_KR ky_KG lo_LA lt_LT lv_LV mk_MK ml_IN m
n_MN mr_IN ms_MY my_MM nb_NO ne_NP nl_BE nl_NL pl_PL pt_BR pt_PT rm_CH ro_RO ru_
RU si_LK sk_SK sl_SI 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 ‘people’ has no default translation.
warning: string ‘people’ is missing 87 required localizations: af_ZA am_ET ar_EG
az_AZ bg_BG bn_BD ca_ES cs_CZ da_DK de_AT de_CH de_DE de_LI el_GR en_AU en_CA e
n_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 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 ko_KR ky_KG lo_LA lt_LT lv_LV mk_MK ml_IN mn_MN mr_IN m
s_MY my_MM nb_NO ne_NP nl_BE nl_NL pl_PL pt_BR pt_PT rm_CH ro_RO ru_RU si_LK sk_
SK sl_SI 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 ‘percentage’ has no default translation.
warning: string ‘percentage’ is missing 87 required localizations: af_ZA am_ET a
r_EG az_AZ bg_BG bn_BD 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 hi_IN hr_HR hu_HU hy_AM in_ID is_IS it_CH it_IT iw_IL j
a_JP ka_GE kk_KZ km_KH kn_IN ko_KR 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 pl_PL pt_BR pt_PT rm_CH ro_RO ru_RU si_LK
sk_SK sl_SI sr_RS sv_SE sw_TZ ta_IN te_IN th_TH tl_PH tr_TR uk_UA ur_PK uz_UZ v
i_VN zh_CN zh_HK zh_TW zu_ZA
warning: string ‘use_photo_as_primary’ has no default translation.
warning: string ‘use_photo_as_primary’ is missing 87 required localizations: af_
ZA am_ET ar_EG az_AZ bg_BG bn_BD 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 f
i_FI fr_BE fr_CA fr_CH fr_FR gl_ES 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 ko_KR 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 pl_PL pt_BR pt_PT rm_CH ro_RO r
u_RU si_LK sk_SK sl_SI 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 ‘viewContactDesription’ has no default translation.
warning: string ‘viewContactDesription’ is missing 87 required localizations: af
_ZA am_ET ar_EG az_AZ bg_BG bn_BD ca_ES cs_CZ da_DK de_AT de_CH de_DE de_LI el_G
R 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 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 ko_KR ky_KG lo_LA lt_LT lv_LV mk_MK ml_I
N mn_MN mr_IN ms_MY my_MM nb_NO ne_NP nl_BE nl_NL pl_PL pt_BR pt_PT rm_CH ro_RO
ru_RU si_LK sk_SK sl_SI 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
/bin/bash: /c/Progra~2/Java/jdk1.7.0_80/bin/jar: Bad file number
make: *** [out/target/product/generic/obj/APPS/Contacts_intermediates/package.ap
k] Error 126
make: *** Deleting file `out/target/product/generic/obj/APPS/Contacts_intermedia
tes/package.apk’
make: Leaving directory `/d/Projects/Lollipop/platform’

out/target/product/generic/obj/APPS/Contacts_intermediates/package.apk:

Error is located at:

$(add-carried-java-resources)

The proper command is:

D:\Projects\Lollipop\platform>jar uf out/target/product/generic/obj/APPS/Contact
s_intermediates/package.apk out/target/product/generic/obj/APPS/Contacts_interme
diates/java_res_jar_flags

Modify D:\Projects\Lollipop\platform\build\core\definitions.mk

At last we have:

warning: string ‘viewContactDesription’ has no default translation.
warning: string ‘viewContactDesription’ is missing 87 required localizations: af
_ZA am_ET ar_EG az_AZ bg_BG bn_BD ca_ES cs_CZ da_DK de_AT de_CH de_DE de_LI el_G
R 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 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 ko_KR ky_KG lo_LA lt_LT lv_LV mk_MK ml_I
N mn_MN mr_IN ms_MY my_MM nb_NO ne_NP nl_BE nl_NL pl_PL pt_BR pt_PT rm_CH ro_RO
ru_RU si_LK sk_SK sl_SI 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
make: Leaving directory `/d/Projects/Lollipop/platform’

#### make completed successfully (59 seconds) ####

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: