18

I am developing xamarin forms application and i got the below error when running application on android emulator

>The package was not properly signed (NO_CERTIFICATES).
2>   at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName)
2>   at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass94_0.<InstallPackage>b__0(Task`1 t)
2>   at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
2>   at System.Threading.Tasks.Task.Execute()
2>Done building project "Modern.FM.Mobile.Android.csproj".
2>Build succeeded.
2>The package was not properly signed (NO_CERTIFICATES).
2>   at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName)
2>   at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass94_0.<InstallPackage>b__0(Task`1 t)
2>   at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
2>   at System.Threading.Tasks.Task.Execute()
Saamer
  • 4,687
  • 1
  • 13
  • 55
Mahmoud Alam
  • 380
  • 1
  • 4
  • 13
  • Manually delete the package from emulator (either via `Setting` in the emulator or via `adb` via `adb uninstall yourpackagenamehere` and then perform a clean/build all and run a debugging session – SushiHangover Mar 09 '18 at 19:49
  • I completely removed emulator and re added it and still not working. Also i tried different emulators. – Mahmoud Alam Mar 09 '18 at 19:57
  • Rebuild the app using MSBuild diagnostic level logging and look for other errors/warning, especially around the `jarsigner` task – SushiHangover Mar 09 '18 at 20:00
  • When targeting android 11, this will happen if not signing with the v2 scheme. https://stackoverflow.com/a/63564053/361714 – Tom Aug 24 '20 at 15:44

7 Answers7

24

I just delete all file in Folder /bin from my Android project and recompile.

Gustavo
  • 605
  • 6
  • 11
  • 3
    This is the kind of software quality I would expect from npm. Very disappointed in MS. – user10753492 Oct 24 '19 at 01:34
  • 2
    This literally happens all the time in VS, not surprised at all. – Ferre12 May 28 '20 at 13:28
  • It's been a while since I had to work on a this mobile project I have. When I got the error, I searched and ended up here. As soon as I saw this, I remembered I have a bash script that goes through and cleans all the /bin and /obj folders just because of how frequently this happens. – Ickster Sep 14 '20 at 21:42
  • I also had to close Visual Studio and delete the .vs folder. – mpwhitt Dec 20 '22 at 20:12
3

If none of the other solutions work, just open your android project options, and then go to Android Package Signing, and make sure "Sign the .APK file..." is deselected for all the configurations and platforms, as shown: Screenshot of the Android options window

Saamer
  • 4,687
  • 1
  • 13
  • 55
1

This problem happened after installing visual studio 2017 updates. after running visual studio repair everything worked fine.

Mahmoud Alam
  • 380
  • 1
  • 4
  • 13
1

I had the same error but for me just repairing Visual Studio didn't work so I investigated a little bit more and I found out that the problem was related to the java version.

The solution was to uninstall the jre/jdk for java version 9 and now I can deploy again.

jcasas
  • 305
  • 4
  • 12
1

If deleting /bin folder does not help, try this:

Close Visual Studio.

Open Visual Studio Installer, in drop-down menu select Repair

John Deer
  • 2,033
  • 2
  • 13
  • 16
1

2022 Updated Answer.

For anyone comming accross this issue, if deleting the /bin or /obj didn't work, try these:

  • It might be an issue with branch merging or switching in Git, so what you should do if it is the case is a "git clean -fdx" to clean every residual file.

  • If the above didn't work, open your android "csproj" file, and check that this flag is set to "False" in DEBUG configuration ONLY. <AndroidKeyStore>false</AndroidKeyStore>

Once you do that, it will disable the signing of the debug build, and you'll be able to continue deploying at ease.

Damien Doumer
  • 1,991
  • 1
  • 18
  • 33
0

I had the same problem though I got that error once only in emulator and once only in device! I removed my my redundant Java 9 as @jcasas told and also updated my Visual Studio from 15.6.6 to 15.7.0 .

VahidShir
  • 2,066
  • 2
  • 17
  • 27