Signing xamarin.android application does not work

So, I'm trying to publish my new Android app on the Google PlayStore. From reading this tutorial. I understand that before sending it to the PlayStore, I must sign my application. I did the same as in the textbook. By downloading it to the PlayStore, I tried to install the application on my device. I got the message "The package file was not signed correctly." This is fear. In xamaran studio, I get the message "Package successfully signed."

If I try to install the application from apk on the device, I get the message "Unable to install"

What could be wrong here?

Im using Xamarin Studion on Mac.

+2
source share
5 answers

Found a problem. This is a problem with JAVA tools. This often happens when mixing JDK and JRE tools on a system.

DO NOT USE TOOLS FROM Java 7!

Use only the JDK 6 tools. You can check which version you have by typing:

java -version 

If you are still not sure that the signature was successful, you can enter:

 which jarsigner jarsigner -verify -verbose -certs myapp.apk 
+8
source

When publishing to a Mac, I automate the process using rake. This gist is a sample rake file showing how to do this. This rake file will be the build version, compile the application, and then sign the / zipalign APK.

Please note that Albacore stone must also be installed.

+1
source

this is apparently due to a switch from JDK 1.6 to JDK 1.7. Instead of sticking to JDK 1.6 (which in some cases is not an option), I recommend creating a small script to create a signed & aligned apk based on http://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/ publishing_an_application / part_1 _-_ preparing_an_application_for_release /

 # First clean the Release target. msbuild.exe HelloWorld.csproj /p:Configuration=Release /t:Clean # Now build the project, using the Release target. msbuild.exe HelloWorld.csproj /p:Configuration=Release /t:PackageForAndroid # At this point there is only the unsigned APK - sign it. # The script will pause here as jarsigner prompts for the password. # It is possible to provide they keystore password for jarsigner.exe by adding an extra command line parameter -storepass, for example # -storepass <MY_SECRET_PASSWORD> # If this script is to be checked in to source code control then it is not recommended to include the password as part of this script. & 'C:\Program Files\Java\jdk1.6.0_24\bin\jarsigner.exe' -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ./xample.keystore -signedjar ./bin/Release/mono.samples.helloworld-signed.apk ./bin/Release/mono.samples.helloworld.apk publishingdoc # Now zipalign it. The -v parameter tells zipalign to verify the APK afterwards. & 'C:\Program Files\Android\android-sdk\tools\zipalign.exe' -f -v 4 ./bin/Release/mono.samples.helloworld-signed.apk ./helloworld.apk 

An important part is the use of the -sigalg SHA1withRSA -digestalg SHA1 parameters, which force JDK 1.7 to use the expected digest algorithm (instead of SHA-256, which is used by default in JDK 1.7 and is not accepted by all versions of Android).

Please note that you can find msbuild location with

 $dotNetVersion = "4.0" $regKey = "HKLM:\software\Microsoft\MSBuild\ToolsVersions\$dotNetVersion" $regProperty = "MSBuildToolsPath" $msbuildExe = join-path -path (Get-ItemProperty $regKey).$regProperty -childpath "msbuild.exe" 
+1
source

I found a solution here https://forums.xamarin.com/discussion/comment/72399/#Comment_72399 .

The answer from Felix Alkala works perfectly. There are no more "Application not installed" messages on the device.

Open SDK Location in Xamarin Studio

Settings / Projects / Location SDK / Android

and install the Java SDK (JDK) in

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

0
source

When using the Google Play service component for ICS from Xamarin, the following error appears if you are using JDK 6.

 2>JAVAC : warning : com\google\ads\mediation\MediationBannerListener.class(com\google\ads\mediation:MediationBannerListener.class): major version 51 is newer than 50, the highest major version supported by this compiler. 2>JAVAC : warning : com\google\ads\mediation\MediationBannerAdapter.class(com\google\ads\mediation:MediationBannerAdapter.class): major version 51 is newer than 50, the highest major version supported by this compiler. 

Error creating Xamarin.Android project with Google Play services

This error is resolved by switching from JDK 6 to JDK 7. Because of this, now my application, which has already been deployed to the Google Play Store, throws a “batch file was not signed correctly” on some smartphones.

Is there a way to properly sign an application using JDK 7 and Xamarin?

-1
source

Source: https://habr.com/ru/post/972622/


All Articles