运行make sdk之后在下面的位置卡住
java -cp prebuilts/tools/common/api-generator/api-generator-22.9.2.jar:prebuilts/tools/common/kxml2-tools/kxml2-2.3.0.jar:prebuilts/tools/common/asm-tools/asm-4.0.jar:prebuilts/tools/common/asm-tools/asm-tree-4.0.jar:prebuilts/devtools/tools/lib/common.jar \
com.android.apigenerator.Main \
--pattern prebuilts/tools/common/api-versions/android-%/android.jar \
--pattern prebuilts/sdk/%/android.jar \
out/host/linux-x86/development/sdk/generated-api-versions.xml
Found API 1 at prebuilts/tools/common/api-versions/android-1/android.jar
Found API 2 at prebuilts/tools/common/api-versions/android-2/android.jar
Found API 3 at prebuilts/tools/common/api-versions/android-3/android.jar
Found API 4 at prebuilts/sdk/4/android.jar
Found API 5 at prebuilts/sdk/5/android.jar
Found API 6 at prebuilts/sdk/6/android.jar
Found API 7 at prebuilts/sdk/7/android.jar
Found API 8 at prebuilts/sdk/8/android.jar
Found API 9 at prebuilts/sdk/9/android.jar
Found API 10 at prebuilts/sdk/10/android.jar
Found API 11 at prebuilts/sdk/11/android.jar
Found API 12 at prebuilts/sdk/12/android.jar
Found API 13 at prebuilts/sdk/13/android.jar
Found API 14 at prebuilts/sdk/14/android.jar
Found API 15 at prebuilts/sdk/15/android.jar
Found API 16 at prebuilts/sdk/16/android.jar
Found API 17 at prebuilts/sdk/17/android.jar
Found API 18 at prebuilts/sdk/18/android.jar
Found API 19 at prebuilts/sdk/19/android.jar
Found API 20 at prebuilts/sdk/20/android.jar
Found API 21 at prebuilts/sdk/21/android.jar
Found API 22 at prebuilts/sdk/22/android.jar
Found API 23 at prebuilts/sdk/23/android.jar
经过排查,最后发现是target sdk中依赖的ATREE_FILES里面调用了android-6.0.0_r11/development/build/Android.mk:138的命令。
尝试注释掉这句命令,继续运行提示如下
development/build/sdk.atree:49: couldn‘t locate source file: bin/etc1tool
development/build/sdk.atree:54: couldn‘t locate source file: development/sdk/generated-api-versions.xml
development/build/sdk.atree:88: couldn‘t locate source file: bin/split-select
development/build/sdk.atree:93: couldn‘t locate source file: bin/bcc_compat
development/build/sdk.atree:186: couldn‘t locate source file: framework/layoutlib.jar
development/build/sdk.atree:527: couldn‘t locate source file: framework/layoutlib-tests.jar
development/build/sdk.atree:528: couldn‘t locate source file: system/app/EmulatorSmokeTests/EmulatorSmokeTests.apk
build/core/Makefile:1813: recipe for target ‘out/host/linux-x86/sdk/full/android-sdk_eng.root_linux-x86.zip‘ failed
make: *** [out/host/linux-x86/sdk/full/android-sdk_eng.root_linux-x86.zip] Error 44
本机的/bin/etc1tool和/usr/bin/etc1tool都是存在的,回到sdk.atree中看发现指的是ll out/host/linux-x86/bin/目录下的,应该是指的Android系统?
继续尝试
将prebuilts/tools/common/api-generator下的两个api-generator的jar包换成正常可以编译的android-6.0.0_r1版本的jar包(发现两个版本的jar包完全一致)后仍然会卡住,看来不是这个jar包的问题。但输入的三个参数两个是pattern,一个是输出结果,还能是什么错了。。
找到下面网址,似乎是源码。
http://www.javatips.net/api/android-gradle-plugin-master/misc/api-generator/src/main/java/com/android/apigenerator/Main.java