0

Updated Information: I am now discovering that this only seems to be an issue on Android 7 and up. I have multiple devices, and the apk will install on my 6.0.1 Nexus 5. But the Galaxy Tab S2 on 7.0 and the Pixel XL on 9.0 both get this error.

After the Visual Audio Mac update to 7.6.2 (build 33) I all of a sudden cannot install the generated APK for AdHoc distribution. It builds just fine in debug and release mode, but when I archive it and then side load it to a device, I get the message,

"App not installed. The package appears to be corrupt".

I am pulling my hair out on this one. Searching for answers most of the day has turned up very little.

Any hints on what might be the issue?

Sev
  • 883
  • 1
  • 14
  • 34
  • When switching to release mode, did you clean and rebuild? – Timothy James Aug 30 '18 at 21:50
  • Yes, and deleted bin/obj. Restarted VSMac. Restarted my Mac. All that standard stuff. – Sev Aug 30 '18 at 21:59
  • 1
    And I'm guessing you also deleted the app that was installed via debug/release mode? – Timothy James Aug 30 '18 at 22:02
  • Correct. And made sure there were no remnant portions of the app, like sometimes happens. I am now discovering that this only seems to be an issue on Android 7 and up. I have multiple devices, and the apk will install on my 6.0.1 Nexus 5. But the Galaxy Tab S2 on 7.0 and the Pixel XL on 9.0 both get this error. – Sev Aug 30 '18 at 22:12
  • Alright, that's the extent of what I have to offer unfortunately. Good luck. Only other thing I could suggest would be to update Xamarin and/or make sure you are able to target Android 7 and up – Timothy James Aug 30 '18 at 22:20

2 Answers2

0

This was a bug that we recently fixed. The problem was that the wrong apk was signed in Visual Studio for Mac when we changed from jarsigner to apksigner by default, in which gave you an unsigned final apk that users assumed were signed. Please sign your applications manually using the following instructions until the hotfix is released shortly in Visual Studio for Mac 7.6.3.

Manually Signing Docs:

https://learn.microsoft.com/en-us/xamarin/android/deploy-test/signing/manually-signing-the-apk

Original Issue:

https://developercommunity.visualstudio.com/content/problem/317799/major-error-76-build-2190-creates-invalid-apk-for.html

Jon Douglas
  • 13,006
  • 4
  • 38
  • 51
  • Thanks Jon. Does this also apply to apps that are only being signed for AdHoc and not the Play Store? – Sev Aug 31 '18 at 15:57
  • I am on version 7.7 preview build 977 and I still have this issue. And the problem started for me in version 7.6.3.1. I was having no issue until then. – Sev Aug 31 '18 at 16:51
  • Where do I go to get the previous version of VSMac (before 7.6.3.1)? This is a blocking issue. – Sev Aug 31 '18 at 17:02
  • @Sevren The preview most likely contained the same issue. A new stable and preview version will resolve these issues. Again, you can manually sign your APK and use the google play console to upload until this is released. – Jon Douglas Aug 31 '18 at 18:25
  • This is still the case in 2019 release i am having same issue its claiming that it is corrupt @JonDouglas I am using visual studio 2019 16.1.0 – c-sharp-and-swiftui-devni May 22 '19 at 09:59
0

Once you click "Open Folder", look for the folder "signed-apks", you will find the signed apk there, install it on your device. It works for me.

aronccs
  • 274
  • 3
  • 12
  • 30