I have just finished and signed the apk through android studio, then I have did a signed apk. when I am trying to upload the apk to play store I got this error " You uploaded an APK that is not zip aligned. You will need to run a zip align tool on your APK and upload it again.
try cross check that you didn't uploaded debug version cross check the following link.
http://developer.android.com/tools/publishing/app-signing.html#releasecompile
Try to update your sdk or you can run zipalign manually in command line
zipalign [-f] [-v] <alignment> infile.apk outfile.apk
Note that zipalign is located inside
${sdk.dir}\tools
Link to zipalign:
http://developer.android.com/tools/help/zipalign.html
Related
I have created a build pipeline in Devops for releasing my app to the Google Play Store. The build succeeds however, when uploading the resulting APK file to Google Play Store it complains - "You uploaded an APK that is not zip aligned. You will need to run a zip align tool on your APK and upload it again.".
I have checked the Android Signing Task within the pipeline to ensure that Zip Align is enabled.
When performing the build manually through VS2019 and signing the APK it all works fine but, I'd like to get the pipeline working.
Please help.. Thanks in advance !
You uploaded an APK that is not zip aligned. You will need to run a
zip align tool on your APK and upload it again.
According to this document: When using apksigner, it is important to first zipalign the application, and then to sign it with apksigner.
I think maybe you only enable the Zipalign option. For this,you need to enable both the Signing Options and Zipalign options for Android Signing Task. You can follow this document for more details.
The issue was the path to the APK within the pipeline. Once this was set correctly the APK uploaded fine into Google Play Store.
When I generate the .apk it is saying: .apk. Failed with message: Error: APK is not zip aligned.
To over come from this issue please make sure that task: AndroidSigning#3 must have see the solution with detail
enter link description here
I have created a Xamarin Form application using Visual Studio 2017 in Windows 10 and archived the android application to APK file.
When I upload the APK to Google Play console to update my existing app, it says the APK is not signed. Then I used this command to sign the APK using the same certificate
apksigner sign --ks <KEYSTORE_FILE_NAME> --ks-key-alias <ALIAS_NAME> <APK_FILE_NAME>
When I try to upload the signed APK, it says the APK is not zipaligned. Then I used this command to zipalign
zipalign -f -v 4 <OLD_APK_FILE_NAME> <NEW_APK_FILE_NAME>
When I upload the zipaligned APK to console, it says the APK is not signed. After I sign using apksigner it says it is not zipaligned. I am keep on circulating in the same circle again and again.
Even after I zipalign the APK first and then sign, Same error messages are displaying again and again in same circle.
Even if I used jarsigner, the situation is same.
I followed the steps given here
https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/publishing/signing-the-app-package/manually-signing-the-apk/
But the APK not getting uploaded. What am I doing wrong?
Please note this is not a duplicate question.
apksigner requires you to zipalign prior to signing. jarsigner requires you to zipalign after signing. This is documented in the zipalign docs.
I have generated signed apk from Android Studio, it contains ndk and compiled as .so in lib folder inside the apk.
Because of a problem I am facing here:
Checksum value of classes.dex keep changing with Dexguard for every build
I want to replace the .so without re-building the classes.dex in the signed apk. However, after unzipping the apk and re-pack it. It cannot be installed, although I have signed the re-packed apk again using "jarsigner -verbose -keystore".
Any hints for how can I do that? Thanks.
Did you run zipalign after signing?
zipalign -v 4 your_project_name-signed.apk your_project_name-aligned.apk
See the final step in http://developer.android.com/tools/publishing/app-signing.html#signing-manually
I have just finished and signed the apk through android studio,
then I have did an apk protect through apkprotect.com
when I am trying to upload the apk to play store I got this error " You uploaded an APK that is not zip aligned. You will need to run a zip align tool on your APK and upload it again. "
if I upload the original apk I got no errors,
I have tried to add zipalign true in the build.gradle but nothing happened
I have tried also disable and enable proguard .
You can run zipalign manually in command line:
zipalign [-f] [-v] <alignment> infile.apk outfile.apk
Note that zipalign is located inside ${sdk.dir}\tools
For more details visit zipalign
[Update]
Also, If you need to sign it you can run:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore YOURKEYSTORE unsigned.apk alias_name
(jarsigner is located inside java JDK_HOME/bin)
I got the same "You uploaded an APK that is not zip aligned... blah, blah" error when by mistake I tried to upload a DEBUG version of my .apk file to Google Play. It's a bit misleading error because the real problem is that you cannot distribute a debug version which additionally is not signed with your Google Android Developer key. (You can only upload an .apk compiled as release version, and it must be signed, which happens in the same step, at least if you're using Eclipse).
Make sure you distribute an .apk file which is your Signed Release version, as described here:
http://developer.android.com/tools/publishing/app-signing.html#releasecompile
This question and its answers are old; so we expect things to change. As of today, the zipalign tool is in the ANDROID_HOME directory under build-tools/[version]/ so my path is currently:
/android-sdk/build-tools/22.0.0/zipalign
Using the zipalign tool is not necessarily the answer here though, what you actually need to do is sign your apk.
Steps if using Xamarin for VS2017:
Build project
Right click and Archive project
Use Ad Hoc distribution channel
Sign your APK with your Signing Identity and Save As to produce an APK that is ZIP aligned.
Your APK can be uploaded to Google Play.
I was using Cordova, uploaded a signed APK but still got this error.
The ziptool is what helped me, it's located at ~AndroidSDK\build-tools\24.0.0\zipalign.exe
So for example :
"~\AndroidSDK\build-tools\24.0.0\zipalign.exe" -f -v 4 android-release-signed.apk android-release-signed-zipaligned.apk
I was using Cordova and the command line getting this error. I opened the project in Android Studio and used Android Studio to build the signed apk and the error went away.
When using the Cordova node.js CLI without going through Android Studio, it is necessary to update the PATH environmental variable to include the android build tools:
%ANDROID_HOME%\build-tools\29.0.2
Obviously the version number will change over time. Remember to close any CLI windows and re-open them to recognize the newly added path.
Can anyone tell me how to zipalign my .apk file with using eclipse. I have made my .apk file by giving command like,
Right Click on Project Folder
Click on "Android Tools" option from menu.
Click on "Export Signed Application Package..." and my .apk generated in given application alias.
Now want to do zipalign for this above generated .apk file. Does any tool require to do so OR anything that can solve my problem.
If you did what you described above then Eclipse has already zipaligned your apk for you. You can't zipalign an already zipaligned package
I think this will help you
D:\android-sdk\android-sdk\tools>zipalign -f -v 4 "C:\Users\name\Desktop\project_name\projectname_signed.apk" "C:\Users\name\Desktop\project_name\projectname__zipaligned.apk"
Using the steps given, Eclipse will do zipalign for you.
This is a very tricky part and initially i was also ran in to strange problems . Before uploading to android market you must do the following steps.
Create a Certificate
Signing your application apk
Finally Zip align the signed apk
Check this site: How to sign Android project apk
Eclipse zipalign APKs when you export them by default.
zipalign is basically a tool available in tools directory of your android sdk.
In case you are not using eclipse to build, you can use this tool directly to zipalign your apk.
zipalign [-f] [-v] <alignment> infile.apk outfile.apk
The alignment is an integer that defines the byte-alignment boundaries. This must always be 4 (which provides 32-bit alignment) or else it effectively does nothing.
For more detail, check this link
http://developer.android.com/tools/help/zipalign.html
If you to signed and zip aligned your APK file, so that you could redistribute your file and upload it play store. Then follow these simple steps
Open Eclipse
File--> Export
Browse-->Select your project
Next-->Next
So, after all of that you will get an APK which will be signed and zip aligned.
Eclipse zipalign apk automatically. When you export the project, eclipse must be generating signed apk to a different destination. Check properly where it prompts when you generate a signed apk
Eclipse automatically zipaligns your .apk file if you did what you described above.