简体   繁体   English

无法上传APK,因为未找到AndroidManifest.xml而失败

[英]Cant upload APK, failed because no AndroidManifest.xml found

I have created my app on google play, when I got to sumbit the APK I get this error: 我在Google Play上创建了我的应用,当我需要对APK进行汇总时,出现以下错误:

Upload failed

Your APK cannot be analyzed using 'aapt dump badging'. Error output:

Failed to run aapt dump badging:
ERROR: dump failed because no AndroidManifest.xml found

I clearly have a AndroidManifest.xml file in my project, I also have compressed my .apk to .zip too, I'm clueless to whats wrong. 我的项目中显然有一个AndroidManifest.xml文件,我也已将.apk压缩为.zip,我不知道发生了什么问题。

There are few steps before going to upload .apk on Play store 在Play商店上载.apk之前,需要执行几个步骤

1.Generate private key using 1.使用生成私钥

keytool -genkey -v -keystore my-release-key.keystore
-alias alias_name -keyalg RSA -keysize 2048 -validity 10000

2.Compile application in release mode: Right click on project then chose Android Tools then Export Unsigned Application Package give the location where you want to save the .apk. 2.在发布模式下编译应用程序:右键单击项目,然后选择“ Android工具”,然后选择“ 导出未签名的应用程序包”,提供要保存.apk的位置。 Here after successful saving, eclipse alert you about What next to do? 保存成功后,日食会在此提醒您下一步该怎么做?

3.Now sign your application with private key generated in step first 3.现在使用第一步中生成的私钥对应用程序进行签名

jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore my-release-key.keystore
your_app_name.apk alias_name

in this step jarsigner may throw the error if your my-release-key.kestore and your_app_name.apk are not at same location. 如果my-release-key.kestore和your_app_name.apk不在同一位置,则jarsigner可能会在该步骤中引发错误。

4.align your package using zipalign tool 4.使用zipalign工具对齐您的包裹

zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk

very clearly explained at developer.android.com 在developer.android.com上非常清楚地解释了

Rahul is right, I am also struggling with all the landmines left behind by google, but I managed to complete step 3 thanks to his insight. 拉胡尔(Rahul)是对的,我也为谷歌留下的所有地雷感到苦恼,但由于他的洞察力,我设法完成了第三步。

I must add that JDK7 users must change the encryption algorithms and key size with the jarsigner: 我必须补充一点,JDK7用户必须使用jarsigner更改加密算法和密钥大小:

1) jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 –keystore mykeystore myApp.apk mykey 1)jarsigner-详细-sigalg MD5withRSA -digestalg SHA1 –keystore mykeystore myApp.apk mykey

2) keytool -genkey -alias mykeystore -keyalg RSA -keysize 1024 -sigalg MD5withRSA -keystore mykey –validity 36500 2)keytool -genkey -alias mykeystore -keyalg RSA -keysize 1024 -sigalg MD5withRSA -keystore mykey –validity 36500

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

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