Reputation: 430
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()
Upvotes: 23
Views: 17689
Reputation: 129
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, ...)
Upvotes: 0
Reputation: 2032
For those trying to work with the following setup:
and having trouble deploying (to the emulator) during debugging due to (one of) the following compile errors:
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:
<AndroidUseApkSigner>true</AndroidUseApkSigner>
to the Debug
PropertyGroup (as originally mentioned here)C:\Users\%USERNAME%\AppData\Local\Xamarin\Mono for Android\debug.keystore
fileUpvotes: 1
Reputation: 2266
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.
Upvotes: 2
Reputation: 5099
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:
Upvotes: 3
Reputation: 2358
If deleting /bin folder does not help, try this:
Close Visual Studio.
Open Visual Studio Installer, in drop-down menu select Repair
Upvotes: 1
Reputation: 685
I just delete all file in Folder /bin from my Android project and recompile.
Upvotes: 31
Reputation: 2106
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 .
Upvotes: 0
Reputation: 325
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.
Upvotes: 1
Reputation: 430
This problem happened after installing visual studio 2017 updates. after running visual studio repair everything worked fine.
Upvotes: 1