android系统源码编译报错问题分析处理--持续更新


一、build/make/core/base_rules.mk:232: error: packages/services/Car/service: LOCAL_BUILT_MODULE and LOCAL_INSTALLED_MODULE must not be defined by component makefiles

出现此错误时,需要检查Android.mk中include $(CLEAR_VARS)及include $(BUILD_XXX...)是否一一对应了,如果有类似下边的写法,就需要修正

错误:
......
include $(CLEAR_VARS)
......
include $(BUILD_MULTI_PREBUILT)
......
include $(BUILD_STATIC_JAVA_LIBRARY)
......
include $(BUILD_PACKAGE)
include $(CLEAR_VARS)

正确:
include $(CLEAR_VARS)
......
include $(BUILD_MULTI_PREBUILT)

include $(CLEAR_VARS)
......
include $(BUILD_STATIC_JAVA_LIBRARY)

include $(CLEAR_VARS)
......
include $(BUILD_PACKAGE)

二、错误: 程序包androidx.annotation不存在,需要在 Android.mk 中添加如下,根据自己的依赖进行添加

LOCAL_STATIC_ANDROID_LIBRARIES := \
androidx.recyclerview_recyclerview \
androidx.preference_preference \
androidx.appcompat_appcompat \
androidx.annotation_annotation \
androidx.legacy_legacy-preference-v14 \
androidx.leanback_leanback-preference \
androidx.leanback_leanback \

 三、javadoc: 错误 - 在 doclet 类com.google.doclava.Doclava中, 方法start已抛出异常错误java.lang.reflect.InvocationTargetException

java.lang.IllegalArgumentException: Unable to find IBtMusicCmd.java. This is usually because doclava has been asked to generate stubs for a file that isn't present in the list of input source files but exists in the input classpath.

IBtMusicCmd是我的aidl文件,代码都编译通过了,没有出现依赖问题,但是最后报出这个错,查了两天才发现这个问题应该是javadoc的版本太低了