在android源码某个模块中引用第三方jar包

1.将该jar包放入该模块根目录的libs
2.修改该模块的Android.mk文件

diff --git a/packages/SystemUI/Android.mk b/packages/SystemUI/Android.mk
index b118cfcb930..db84abf02e2 100644
--- a/packages/SystemUI/Android.mk
+++ b/packages/SystemUI/Android.mk
@@ -28,7 +28,8 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
     android-support-v14-preference \
     android-support-v17-leanback \
     framework-protos \
-    SystemUI-proto-tags
+    SystemUI-proto-tags \
+    gson
 
 LOCAL_JAVA_LIBRARIES := telephony-common
 LOCAL_JNI_SHARED_LIBRARIES := librockchip_pip_jni
@@ -51,6 +52,9 @@ LOCAL_RESOURCE_DIR := \
     frameworks/support/v17/leanback/res
 
 LOCAL_STATIC_JAVA_AAR_LIBRARIES = kiwi
+
+
+
 # endregion
 
 LOCAL_AAPT_FLAGS := --auto-add-overlay \
@@ -64,8 +68,13 @@ endif
 
 include frameworks/base/packages/SettingsLib/common.mk
 
+
 include $(BUILD_PACKAGE)
 
+include $(CLEAR_VARS)
+LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES :=gson:libs/gson.jar
+include $(BUILD_MULTI_PREBUILT)
+
 ifeq ($(EXCLUDE_SYSTEMUI_TESTS),)
     include $(call all-makefiles-under,$(LOCAL_PATH))
 endif

你可能感兴趣的:(技术方案)