简体   繁体   English

清理并(重新)构建后创建apk

[英]create apk, after clean and (re)build

I decided to clean and rebuild my app, because the apk didn't show the code changes. 我决定清理并重建我的应用程序,因为apk没有显示代码更改。 Now after the building I haven't the apk in my bin folder and i can't run the app on my smartphone. 现在,在建筑物之后,我的bin文件夹中没有apk,并且无法在智能手机上运行该应用程序。

how can i create the apk? 如何创建APK?

When you run the project on the emulator, the .apk is generated on the bin directory. 在模拟器上运行项目时, .apk会在bin目录中生成。 Keep in mind that just building the project (and not running it) will not output the apk file into the bin directory. 请记住,仅构建项目(而不运行它)不会将apk文件输出到bin目录中。

To export an unsigned .apk from Eclipse, right-click the project in the Package Explorer and select Android Tools > Export Unsigned Application Package . 要从Eclipse导出未签名的.apk在Package Explorer中右键单击该项目,然后选择Android Tools> Export Unsigned Application Package Then specify the file location for the unsigned .apk . 然后为未签名的.apk指定文件位置。

For signed apk:- 对于签名的apk:-

Export -> Android -> Export Android Application -> YOUR_PROJECT_NAME -> Create new key store path -> Fill the detail -> Set the .apk location -> Now you can get your .apk file 导出-> Android->导出Android应用程序-> YOUR_PROJECT_NAME->创建新的密钥存储路径->填写详细信息->设置.apk位置->现在您可以获取.apk文件

Now install the generated apk in your mobile. 现在,将生成的apk安装在您的手机中。

Note:- I assume there are no errors in the project. 注意:-我假设项目中没有错误。

Edit:- Snapshots attached. 编辑:-附带快照。

图片1

图片2

I haven't the apk in my bin folder 我的bin文件夹中没有apk

It might be because of you have error in your code. 可能是因为您的代码中有错误。 When you run the project from Eclipse then it will automatically be created by apk builder. 从Eclipse运行项目时,它将由apk构建器自动创建。

In Eclipse, under Project Props, Build Path option, we can manually set the output folder. 在Eclipse中的“项目道具”,“构建路径”选项下,我们可以手动设置输出文件夹。 Make sure you you not edited this. 确保您没有编辑此内容。

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

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