修改 build/make/core/dex_preopt.mk
1、DEX_PREOPT_DEFAULT 设置为 false,修改:
DEX_PREOPT_DEFAULT ?= true
为
DEX_PREOPT_DEFAULT ?= false
2、WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY 设置为FALSE,修改:
WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= true
为
WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= false
3、将修改后的错误禁用:
- ifeq (,$(filter eng, $(TARGET_BUILD_VARIANT)))
- ifneq (true,$(WITH_DEXPREOPT))
- ifneq (true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY))
- $(call pretty-error, DEXPREOPT must be enabled for user and userdebug builds)
- endif
- endif
- endif
4、完整修改:
diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk
index 7298bdee09..7e846892bb 100644
--- a/core/dex_preopt.mk
+++ b/core/dex_preopt.mk
@@ -17,7 +17,7 @@ DEXPREOPT_BOOT_JAR_DIR := system/framework
DEXPREOPT_BOOT_JAR_DIR_FULL_PATH := $(DEXPREOPT_PRODUCT_DIR_FULL_PATH)/$(DEXPREOPT_BOOT_JAR_DIR)
# The default value for LOCAL_DEX_PREOPT
-DEX_PREOPT_DEFAULT ?= true
+DEX_PREOPT_DEFAULT ?= false
# The default filter for which files go into the system_other image (if it is
# being used). To bundle everything one should set this to '%'
@@ -40,7 +40,7 @@ ifeq ($(HOST_OS),linux)
DEX_PREOPT_DEFAULT := nostripping
# For an eng build only pre-opt the boot image and system server. This gives reasonable performance
# and still allows a simple workflow: building in frameworks/base and syncing.
- WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= true
+ WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= false
endif
# Add mini-debug-info to the boot classpath unless explicitly asked not to.
ifneq (false,$(WITH_DEXPREOPT_DEBUG_INFO))
@@ -49,13 +49,13 @@ ifeq ($(HOST_OS),linux)
# Non eng linux builds must have preopt enabled so that system server doesn't run as interpreter
# only. b/74209329
- ifeq (,$(filter eng, $(TARGET_BUILD_VARIANT)))
- ifneq (true,$(WITH_DEXPREOPT))
- ifneq (true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY))
- $(call pretty-error, DEXPREOPT must be enabled for user and userdebug builds)
- endif
- endif
- endif
+ #ifeq (,$(filter eng, $(TARGET_BUILD_VARIANT)))
+ # ifneq (true,$(WITH_DEXPREOPT))
+ # ifneq (true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY))
+ # $(call pretty-error, DEXPREOPT must be enabled for user and userdebug builds)
+ # endif
+ # endif
+ #endif
endif
GLOBAL_DEXPREOPT_FLAGS :=