The package was not properly signed (NO_CERTIFICATES) in running application
Asked Answered
S

9

23

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()
Scrouge answered 9/3, 2018 at 19:41 Comment(4)
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 sessionDanais
I completely removed emulator and re added it and still not working. Also i tried different emulators.Scrouge
Rebuild the app using MSBuild diagnostic level logging and look for other errors/warning, especially around the jarsigner taskDanais
When targeting android 11, this will happen if not signing with the v2 scheme. https://mcmap.net/q/585325/-xamarin-app-can-39-t-deploy-to-android-11-emulatorParbuckle
P
29

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

Paddle answered 3/7, 2018 at 13:34 Comment(4)
This is the kind of software quality I would expect from npm. Very disappointed in MS.Marvel
This literally happens all the time in VS, not surprised at all.Emyle
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.Gargle
I also had to close Visual Studio and delete the .vs folder.Warwickshire
R
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

Renaud answered 17/9, 2020 at 12:33 Comment(0)
H
2

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.

Heatherheatherly answered 11/7, 2022 at 10:48 Comment(0)
S
1

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

Scrouge answered 10/3, 2018 at 9:14 Comment(0)
R
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.

Roter answered 18/4, 2018 at 7:58 Comment(0)
E
1

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

Close Visual Studio.

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

Explain answered 3/8, 2020 at 10:54 Comment(0)
P
1

For those trying to work with the following setup:

  • Visual Studio 2019 (version 16.11.28)
  • Xamarin 16.11.000.204
  • Xamarin.Android SDK 12.0.0.3
  • Eclipse Temurin JDK with Hotspot (8u302-b08 (x64))

and having trouble deploying (to the emulator) during debugging due to (one of) the following compile errors:

  • The package was not properly signed (NO_CERTIFICATES)
  • java.exe exited with code 2
  • Failed to load signer "signer #1" - java.io.IOException: Invalid keystore format

the problem is with the (default) C:\Users\%USERNAME%\AppData\Local\Xamarin\Mono for Android\debug.keystore file not working properly with apksigner when targeting Android API Level 30 or greater.

To make ends meet follow the steps below:

  1. In VS > Unload .Android Project > Edit Project File
  2. Add the following line: <AndroidUseApkSigner>true</AndroidUseApkSigner> to the Debug PropertyGroup (as originally mentioned here)
  3. Reload Project
  4. Delete the C:\Users\%USERNAME%\AppData\Local\Xamarin\Mono for Android\debug.keystore file
  5. Clean Solution > Rebuild Solution
  6. Start debugging
Popup answered 18/9, 2023 at 6:11 Comment(1)
Helped in 2024.Pharr
S
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 .

Splendiferous answered 8/5, 2018 at 7:22 Comment(0)
A
0

Probably the flag "Sign the .APK file ..." is checked. Go to project properties > Android Package Signing on VisualStudio and decheck this flag. Pay attention to the configuration that is set (Release, Debug, ...)

enter image description here

Adriell answered 30/1, 2024 at 8:32 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.