如何在Android源代码中创建单个模块并解决依赖问题

4

我有一个AOSP代码副本,几天前做了一次完整构建, 最近我将代码同步到最新版本,并尝试修改通讯录模块中的一些代码,然后使用以下命令进行构建:

mmm packages/apps/Contacts

出现了一个错误:

1 error during configuration. Try --help-properties for help.
  Property 'jack.library.import' (in Options): element #1: The version of the library file 'out/target/common/obj/JAVA_LIBRARIES/android-support-test_intermediates/classes.jack' is not supported anymore. Library version: 3.4 - Current version: 3.5 - Minimum compatible version: 3.5
ninja: build stopped: subcommand failed.
build/core/ninja.mk:84: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

我在OpenGrok中搜索android-support-test,发现它在prebuilts/misc/common/android-support-test目录下。 然后我执行以下操作:

mmm prebuilts/misc/common/android-support-test/

仍然出现错误:
1 error during configuration. Try --help-properties for help.
  Property 'jack.classpath': element #1: The version of the library file 'out/target/common/obj/JAVA_LIBRARIES/sdk_v23_intermediates/classes.jack' is not supported anymore. Library version: 3.4 - Current version: 3.5 - Minimum compatible version: 3.5
ninja: build stopped: subcommand failed.
build/core/ninja.mk:84: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

但我在OpenGrok中找不到sdk_23模块。 然后我删除了。
out/target/common/obj/JAVA_LIBRARIES/android-support-test_intermediates/classes.jack

并执行

make android-support-test

它不会重建模块。

那么,在使用“mmm”构建模块时,我该如何解决依赖关系呢?


你尝试过从根仓库目录中使用“mma Contacts”吗? - Olaia
是的,我尝试过这个,但出现了一些依赖错误。 - keai4le
1个回答

4

看起来Jack似乎一直不喜欢你的预构建材料(/out目录),这是来自完全不同的Android版本吗?

我建议从根目录进行make clean或只删除所有/out/目录。

然后在根目录中执行mma Contacts

有关mm、mmm、mma等的更多信息,请查看build/envsetup.sh:

Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
   lunch:   lunch <product_name>-<build_variant>
   tapas:   tapas [<App1> <App2> ...] [arm|x86|mips|armv5] [eng|userdebug|user]
   croot:   Changes directory to the top of the tree.
   m:       Makes from the top of the tree.
   mm:      Builds all of the modules in the current directory, but not their dependencies.
   mmm:     Builds all of the modules in the supplied directories, but not their dependencies.
            To limit the modules being built use the syntax: mmm dir/:target1,target2.
   mma:     Builds all of the modules in the current directory, and their dependencies.
   mmma:    Builds all of the modules in the supplied directories, and their dependencies.
   cgrep:   Greps on all local C/C++ files.
   jgrep:   Greps on all local Java files.
   resgrep: Greps on all local res/*.xml files.
   godir:   Go to the directory containing a file.

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接