Forum Xamarin.Android

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Xamarin Android : Archive - “App not installed. The package appears to be corrupt”

We are in process of migrating our Xamarin.Android app to AndroidX. Code migration is completed. Few dependent libraries are still using old support libraries, so kept these old support package nugets as well. Build is successful. Can debug and deploy to simulator. I can also deploy using the APK generated after build & deploy.

Problem: When we make an Archive, signed APK is created, but we get below error while APK installing on device.

App not installed. The package appears to be corrupt.

Tried uninstalling existing application, mono runtime, support libraries from device.

Did someone faced this issue on VS2019 latest version while doing AndroidX migration?

Best Answer

  • vitthalpatilvitthalpatil USMember ✭✭
    Accepted Answer

    Managed to solve it atleast for short term by adding in AndroidManifest.xml under application tag the following parameter:

    android:extractNativeLibs="true"

Answers

  • LardeCristoLardeCristo Member ✭✭

    Hi!! Please try this.
    First-one - Change for project to Debug mode
    Second-one - Clean your solution
    Third-one - Build solution and
    Last one - Change again to Release mode and Rebuild solution.

  • vitthalpatilvitthalpatil USMember ✭✭

    @LardeCristo said:
    Hi!! Please try this.
    First-one - Change for project to Debug mode
    Second-one - Clean your solution
    Third-one - Build solution and
    Last one - Change again to Release mode and Rebuild solution.

    Hey, As I said in question, no issue in deployment/debug. Only issue when we prepare an archive and try to install the signed APK.

  • LardeCristoLardeCristo Member ✭✭

    @vitthalpatil said:

    @LardeCristo said:
    Hi!! Please try this.
    First-one - Change for project to Debug mode
    Second-one - Clean your solution
    Third-one - Build solution and
    Last one - Change again to Release mode and Rebuild solution.

    Hey, As I said in question, no issue in deployment/debug. Only issue when we prepare an archive and try to install the signed APK.

    I understand your question, sametime for me I have the same problem and I use this sequence. After that my APK is OK... :)

    ** I'll still learning English, yet... :)

  • vitthalpatilvitthalpatil USMember ✭✭
    Yeah, I understand.

    My problem is not related to build/rebuild. I already clean everything bin/obj and rebuild in Release configuration, and try to create signed archive. Problem occurs at that flow. Otherwise it works when you just Deploy to simulator and pick generated APK. Normal debug also works as usual.
  • vitthalpatilvitthalpatil USMember ✭✭
    Accepted Answer

    Managed to solve it atleast for short term by adding in AndroidManifest.xml under application tag the following parameter:

    android:extractNativeLibs="true"

  • vitthalpatilvitthalpatil USMember ✭✭

    Ref:
    github.com/xamarin/xamarin-android/pull/5021
    github.com/xamarin/xamarin-android/issues/4986

Sign In or Register to comment.