繁体   English   中英

将.apk安装到Android模拟器时出错

[英]Error in installing .apk to android emulator

我正在尝试将我的.apk文件安装到仿真器,但这给了我错误。

subh@subh:~/subh/droidbox/android-sdk-linux/platform-tools$ ./adb -s emulator-5554 install /home/subh/subh/androidapp/HelloAndroid/bin/HelloAndroid-release-unsigned.apk 
11 KB/s (2919 bytes in 0.245s)
pkg: /data/local/tmp/HelloAndroid-release-unsigned.apk
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]

然后我用jarsigner签署了.apk

subh@subh:~/subh/androidapp/HelloAndroid/bin$ jarsigner -verify -verbose -certs HelloAndroid-release-unsigned.apk

  s = signature was verified 
  m = entry is listed in manifest
  k = at least one certificate was found in keystore
  i = at least one certificate was found in identity scope

no manifest.
jar is unsigned. (signatures missing or not parsable)
subh@subh:~/subh/androidapp/HelloAndroid/bin$ 

但我仍然有证书问题。

第二个命令似乎给出了错误。 您可以尝试在Eclipse中清理项目并创建新的APK吗?

我得到了答案.apk需要签名才能发布。 对于ant,我们有两种模式:debug和release。

# ant debug

这将自动生成密钥对,并为调试目的为我们签名了.apk。

#ant release

这将需要在build.xml中指定密钥库。 有关更多详细信息,请访问http://developer.android.com/guide/developing/building/building-cmdline.html http://developer.android.com/guide/publishing/app-signing.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM