I have updated Android SDK to rev. 22 yesterday and there is no apkbuilder in tools

7 篇文章 0 订阅

转:http://stackoverflow.com/questions/16620655/i-have-updated-android-sdk-to-rev-22-yesterday-and-there-is-no-apkbuilder-in-to



I have checked with my friend who has Android SDK tools version 21, the apkbuilder is there. I have updated the Android SDK tools to version 22 and I can't find apkbuilder anymore.

So it seems that the Andorid SDK tool has replace the apkbuilder with something else? How can I make ant build.xml without apkbuilder? Is there some other way to build the unsigned apk for Android?

share improve this question
 

6 Answers

You may want to look at this.

After updating to SDK Tools to rev. 22 for the first time, you may need to relaunch Android SDK Manager again and install a new item: Android SDK Build-toolsenter image description here

After installing this, clean your projects and rebuild.

share improve this answer
 
7 
Did you checked? Build-tools do not include apkbuilder. –  Krom Stern  May 18 '13 at 18:12
2 
I have done this。 And build.xml is exists and i want to find the instead tool of apkbuilder.How the sdk tool ver.22 build apk?without apkbuilder? –  tommy cheung  May 19 '13 at 10:53 
 
Also perform "android update project -p ." in your project directory. This will update your build.xml. –  Lionel Port  Jun 7 '13 at 3:09
 
The apkbuilder/apkbuilder.bat wrappers around "com.android.sdklib.build.ApkBuilderMain" no longer exit in rev 22. –  miracle2k  Aug 4 '13 at 15:01
 
I hope to fix my rebuild problem after updating it. Thanks! –  Goku  Sep 23 '13 at 1:41

You could copy an apkbuilder.bat to your path_to_sdk_home/tools/, then continue you build. I found a copy here, and it worked.

share improve this answer
 
 
This solved it for me, thanks! –  o0'.  Oct 4 '13 at 9:36

In old version of AndroidSDK, the apkbuilder is just like a shell, actually it calls: ${sdk.dir}/tools/lib/sdklib.jar

So, if you deep into the root of apkbuilder, you can finder there are two ways to invoke it:

  1. from ant There is an ant-extend lib under: ${sdk.dir}/tools/lib/ant-tasks.jar So, you can invoke it like this:

    <path id="android.antlibs">
        <pathelement path="${sdk.dir}/tools/lib/ant-tasks.jar" />
    </path>
    
    <!-- Custom tasks -->
    <taskdef resource="anttasks.properties" classpathref="android.antlibs" />
    
    <apkbuilder
            outfolder="${out.absolute.dir}"
            resourcefile="${resource.package.file.name}"
            apkfilepath="${out.packaged.file}"
            debugpackaging="${build.is.packaging.debug}"
            debugsigning="${build.is.signing.debug}"
            verbose="${verbose}"
            hascode="${manifest.hasCode}"
            previousBuildType="${build.last.is.packaging.debug}/${build.last.is.signing.debug}"
            buildType="${build.is.packaging.debug}/${build.is.signing.debug}">
        <dex path="${intermediate.dex.file}"/>
        <sourcefolder path="${source.absolute.dir}"/>
        <jarfile refid="project.all.jars.path" />
        <nativefolder path="${native.libs.absolute.dir}" />
        <nativefolder refid="project.library.native.folder.path" />
        <extra-jars/>
    </apkbuilder>
    
  2. for script or other development You can use ${sdk.dir}/tools/lib/sdklib.jar, the apkbuilder was included in. Take a look at apkbuild.bat in previous version, at the end of the file:

    set jarfile=sdklib.jar
    set frameworkdir=
    
    if exist %frameworkdir%%jarfile% goto JarFileOk
        set frameworkdir=lib\
    
    if exist %frameworkdir%%jarfile% goto JarFileOk
        set frameworkdir=..\framework\
    
    :JarFileOk
    
    set jarpath=%frameworkdir%%jarfile%
    
    call %java_exe% -classpath %jarpath% com.android.sdklib.build.ApkBuilderMain %*
    
share improve this answer
 
 
This is the only answer that explains how to invoke ApkBuilder now. –  Chuck Batson  Aug 27 '14 at 15:31

Android SDK notes for rev.22 state:

Changed the structure of the SDK by adding a new build tool SDK Component, which is based on the existing platform-tools component. This change decouples the build tools versions from the IDE versions, allowing updates to the tools without requiring an IDE update.

One of the temporary options is to roll back your SDK tools back to rev.21 where apkbuilder existed. You can do that by backing up tools folder (e.g. rename it to tools_22) and downloading previous tools from rev.21: dl-ssl.google.com/android/repository/tools_r20-windows.zip, unpack it to your SDK and it will work like before.

share improve this answer
 
 
THX.Iwant to find a way to edit my build.xml to fit the new version tool .Or should i change builder to gradle or sth else? –  tommy cheung  May 19 '13 at 10:55 
 
In the case that will not roll back my sdk tool verison 21?In fact i want to know how build the apk in tools version 22?The sugest way? –  tommy cheung  May 19 '13 at 10:58
 
I know only of this solution. Maybe someone else knows a better way around rev.22 –  Krom Stern  May 19 '13 at 13:50

Doing a bit of research around this, it seems APKBuilder.bat, although deprecated, can still be used but will no longer be supported/enhanced. [1]

The new com.android.sdklib.build.APKBuilder Java class should now be used [2] as this is what will be developed, going forward.

share improve this answer
 
 
See liuyong's answer for a link to the bat. –  Steven Mark Ford  Jul 24 '13 at 10:08
 
It indeed appears as if the script has been removed. For now, using an old version works because the command line interface still exists as part of the Java class, though I wouldn't be surprised if that goes as well. –  miracle2k  Aug 4 '13 at 14:59

I find a way but i don't very sure of it. I saw a ant directory in tools directory and found a build.xml contains the new way to build apk. I also saw ant_task.jar in the tools/lib directory.When i unzip the jar i fount some classes like Apk ApkBuilderTask.class CheckEnvTask.class and so on... So i think the way is be changed to build apk with the ant Task,i 'll try to use the template to build the apk ,and if it works i will post the solution here. thanks!

share improve this answer
 
 
You can recreate your project build.xml to use the new method but running "android update project -p ." in your project directory. –  Lionel Port  Jun 7 '13 at 3:12

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
提供的源码资源涵盖了Java应用等多个领域,每个领域都包含了丰富的实例和项目。这些源码都是基于各自平台的最新技术和标准编写,确保了在对应环境下能够无缝运行。同时,源码中配备了详细的注释和文档,帮助用户快速理解代码结构和实现逻辑。 适用人群: 适合毕业设计、课程设计作业。这些源码资源特别适合大学生群体。无论你是计算机相关专业的学生,还是对其他领域编程感兴趣的学生,这些资源都能为你提供宝贵的学习和实践机会。通过学习和运行这些源码,你可以掌握各平台开发的基础知识,提升编程能力和项目实战经验。 使用场景及目标: 在学习阶段,你可以利用这些源码资源进行课程实践、课外项目或毕业设计。通过分析和运行源码,你将深入了解各平台开发的技术细节和最佳实践,逐步培养起自己的项目开发和问题解决能力。此外,在求职或创业过程中,具备跨平台开发能力的大学生将更具竞争力。 其他说明: 为了确保源码资源的可运行性和易用性,特别注意了以下几点:首先,每份源码都提供了详细的运行环境和依赖说明,确保用户能够轻松搭建起开发环境;其次,源码中的注释和文档都非常完善,方便用户快速上手和理解代码;最后,我会定期更新这些源码资源,以适应各平台技术的最新发展和市场需求。 所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答!
提供的源码资源涵盖了python应用等多个领域,每个领域都包含了丰富的实例和项目。这些源码都是基于各自平台的最新技术和标准编写,确保了在对应环境下能够无缝运行。同时,源码中配备了详细的注释和文档,帮助用户快速理解代码结构和实现逻辑。 适用人群: 适合毕业设计、课程设计作业。这些源码资源特别适合大学生群体。无论你是计算机相关专业的学生,还是对其他领域编程感兴趣的学生,这些资源都能为你提供宝贵的学习和实践机会。通过学习和运行这些源码,你可以掌握各平台开发的基础知识,提升编程能力和项目实战经验。 使用场景及目标: 在学习阶段,你可以利用这些源码资源进行课程实践、课外项目或毕业设计。通过分析和运行源码,你将深入了解各平台开发的技术细节和最佳实践,逐步培养起自己的项目开发和问题解决能力。此外,在求职或创业过程中,具备跨平台开发能力的大学生将更具竞争力。 其他说明: 为了确保源码资源的可运行性和易用性,特别注意了以下几点:首先,每份源码都提供了详细的运行环境和依赖说明,确保用户能够轻松搭建起开发环境;其次,源码中的注释和文档都非常完善,方便用户快速上手和理解代码;最后,我会定期更新这些源码资源,以适应各平台技术的最新发展和市场需求。 所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值