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?
I might have a solution for you, since I had the same issue:
In your AndroidManifest.xml, add to the application tag the following parameter:
android:extractNativeLibs="true"
This is due to a change in the android gradle plugin, which changed the default value from true to false in Version 3.6.0 (Source: https://developer.android.com/guide/topics/manifest/application-element#extractNativeLibs)
I don't know if there are any side effects but this fixed it for me.