简体   繁体   English

Eclipse在更新ADT后不会导出apk文件吗?

[英]Eclipse won't export apk file after updating ADT?

I updated my ADT plugin within Eclipse IDE on April 13th and now it won't export my projects with the apk file extension. 我于4月13日在Eclipse IDE中更新了我的ADT插件,现在它不会导出带有apk文件扩展名的项目。 Can someone please help me fix this? 有人可以帮我解决这个问题吗? I can't figure out what's wrong. 我不知道怎么了。 Thank you in advance. 先感谢您。

Had the same problem. 有同样的问题。 Here's how I fixed it. 这是我固定的方法。

  1. First open CMD as Administrator and set the current directory to your [JAVA_FOLDER]\\bin 首先以管理员身份打开CMD并将当前目录设置为您的[JAVA_FOLDER] \\ bin

  2. Type the following to generate your keystore (You'll be asked for a password). 键入以下内容以生成您的密钥库(将要求您输入密码)。 Your parameters go where the bracketed text is. 您的参数将放在方括号中。

    keytool -genkey -v -keystore [keystore-name.keystore] -alias [key-alias] -keyalg RSA -keysize 2048 -validity 10000

  3. In ADT/Eclipse, right click on your project folder, select Android Tools >> Export Unsigned Application Package 在ADT / Eclipse中,右键单击您的项目文件夹,选择Android Tools >> Export Unsigned Application Package

  4. Sign your unsigned apk using the generated keystore with this 使用生成的密钥库对此签名未签名的apk

    jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore [keystore-name].keystore unsigned.apk [key_alias]

  5. Verify you signed it correctly with 验证您是否正确签署了

    jarsigner -verify [signed-apk].apk

  6. Your apk is now signed an can be distributed. 您的apk现在已签名,可以分发。 However, it is recommended to DWORD align the file. 但是,建议使用DWORD对齐文件。 So, in CMD, navigate to your [Android SDK folder]\\tools and type the following 因此,在CMD中,导航到[Android SDK文件夹] \\ tools并输入以下内容

    zipalign -v 4 [path-to-unaligned].apk [path-to-final].apk

  7. Your apk is finally ready for distribution. 您的apk终于可以分发了。

NOTE : What I did was let keytool.exe save the keystore in the JAVA bin directory and then moved it to a secure location afterwards. 注意 :我所做的是让keytool.exe将密钥库保存在JAVA bin目录中,然后将其移至安全位置。

You can make batch script so you don't type a lot. 您可以制作批处理脚本,因此无需过多输入。

For more information: 欲获得更多信息:

http://developer.android.com/tools/publishing/app-signing.html http://developer.android.com/tools/publishing/app-signing.html

I fixed my problem. 我解决了我的问题。 I was using the recommended Eclipse Mobile referenced on the android dev website but I installed Eclipse Indigo instead with the ADT v21 plugin and it works perfectly now with exporting .apk file extensions. 我使用的是android dev网站上引用的推荐的Eclipse Mobile,但是我安装了带有ADT v21插件的Eclipse Indigo,并且现在可以完美地导出.apk文件扩展名。 Hope this helps anyone with the same issue. 希望这对遇到同样问题的人有所帮助。

So in short: The answer to Eclipse not being able to export .apk files is to use Eclipse Indigo instead. 简而言之:Eclipse无法导出.apk文件的答案是改用Eclipse Indigo。

Which can be found here: http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/indigosr2 可以在这里找到: http : //www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/indigosr2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM