Xamarin produce a corrupted APK using Visual Studio

NoxalusNoxalus USMember ✭✭

Hello everyone :)

Since some days, the Android packaged application (signed) produced by Xamarin through Visual Studio is corrupted, and I can't install it on my device, I have this following message: The package appears to be corrupted.

Looking on the previous working builds that I made, I noticed than the META-INF folder is missing into the corrupted APK. I did some searches on the web, but didn't figure out why it's not created anymore.

Do you have any idea?

Thanks in advance :)

Posts

  • Bert-JanBert-Jan USMember

    I have exactly the same problem, I created an APK package and when I try to install it on an galaxy S7, the error 'The package appears to be corrupted.' appears. Have you managed to solve the issue? I my case this is an update of an android project that used to deploy without issues.
    Thanks,
    Bert-Jan

  • NoxalusNoxalus USMember ✭✭

    Yep I managed to find the solution myself, I just forgot to post it here :/

    If the META-INF folder is missing, it means that your APK is not signed. Make sure to use the file with the filename that ends by -Signed.apk.

  • Bert-JanBert-Jan USMember

    Actually, I solved my issue, I hadn't signed the package (go to tools, archive manager, distribute..)

  • TanweerAhmadTanweerAhmad USMember ✭✭
    edited March 2017

    It actually needs to be signed & generation as a Release Build is necessary, by default it's on Debugging Build. Using -signed.apk filename etc is not the solution.

    Future users can refer to this video on generating & signing .apk file that's small in size & can be distributed among users & on playstore:

  • nadjallanadjalla CAMember ✭✭

    Hi, I did all steps in the video and continue having the same issue "The package appears to be corrupted.". I'm using VS2015 Enterprise. I also tried to use the apk file which is in "signed-apks" (after Ad Hoc Distribution) folder to but it also didn't work.
    Do someone have an idea how I can make it work ?

    Thanks

  • SchmerzmittelSchmerzmittel KRMember ✭✭

    I still have the problem even though I signed the apk file.

  • MrXamarinMrXamarin DKMember

    I am also experiencing the same problem, I can run it in release mode and deploy on my device and it will work. If i make a build, sign the apk file and download it to phone it will say file has been corrupted or damaged. I have no idea why.

  • MrXamarinMrXamarin DKMember

    That actually worked. Thanks a lot, really nice to come back after the weekend to a solution that works. I still have no idea why i would work to generate the signed file through release mode instead of building it and then signing it. Again thanks! Have a nice day.

  • MrXamarinMrXamarin DKMember

    Do you know what it signs the .apk file with? Is it something standard for testing, does it take one of my registered profiles for signing? If it's a standard, do you then know if that is customizable :)@MizanurRahman.0834

  • KimJensenKimJensen USMember ✭✭

    I have spend three days and I still can't build a release for Android that works. Using VS2017 Pro.

  • AlanStrattonAlanStratton USMember ✭✭

    I was also getting this corrupted message. Now as far as this META-INF folder, I have no idea where this is or what creates it. This folder does not appear in my distribution. Perhaps this is an older version that created this. I'm using all the latest tools and once you sign your archive, you have a "Open Folder" button that should open a folder with a .apk file (unsigned). In this same directory you should see a "signed-apks" folder. In this folder is the signed .apk file that you want to distribute.

    When you initially create add or import the signed certificate, it should prompt you for a location to save the signed .apk. This is where the "Open Distribution" link should bring you to.

  • AdrianGhiAdrianGhi USMember ✭✭

    Can I generate a signed version of .apk using Jenkins Automated Build?

  • veeru3112veeru3112 INMember ✭✭

    Hi, you can use this link to create and publish the apk.

  • sattilasattila Member
    edited March 2018

    I have a same problem. I made a new C# Blank App Android project as App1, builded in relase mode and distributed it with/without signed, adhoc, the result are same: "The package appears to be corrupt" message on the phone screen. I have fully updated VS 2017, Xamarin. :-(

  • LloydSummersLloydSummers USMember ✭✭

    fml, I know better and was doing the same thing. I forgot to press Distribute, AdHoc and set the signing key.

  • RuchirRuchir Member

    The solution provided by @MizanurRahman.0834 worked for me. Thanks.

  • JassimRahmaJassimRahma USMember ✭✭✭✭

    I have the same problem. Trued all solutions but still no luck. The error is:

    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

Sign In or Register to comment.