Today I want to compile the source code under Android source code /vendor/letv/frameworks/base/java into Lele voice client for use. After compiling, I found that although the jar package file was generated, there was no relevant source code class file in the package and it could not be used normally.
After consulting and research, it was found that the options required for the file are as follows:
54 LOCAL_JACK_ENABLED := disabled # important! 55 #include $(BUILD_JAVA_LIBRARY) 56 include $(BUILD_STATIC_JAVA_LIBRARY) #Compile jar package
Finally generated, just change the name to . Note: If the LACAL_JACK_ENABLED option is not specified, the default is enabled, and a file will be generated and no package will be generated!
Also add-on: In a certain application, a third-party jar package is sometimes required to reference. So how can you introduce the jar package into the app when compiling the app?
Add the following statement to the file under this app:
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE_TAGS := user eng ######################################## LOCAL_STATIC_JAVA_LIBRARIES := lib3party //Define the reference name######################################## .... include $(BUILD_PACKAGE) ############################################################### include $(CLEAR_VARS) LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := lib3part:libs/ //Quote name: jar package nameinclude $(BUILD_MULTI_PREBUILT) ################################################################
The key to adding jar package is LOCAL_STATIC_JAVA_LIBRARIES := libarity and LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := libarity: these two sentences.
Libarity is an alias for the jar package. You can get it at will, as long as it corresponds to the following. But the name of the jar package after the colon must be written with the name of the jar package you need to introduce.
The jar package should be placed in the root directory of the project, that is, the directory at the same level as the src, res, and files of the app you want to compile.
The above article to compile a specified jar package in Android source code is all the content I share with you. I hope it can give you a reference and I hope you can support me more.