Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
xamarin.android应用程序签名不起作用_Android_Xamarin.android_Code Signing_Xamarin Studio - Fatal编程技术网

xamarin.android应用程序签名不起作用

xamarin.android应用程序签名不起作用,android,xamarin.android,code-signing,xamarin-studio,Android,Xamarin.android,Code Signing,Xamarin Studio,所以我想把我的新安卓应用程序发布到谷歌PlayStore上。通过阅读教程,我了解到在将应用程序发布到PlayStore之前,我必须对其进行签名。我做的和教程中完全一样。上传到PlayStore后,我尝试在我的设备上安装该应用程序。我收到消息“包文件未正确签名”。这是斯特拉奇。。在xamaran studio中,我收到消息“包已成功签名” 如果我尝试从设备上的apk安装应用程序,我会收到消息“无法安装” 这里可能出了什么问题 我在Mac电脑上使用Xamarin Studion。在Mac电脑上发布时

所以我想把我的新安卓应用程序发布到谷歌PlayStore上。通过阅读教程,我了解到在将应用程序发布到PlayStore之前,我必须对其进行签名。我做的和教程中完全一样。上传到PlayStore后,我尝试在我的设备上安装该应用程序。我收到消息“包文件未正确签名”。这是斯特拉奇。。在xamaran studio中,我收到消息“包已成功签名”

如果我尝试从设备上的apk安装应用程序,我会收到消息“无法安装”

这里可能出了什么问题


我在Mac电脑上使用Xamarin Studion。

在Mac电脑上发布时,我使用rake实现过程自动化。是一个示例rake文件,显示如何执行此操作。此rake文件将对程序集进行版本设置,编译应用程序,然后对APK进行签名/zipalign


请注意,还必须安装。

发现问题。。这是一个JAVA工具问题。在系统上混合使用JDK和JRE工具时,经常会出现这种情况

不要使用Java 7中的工具

仅使用JDK 6中的工具。 您可以通过键入以下内容来检查您的版本:

java -version
如果仍不确定签名是否成功,可以键入:

which jarsigner

jarsigner -verify -verbose -certs myapp.apk

使用Xamarin提供的Google Play服务组件ICS时,如果您使用的是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.

通过将JDK 6更改为JDK 7,可以解决此错误。正因为如此,现在我已经部署到Google Play商店的应用程序在一些智能手机上抛出了“包文件未正确签名”


有没有一种方法可以使用JDK 7和Xamarin正确地为应用程序签名?

这似乎是由从JDK 1.6切换到JDK 1.7引起的。与坚持JDK1.6(在某些情况下这不是一个选项)不同,我建议创建一个小脚本,用于基于

我在这里找到了解决办法

Felix Alcala的答案非常完美。设备上不再显示“未安装应用程序”消息

在Xamarin Studio中打开SDK位置

首选项/项目/SDK位置/Android

并将JavaSDK(JDK)设置为

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


您使用的是Xamarin Studio还是Visual Studio?你是在运行OSX还是Windows?@TomopGenoth我编辑了我的问题:)根据我的经验,我建议手动签署你的应用程序。@Aronhe Ok手动签署效果很好,但当我尝试zipalign时,我在谷歌上搜索了一段时间,发现你必须这样做。/zipalign,但我得到了消息“没有这样的文件或目录”。@AaronHe它现在起作用了。我给我的软件包贴上了zipaligned并签名。当我现在把它上传到Playstore时,它说“你的APK已经用多个证书签名了。”。请只使用一个证书进行签名,然后再次上传。”已经通过使用不同版本的java修复了它。java 7 JDK中有一个bug。但是这看起来更容易。我会尽快尝试。刚刚遇到这个问题,希望添加路径(至少在OSX 10.9上)JDK 6是/System/Library/Java/JavaVirtualMachines/1.6.0.JDK/Contents/Home,您可以在Xamarin Studio的Preferences->SDK Locations->AndroidI中设置它,我不确定是否只有Java 6起作用,但我可以确认Java 8在OSX Yosemite上对我不起作用。我没有更改开发环境中使用的任何工具或Java版本environment(来自
Java-version
)的Java 8…开发环境是Xamarin…但我可以说,当我使用
jarsigner
的Java 6版本时,我就可以从Google Play store运行应用程序了,否则就无法运行。
# 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
$dotNetVersion = "4.0"
$regKey = "HKLM:\software\Microsoft\MSBuild\ToolsVersions\$dotNetVersion"
$regProperty = "MSBuildToolsPath"

$msbuildExe = join-path -path (Get-ItemProperty $regKey).$regProperty -childpath "msbuild.exe"