清泛IT社区

标题: 开发AppInventor2拓展时,依赖第三方jar库怎么写? [打印本页]

作者: App Inventor 2     时间: 前天 14:20
标题: 开发AppInventor2拓展时,依赖第三方jar库怎么写?
开发拓展的详细步骤见:https://www.fun123.cn/reference/extensions/aix_dev.html

如果拓展依赖了第三方库,则处理方法如下(已更新进了上面文档):

如果拓展用到了第三方库,也可以进行申明:
@UsesLibraries(libraries = "okhttp-3.12.13.jar, xxx.jar")          //依赖第三方jar库的,多个英文逗号分隔[size=0.8em]Java



相应的 jar 库要放到 appinventor-sources\appinventor\lib 目录下,修改编译配置文件 appinventor-sources\appinventor\components\build.xml :
配置文件中搜索 <target name="CopyComponentLibraries",尾部加上库拷贝:
<copy toFile="${public.deps.dir}/xxx.jar" file="${lib.dir}/xxx.jar" />[size=0.8em]XML









欢迎光临 清泛IT社区 (https://bbs.tsingfun.com/) Powered by Discuz! X3.3