Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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. #3324

Closed
jrahma opened this issue Jul 3, 2019 · 9 comments
Assignees

Comments

@jrahma
Copy link

jrahma commented Jul 3, 2019

Hi,

Why all my new projects shows shows:

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.

when uploading the APK to Google Play?

and when I try:

zipalign.exe -v -p 4 C:\Temp\zipalign\com.jafaria.app.apk C:\Temp\zipalign\com.jafaria.app-aligned.apk
and upload the APK then I get:

You uploaded an APK with an invalid signature (learn more about signing). Error from apksigner: ERROR: JAR_SIG_NO_MANIFEST: Missing META-INF/MANIFEST.MF

I never shows these errors before

VS bug #976385

@samhouts samhouts transferred this issue from xamarin/Xamarin.Forms Jul 3, 2019
@jonathanpeppers
Copy link
Member

Hi @jrahma,

  • How are you uploading to Google Play? Are you using the publishing UIs in Visual Studio? Windows or Mac?
  • Can you post your version details for Visual Studio & Xamarin.Android?

If you could record a diagnostic build log that would also help.

@jonathanpeppers jonathanpeppers added this to the Under Consideration milestone Jul 5, 2019
@jonathanpeppers jonathanpeppers self-assigned this Jul 5, 2019
@jonathanpeppers jonathanpeppers added the need-info Issues that need more information from the author. label Jul 5, 2019
@jrahma
Copy link
Author

jrahma commented Jul 5, 2019

@jonathanpeppers

  1. How are you uploading to Google Play? Are you using the publishing UIs in Visual Studio? Windows or Mac?

Yes I am using the publishing UI using Archive and the Distribute and select the Keystore, enter the password then apk will be generated

I am using Visual Studio 2019 Version 16.1.5 for Windows

  1. Can you post your version details for Visual Studio & Xamarin.Android?

Compile Using : Android 9.0

Minimum Android Version: Android 7.1 (API Level 25)

Target Android Version : Android 9.0 (API Level 28)

@jrahma
Copy link
Author

jrahma commented Jul 5, 2019

Diagnostic build log is attached

Thanks

BuildLog.zip

@jonathanpeppers
Copy link
Member

Sorry @jrahma you might have to record the build log while deploying to device or emulator.

It doesn't look like the signing steps are in this log. 😞

@jrahma
Copy link
Author

jrahma commented Jul 5, 2019

No worries @jonathanpeppers

It's attached here now

BuildLog2.zip

@jonathanpeppers
Copy link
Member

/cc @joj I think whatever is happening here is from the publishing workflow in VS, and we don't actually need an MSBuild log.

Is there a log he can grab from the publishing UI that would help here?

@jonathanpeppers jonathanpeppers added the vs-sync For internal use only; creates a VSTS "mirror" issue. label Jul 8, 2019
@jrahma
Copy link
Author

jrahma commented Jul 8, 2019

guys if this is going to take longer time then is there any workaround?

I am supposed to publish the app this month and my hands are tied now because all apps giving the same problem.

@jonathanpeppers
Copy link
Member

@jrahma you can configure your Release build: https://docs.microsoft.com/en-us/xamarin/android/deploy-test/building-apps/build-process#signing-properties

    <AndroidKeyStore>True</AndroidKeyStore>
    <AndroidSigningKeyStore>filename.keystore</AndroidSigningKeyStore>
    <AndroidSigningStorePass>keystore.filename password</AndroidSigningStorePass>
    <AndroidSigningKeyAlias>keystore.alias</AndroidSigningKeyAlias>
    <AndroidSigningKeyPass>keystore.alias password</AndroidSigningKeyPass>

And then build your APK with just the Release configuration in the IDE, or command-line:

msbuild YourApp.Android.csproj /t:SignAndroidPackage /p:Configuration=Release

@grendello grendello removed the need-info Issues that need more information from the author. label Sep 2, 2019
@jonpryor jonpryor reopened this Sep 18, 2019
@tondat
Copy link
Contributor

tondat commented Oct 4, 2019

@jrahma Thank you for your feedback!

Given that you have a clear repro of the issue and in order to continue investigating, we would really like you to please report the error using the VisualStudio Report a problem tool.

Here you can see the instructions https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem?view=vs-2019.

When you report problems using this tool within VisualStudio, the IDE collects several diagnostic information that helps our investigation, like the IDE logs and environment configuration.

Also, as there is some build specific information that is not automatically attached and can be useful to investigate this case, we would also ask you to please install the Project System Tools extension that allows you to obtain internal build logs:
https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ProjectSystemTools

To start the tool please use the menu option View\Other Windows\Build Logging.

The tools show up a start button that starts recording all the queries executed.

After that please try to reproduce the problem creating the archive and trying to distribute it.

Please attach to the reported error the content of the build output pane, the content of the Xamarin output pane and the logs detected by the tool related to the targets PackageForAndroid\SignAndroidPackage`.

With all this information, we should be able to move forward with the investigation.

Thank you for taking the time to report this problem, we look forward to hearing from you!

@brendanzagaeski brendanzagaeski removed the vs-sync For internal use only; creates a VSTS "mirror" issue. label Oct 4, 2019
@pjcollins pjcollins removed this from the d16-3 milestone Sep 2, 2020
@jpobst jpobst closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Oct 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants