//以下是这些任务的说明: //从${liboInstdir}/${liboEtcFolder}/types、${liboInstdir}/share/fonts/truetype目录中 // 复制程序文件和字体文件到assets/unpack目录 task copyUnpackAssets(type: Copy) { description "copies assets that need to be extracted on the device" into 'assets/unpack' into('program') { from("${liboInstdir}/${liboEtcFolder}/types") { includes = [ "offapi.rdb", "oovbaapi.rdb" ] } from("${liboInstdir}/${liboUreMiscFolder}") { includes = ["types.rdb"] rename 'types.rdb', 'udkapi.rdb' } } into('user/fonts') { from "${liboInstdir}/share/fonts/truetype" // Note: restrict list of fonts due to size considerations - no technical reason anymore // ToDo: fonts would be good candidate for using Expansion Files instead includes = [ "Liberation*.ttf", "Caladea-*.ttf", "Carlito-*.ttf", "Gen*.ttf", "opens___.ttf" ] } into('etc/fonts') { from "./" includes = ['fonts.conf'] filter { String line -> line.replaceAll( '@@APPLICATION_ID@@', new String("${android.defaultConfig.applicationId}") ) } } } //将${liboInstdir}/share/config、${liboInstdir}/program、${liboInstdir}/share目录中的 // 各种资源文件复制到应用的 assets 目录中,以便在安装后可以访问这些资源 task copyAssets(type: Copy) { description "copies assets that can be accessed within the installed apk" into 'assets'
// include icons, Impress styles and required .ui files into ('share') { into ('config') { from ("${liboInstdir}/share/config") includes = ['images_**.zip', '**/simpress/**.xml', '**/annotation.ui', '**/hfmenubutton.ui', '**/inforeadonlydialog.ui', '**/pbmenubutton.ui', '**/scrollbars.ui', '**/tabbuttons.ui', '**/tabviewbar.ui' ] } }
into('program') { from "${liboInstdir}/program" includes = ['services.rdb', 'services/services.rdb']
into('resource') { from "${liboInstdir}/${liboSharedResFolder}" includes = ['*en-US.res'] } } into('share') { from("${liboInstdir}/share") { // Filter data is needed by e.g. the drawingML preset shape import. includes = ['registry/**', 'filter/**'] // those two get processed by mobile-config.py excludes = ['registry/main.xcd', 'registry/res/registry_en-US.xcd'] } // separate data files for Chinese and Japanese from("${liboWorkdir}/CustomTarget/i18npool/breakiterator/") { include '*.data' } } }
//将 LICENSE 和 NOTICE 文件从 ${liboInstdir} 复制到 res_generated/raw 目录,并将它们重命名为 license.txt 和 notice.txt task copyAppResources(type: Copy) { description "copies documents to make them available as app resources" into 'res_generated/raw' from("${liboInstdir}") { includes = ["LICENSE", "NOTICE"] rename "LICENSE", "license.txt" rename "NOTICE", "notice.txt" } }
//将 soffice.cfg 文件从 ${liboInstdir}/share/config/ 复制到 assets_fullUI/share/config/ 目录下 task createFullConfig(type: Copy) { // grab dir to clear whole hierarchy on clean target outputs.dir "assets_fullUI" into 'assets_fullUI/share/config/soffice.cfg' from "${liboInstdir}/share/config/soffice.cfg" }
* WARNING : Untested Android NDK version 26.2.11394342, only versions 23.* to 25.* have been used successfully. Proceed at your own risk.
解决:重新安装版本为23~25的ndk。
3.6 jdk版本太低
1 2
> Failed to apply plugin 'com.android.internal.application'. > Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
解决:Gradle与jdk版本不匹配,按照提示安装对应的jdk版本。
3.7 缺少某个工具或者库
1 2 3 4
configure: error: gperf not found but needed. Install it.
# 找不到gperf,安装gperf sudo apt install gperf
1 2 3 4 5
configure: error: Package requirements (fontconfig >= 2.12.0) were not met: No package 'fontconfig' found # 需要fontconfig,安装libfontconfig1-dev sudo apt install libfontconfig1-dev
1 2 3 4
configure: error: Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.