gpt4 book ai didi

android - 如何为 Android ApkBuilder 设置调试证书

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:54:12 25 4
gpt4 key购买 nike

我正在尝试使用“ant”来构建我的 android 应用程序。但是在构建我的应用程序的调试版本时它失败了。这是错误:

BUILD FAILED
/Users/michael/Programs/android-sdk-mac_x86/tools/ant/main_rules.xml:506: The following error occurred while executing this line:
/Users/samuel/Programs/android-sdk-mac_x86/tools/ant/main_rules.xml:236: com.android.sdklib.build.ApkCreationException: Debug Certificate expired on 1/5/11 8:29 PM
at com.android.sdklib.build.ApkBuilder.getDebugKey(ApkBuilder.java:277)
at com.android.sdklib.build.ApkBuilder.<init>(ApkBuilder.java:384)
at com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:247)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)

您能告诉我如何才能获得有效的调试证书吗?

谢谢。

最佳答案

来自 Android - Signing Applications :

Expiry of the Debug Certificate

The self-signed certificate used to sign your application in debug mode (the default on Eclipse/ADT and Ant builds) will have an expiration date of 365 days from its creation date.

When the certificate expires, you will get a build error. On Ant builds, the error looks like this:

debug: 
[echo] Packaging bin/samples-debug.apk, and signing it with a debug key...
[exec] Debug Certificate expired on 8/4/08 3:43 PM

In Eclipse/ADT, you will see a similar error in the Android console.

To fix this problem, simply delete the debug.keystore file. The default storage location for AVDs is in ~/.android/ on OS X and Linux, in C:\Documents and
Settings\<user>\.android\
on Windows XP, and in C:\Users\<user>\.android\ on Windows Vista and Windows 7.

The next time you build, the build tools will regenerate a new keystore and debug key.

关于android - 如何为 Android ApkBuilder 设置调试证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5506757/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com