Android 从 Eclipse (ADT) 导出 APK 静默崩溃
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11752270/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Exporting APK from eclipse (ADT) silently crashes
提问by whalabi
Every time I try to export an APK from Eclipse (tried Juno and Indigo) on Mac, eclipse crashes after a few seconds
每次我尝试在 Mac 上从 Eclipse(尝试过 Juno 和 Indigo)导出 APK 时,Eclipse 会在几秒钟后崩溃
This used to work fine on my current setup.
这曾经在我当前的设置上运行良好。
Running the app straight (debug mode) on my phone works fine.
在我的手机上直接运行应用程序(调试模式)工作正常。
The error from the console is:
来自控制台的错误是:
Invalid memory access of location 0x10073f113 rip=0x101f656f7
Bus error: 10
I'm using Mac OS X 10.7.4 on a ~2010 MacBook Pro, with the following java:
我在 ~2010 MacBook Pro 上使用 Mac OS X 10.7.4,具有以下 java:
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)
I'm using ADT 20.
我正在使用 ADT 20。
I've tried reinstalling Eclipse and the Android SDK, and re-downloading ADT.
我尝试重新安装 Eclipse 和 Android SDK,并重新下载 ADT。
The Eclipse error view doesn't show anything
Eclipse 错误视图不显示任何内容
Any ideas of different methods I can try, or other ways to investigate what's going wrong?
我可以尝试不同方法的任何想法,或其他方法来调查出了什么问题?
Cheers
干杯
Update: For anyone coming along post-2014, you should be using Android Studio, which doesn't have this problem.
更新:对于 2014 年之后的任何人,您应该使用Android Studio,它没有这个问题。
回答by jmarranz
Disable Project/Build Automatically when you are exporting
导出时自动禁用项目/构建
I think is a problem of Eclipse unable to detect the Android command is still working or something similar.
我认为是 Eclipse 无法检测到 Android 命令是否仍在工作或类似的问题。
Of course there is ever the option of APK generation using Ant outside Eclipse you can generate an Ant build.xml from your Eclipse project more info in official Android docs
当然,可以选择在 Eclipse 之外使用 Ant 生成 APK,您可以从 Eclipse 项目生成 Ant build.xml 官方 Android 文档中的更多信息
回答by wangzhengyi
Disable Project->Build Automatically
. I've noted that this works for me.
禁用Project->Build Automatically
。我注意到这对我有用。
回答by Luna Kong
Disable project/build Automatically before export the apk.
在导出 apk 之前自动禁用项目/构建。
回答by Siddharth
I used the disable Build Automatically
for months now, until I realized that AWS plugins were slowing down the entire launch process. I uninstalled all AWS plugins from Help->InstallationDetailsand everything now works perfectly as before. I do not need to disable Build Automatically
any more.
我使用了disable Build Automatically
几个月,直到我意识到 AWS 插件正在减慢整个启动过程。我从Help->InstallationDetails卸载了所有 AWS 插件,现在一切都像以前一样完美。我不需要再禁用Build Automatically
了。
回答by san
回答by Raúl Contreras
project/ clean
worked for me. I think it could be related to the building of the project, as other users have posted.
project/ clean
为我工作。我认为这可能与项目的构建有关,正如其他用户所发布的那样。
回答by Toni Gamez
The problem has gone until I have update ADT and Eclipse. I don't know which one solve the issue. Now it's working smoothly for severeal signed export, with:
在我更新 ADT 和 Eclipse 之前,问题一直存在。不知道哪一个能解决问题。现在它可以顺利用于严重签名的导出,具有:
- ADT Version: 22.2.1.v201309180102-833290
- Eclipse Juno Service Release 2 Build id: 20130225-0426
- Gentoo Linux running Java 1.7.0_45-b18.
- ADT版本:22.2.1.v201309180102-833290
- Eclipse Juno 服务第 2 版构建 ID:20130225-0426
- 运行 Java 1.7.0_45-b18 的 Gentoo Linux。
UPDATE: Few exports after, I still get crashes from time to time, but no very frequently.
更新:之后很少导出,我仍然不时崩溃,但不是很频繁。
回答by SadieYu
may be you should try to add execute authority . you can try something like this
可能是你应该尝试添加执行权限。你可以试试这样的
first close auto-build
首先关闭自动构建
cd /home/your name/android-dev/sdk/tools/
cd /home/你的名字/android-dev/sdk/tools/
sudo chmod +x zipalign
须藤 chmod +x zipalign
done and good luck to you
完成,祝你好运