- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 Visual Studio 中创建 APK 时出现此错误:
Failed to load signer "signer #1": C:\...\googleplay.keystore entry "googleplay" does not contain a key
keytool -importcert -alias googleplay -file "C:\...\deployment_cert.der"
.keystore
的文件。 .我将其重命名为
googleplay.keystore
我把它搬到了一个更合适的地方。
googleplay
通过运行以下命令,别名出现在 keystore 文件中:
C:\Program Files\Java\jdk1.8.0_172\bin>keytool -v -list -keystore "C:\...\googleplay.keystore" -alias googleplay
Enter keystore password:
Alias name: googleplay
Creation date: Jul 23, 2018
Entry type: trustedCertEntry
Owner: CN=Android, OU=Android, O=Google Inc., L=Mountain View, ST=California, C=US
Issuer: CN=Android, OU=Android, O=Google Inc., L=Mountain View, ST=California, C=US
Serial number: e8************************************8a
Valid from: Thu Jul 19 14:18:56 EDT 2018 until: Sun Jul 19 14:18:56 EDT 2048
Certificate fingerprints:
MD5: 0D:**:**:**:**:**:**:**:**:**:**:**:**:**:**:C8
SHA1: 11:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:CD
SHA256: D0:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:74
Signature algorithm name: SHA256withRSA
Subject Public Key Algorithm: 4096-bit RSA key
Version: 3
Extensions:
#1: ObjectId: 2.5.29.19 Criticality=false
BasicConstraints:[
CA:true
PathLen:2147483647
]
Archive...
每
these instructions .
The archiving process has failed. Please see the Errors section for more details.
错误列表面板是空的。输出面板只是说
"java.exe" exited with code 2.
我去了
Tools -> Options -> Projects and Solutions -> Build and Run
并更改
MSBuild project build output verbosity
来自
Minimal
至
Diagnostic
并重复最后几个步骤(清理、重建、存档)。现在,输出面板(略有编辑)说:
Using "AndroidApkSigner" task from assembly "C:\...\MSBuild\Xamarin\Android\Xamarin.Android.Build.Tasks.dll".
Task "AndroidApkSigner"
AndroidApkSigner:
ApkSignerJar: C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.3\lib\apksigner.jar
ApkToSign: bin\Release\com.mycompany.myproject.apk
ManifestFile: obj\Release\android\AndroidManifest.xml
AdditionalArguments:
C:\Program Files\Java\jdk1.8.0_172\\bin\java.exe -jar "C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.3\lib\apksigner.jar" sign --ks "C:\...\googleplay.keystore" --ks-pass pass:******** --ks-key-alias googleplay --key-pass pass:******** --min-sdk-version 19 --max-sdk-version 27 C:\...\myproject.Android\bin\Release\com.mycompany.myproject.apk
Failed to load signer "signer #1": C:\...\googleplay.keystore entry "googleplay" does not contain a key
"java.exe" exited with code 2.
Done executing task "AndroidApkSigner" -- FAILED.
Done building target "_Sign" in project "myproject.Android.csproj" -- FAILED.
Done building project "myproject.Android.csproj" -- FAILED.
Build FAILED.
最佳答案
我已经找到了我的问题的答案。 documentation on the Android Developer site不适用于 Visual Studio。 Xamarin 自带的 ApkSigner 不知道用它做什么。相反,使用它来创建您自己的发布 key :
keytool -v -list -keystore c:\temp\myreleasekey.keystore -alias myalias -storetype pkcs12
-storetype pkcs12
在末尾。该命令也被修改为(1)将文件写入除 Program Files 之外的某处,(2)使用
.keystore
Visual Studio 喜欢的扩展名,并且 (3) 避免了别名中的特殊字符,这是 Visual Studio 不喜欢的,从我读过的内容来看。 (也要避免密码中的特殊字符。)
keytool
位于
c:\Program Files\Java\jdk[version]\bin
.
keytool
的警告:
Warning: The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using
keytool -importkeystore -srckeystore c:\temp\myreleasekey.jks -destkeystore c:\temp\myreleasekey.jks -deststoretype pkcs12
.
keytool -v -list -keystore c:\temp\myreleasekey.jks -alias myalias
关于visual-studio - Visual Studio 的 AndroidApkSigner 在 keystore 中找不到 key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51481342/
归档失败,我得到的错误信息是: “AndroidApkSigner”任务没有为必需的参数“KeyPass”赋值。 我以前从来没有遇到过这个问题。所以这发生在我什至到达“分发”选项之前。 最佳答案 Ad
在 Visual Studio 中创建 APK 时出现此错误: Failed to load signer "signer #1": C:\...\googleplay.keystore entry
我是一名优秀的程序员,十分优秀!