#编译第三方库基本用法 #在Android.mk目录下建立libs,然后将jar包放入libs,先预编译到out/target/product/generic/obj/JAVA_LIBRARIES下,然后本项目就会找到依赖的者jar包了 include $(CLEAR_VARS) LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := gson:libs/gson-2.8.2.jar include $(BUILD_MULTI_PREBUILT)
#关闭混淆优化器,没有这个配置,会报: #there were 194 unresolved references to program class members.Your input classes appear to be inconsistent. #there were 2494 unresolved references to library class members. You probably need to update the library versions. Alternatively, you may have to specify the option LOCAL_PROGUARD_ENABLED := disabled
###################### mk文件如下 ################################ # Copyright (C) 2009 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. LOCAL_PATH := $(my-dir) include $(CLEAR_VARS) LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := okhttp-3.12.0.jar \ rxjava-2.1.12.jar \ sqlite.jar include $(BUILD_MULTI_PREBUILT) ################################################## include $(CLEAR_VARS) LOCAL_MODULE := libcarlife LOCAL_SRC_FILES := libs/libcarlife.so LOCAL_MODULE_SUFFIX := .so LOCAL_MODULE_CLASS := SHARED_LIBRARIES include $(BUILD_PREBUILT) include $(call all-makefiles-under,$(LOCAL_PATH)) ################################################## include $(CLEAR_VARS) LOCAL_MODULE := libcarlifeserver LOCAL_SRC_FILES := libs/libcarlifeserver.so LOCAL_MODULE_SUFFIX := .so LOCAL_MODULE_CLASS := SHARED_LIBRARIES include $(BUILD_PREBUILT) include $(call all-makefiles-under,$(LOCAL_PATH)) ################################################## include $(CLEAR_VARS) LOCAL_MODULE := libcarlifeservicejni LOCAL_SRC_FILES := libs/libcarlifeservicejni.so LOCAL_MODULE_SUFFIX := .so LOCAL_MODULE_CLASS := SHARED_LIBRARIES include $(BUILD_PREBUILT) include $(call all-makefiles-under,$(LOCAL_PATH))
################################################## include $(CLEAR_VARS) LOCAL_MODULE := libcarlifevehicle LOCAL_SRC_FILES := libs/libcarlifevehicle.so LOCAL_MODULE_SUFFIX := .so LOCAL_MODULE_CLASS := SHARED_LIBRARIES include $(BUILD_PREBUILT) include $(call all-makefiles-under,$(LOCAL_PATH))