简体   繁体   English

Android Eclipse-找不到* .apk

[英]Android Eclipse - Could not find *.apk

I know this question has been asked before and I have seen a plethora of solutions out there, yet none seem to work for me. 我知道这个问题以前曾被问过,我已经看到了很多解决方案,但似乎没有一个对我有用。 I was able to build my apk without issues until this error started cropping up. 在此错误开始出现之前,我能够毫无问题地构建我的apk。 I have tried cleaning my project, removing it from the workspace and reimporting it, removing "Java Builder" from my Builders for the project, building the project manually, reordering my java build path. 我尝试清理我的项目,将其从工作空间中删除并重新导入,从我的Builders中删除该项目的“ Java Builder”,手动构建项目,重新排序Java构建路径。 I have no visible compiler issues and no problems exist in my workspace. 我没有可见的编译器问题,而且我的工作区中没有问题。

I did experience this issue before and solved it once by removing the project form my workspace and re-importing it and another time I solved it by removing "Java Builder" from my java build path. 我之前确实曾遇到过此问题,并通过从我的工作空间中删除项目并重新导入来解决了该问题,而另一次我是通过从Java构建路径中删除“ Java Builder”来解决的。 None seem to work this time. 这次似乎没有任何工作。 I currently have most of the settings set back to default (ie java build is checked again). 我目前将大多数设置恢复为默认设置(即再次检查Java构建)。

I am running windows 7 (64 bit) and using jdk1.6.0_21 via Eclipse 3.6. 我正在运行Windows 7(64位),并通过Eclipse 3.6使用jdk1.6.0_21。

Any suggestions would be greatly appreciated as I have lost loads of development time troubleshooting this already. 任何建议将不胜感激,因为我已经浪费了开发时间来解决此问题。

[Update] My locale is English & I have tried removing the debug.keystore, United States as related to issue 834 [更新]我的语言环境是英语,并且我尝试删除与问题834相关的美国debug.keystore

Please follow these steps; 请按照以下步骤操作; this might help you out: 这可能会帮助您:

  1. Right-click your app project and go to Properties 右键单击您的应用程序项目,然后转到“属性”

  2. Select Android from left-hand side list 从左侧列表中选择Android

  3. Uncheck the "Is Library" checkbox 取消选中“是库”复选框

If your app project relies on library projects which are in your workspace, those of course need to have the "Is Library" box checked. 如果您的应用程序项目依赖于工作空间中的库项目,那么那些项目当然需要选中“是库”框。

删除/ Gen文件夹中的R.Java文件对我有用

I tried all the above solutions. 我尝试了上述所有解决方案。 but it didn't work. 但这没用。

The solution was to restart eclipse !!!!!!! 解决方法是重新启动eclipse !!!!!!!

hope this will help someone :) 希望这会帮助某人:)

In my case this problem started after eclipse updated the plugin with the v4.0 API release. 就我而言,这个问题是在eclipse使用v4.0 API版本更新插件后开始的。 I fixed it by going to the main preferences for Eclipse and under Android->Build uncheck 'Skip packaging and dexing until export or launch' 我通过转到Eclipse的主要首选项并在Android-> Build下取消选中“跳过打包和解密,直到导出或启动”来修复它。

Note: if you eclipse gives you the Unknown Command 'crunch' error then follow this post 注意:如果日食给您带来Unknown Command'crunch'错误,请关注此帖子

I've tried to gather the best of other peoples answers into a step by step list of things to try in order: 我尝试将其他人的最佳答案收集到逐步尝试的清单中:

  • Check the project is not set as a library: 检查项目未设置为库:
    1. Go to Project->Properties 转到项目->属性
    2. Select Android from left-hand side list 从左侧列表中选择Android
    3. Uncheck the "Is Library" checkbox 取消选中“是库”复选框
  • Clean and rebuild the project - this should delete and recreate the entire gen folder, including the R.java file mentioned in some peoples answers 清理并重建项目-这应该删除并重建整个gen文件夹,包括某些人的答案中提到的R.java文件
  • Check eclipse and all the Android plugins are up to date 检查eclipse,所有Android插件都是最新的
  • Close the project, exit Eclipse, reopen eclipse, reopen the project. 关闭项目,退出Eclipse,重新打开Eclipse,重新打开项目。
  • Go to Java Build Path > Projects and check for any incorrect project dependencies 转到Java构建路径>项目,然后检查是否有任何不正确的项目依赖项
  • Go to the main preferences for Eclipse and under Android->Build uncheck 'Skip packaging and dexing until export or launch' 转到Eclipse的主要首选项,然后在Android-> Build下取消选中“跳过打包和解密,直到导出或启动”
  • Check JAVA_HOME is set correctly. 检查JAVA_HOME是否设置正确。 Follow the steps in this article 请按照本文中的步骤

If you complete the above list, and still haven't solved the issue, please leave a comment, or if you find something else that works, feel free to edit the answer and add your thing in. 如果您完成以上列表,但仍未解决问题,请发表评论,或者,如果发现其他可行的方法,请随时编辑答案并添加内容。

Delete the project from your workspace & import again. 从工作空间中删除项目,然后再次导入。
This worked for me. 这对我有用。

Can't believe similar issue has been there since 2008. 自2008年以来一直无法相信存在类似的问题。
http://code.google.com/p/android/issues/detail?id=834 . http://code.google.com/p/android/issues/detail?id=834

I was having the same issue as the OP except that all these suggestions did not work. 除了所有这些建议均不起作用外,我与OP存在相同的问题。 I found a solution for me. 我为我找到了解决方案。

Make sure that "Skip packaging and dexing until export or launch." 请确保“跳过包装和异化操作,直到导出或启动。” is selected. 被选中。

Go to Window -> Preferences -> Android -> Build. 转到窗口->首选项-> Android->构建。 Just make sure that option is selected and apply. 只要确保选择了该选项并应用即可。

I know this does not make a lot of sense, but having it unselected was giving me this error and with it selected it goes away and the apk is installed. 我知道这没有什么意义,但是不选择它会给我这个错误,选择它会消失并安装了apk。


I am using the auto generated ant build script from android and ONLY using it as my build process in eclipse. 我正在使用从android自动生成的ant构建脚本,并且仅将其用作我在Eclipse中的构建过程。 I am not using any other build methods. 我没有使用任何其他构建方法。

i'm no expert, but eclipse on Windows, doing android apps, refuses to create the default.properties file (in the app root directory). 我不是专家,但是在Windows上运行android应用程序时,Eclipse拒绝创建default.properties文件(在应用程序根目录中)。 I've just copied one from another app and it works fine. 我刚刚从另一个应用程序复制了一个文件,效果很好。 Simple contents, for Android 2.2 project it just says (ignoring comments): 简单的内容,对于Android 2.2项目,它只是说(忽略注释):

target=android-8 target = android-8

fwiw wi

以“管理员”身份运行Eclipse,然后导入项目。

None of these things worked for me. 这些东西都不适合我。 I'm trying to access native code through the jni, first with NDK samples. 我想先通过jni访问NDK示例的本机代码。 What I found was the build won't run if jarlist.cache is not present in the project bin directory. 我发现的是,如果项目bin目录中不存在jarlist.cache,则构建将无法运行。 If I copy one from another project to that location (may need to refresh to see the folder in Eclipse), build works every time. 如果我将一个项目从另一个项目复制到该位置(可能需要刷新才能在Eclipse中查看该文件夹),则每次都可以进行构建。

Clean the project and it will do. 清理项目,它将完成。 Sometimes it happens unknowingly but keep trying to solve using diff methods. 有时它会在不知不觉中发生,但会继续尝试使用diff方法来解决。

我以某种方式将Run配置为Java应用程序而不是Android。

I figured it out. 我想到了。 I was referencing JavaSE-1.5 and using JDK 1.6. 我正在引用JavaSE-1.5并使用JDK 1.6。 I changed it to use 1.6 and that appears to fix it. 我将其更改为使用1.6,似乎可以解决该问题。

Seems like through my research that is an overloaded error message that covers a lot of error cases. 通过我的研究,似乎是一条过载的错误消息,其中包含很多错误案例。

I just fixed this by reselecting a default JRE for the execution environment (JRE6 for JavaSE-1.6 in my case). 我只是通过为执行环境重新选择默认的JRE(在我的情况下为JavaSE-1.6为JRE6)来解决此问题。 It got unchecked for some reason. 由于某种原因,它未被检查。

This fixed my problem. 这解决了我的问题。 I kept getting the console error in eclipse "Could not find com_android_vending_licensing.apk" and even though it didnt seem to effect the way my app ran, it was annoying. 我在eclipse中始终遇到控制台错误“找不到com_android_vending_licensing.apk”,即使它似乎并没有影响我的应用程序的运行方式,也很烦人。 So going into the com_android_vending_licensing project properties and unchecking the "is library" option, building the project to produce the needed apk and then going back into the com_android_vending_licensing project properties and re checking the "is library" check box fixed the problem. 因此,进入com_android_vending_licensing项目属性,然后取消选中“ is library”选项,构建项目以生成所需的apk,然后返回到com_android_vending_licensing项目属性,然后重新检查“ is library”复选框,即可解决此问题。

SHA1's answer did it for me: after updating to the latest sdk/adt, my project refused to build an apk; SHA1的答案对我有用:更新到最新的sdk / adt之后,我的项目拒绝构建apk。 unchecking the option resolved the issue. 取消选中该选项即可解决此问题。

I don't know if the update checked this, or if it was checked before but the new adt screwed things up, but things work again now :) 我不知道更新是否检查过,或者以前是否检查过,但是新的adt搞砸了,但是现在事情又恢复了:)

In my case this worked : 就我而言,这可行:

Delete R.Java file in /Gen folder 删除/ Gen文件夹中的R.Java文件

+ +

Delete all "R.Android" imports that Eclipse added to some of my java classes !!! 删除Eclipse添加到我的某些Java类中的所有“ R.Android”导入

and rebuild the project. 并重建项目。

删除-R.java-清理项目并再次运行..这对我有用..

Find the project's folder in your system, enter it's Properties via context menu and deselect "Read only" option. 在您的系统中找到项目的文件夹,通过快捷菜单输入其属性,然后取消选择“只读”选项。 Worked in my case. 就我而言。

This seems to be the source of the problem in many cases, moreover some solutions up there base on copying/rewriting the files in the project what makes them non-read-only. 在许多情况下,这似乎是问题的根源,此外,那里的一些解决方案基于复制/重写项目中的文件,这使它们成为非只读文件。

This is caused by JAVA_HOME not being set correctly. 这是由于未正确设置JAVA_HOME引起的。 It can be easily resolved by following the steps in this article . 可以按照本文中的步骤轻松解决。

Mine was caused by this problem (incompatibility between ADT and SDK), and was fixed thus: 矿山是由这个问题(ADT和SDK之间的不兼容)引起的,因此已得到修复:

  • Eclipse > Help Eclipse>帮助
  • Install New Software 安装新软件
  • Add ' https://dl-ssl.google.com/android/eclipse/ ' to 'Work With' section and press enter 将“ https://dl-ssl.google.com/android/eclipse/ ”添加到“使用”部分,然后按Enter
  • After developer tools appears on the list, check it and click Next 在列表中显示开发人员工具后,对其进行检查并单击“下一步”。
  • Restart eclipse once download is finished 下载完成后重新启动Eclipse

I my case, I had to switch from API 21 to API 19, clean and build and everything was fine again. 就我而言,我必须从API 21切换到API 19,进行清理和构建,一切都恢复正常。 I am using a Mac and apparently API 21 is not fully supported on Yosemite. 我使用的是Mac,显然优胜美地不完全支持API 21。

对我来说,问题是我试图使用IBM RAD似乎无法正常工作,我安装了Eclipse,现在遇到了另一个错误,但是我应该可以克服它

On my machine (Windows7, 64bit) I could fix this by setting my execution environment to a 32bit variant of the jdk (I used 1.6.0_23). 在我的机器(Windows7,64位)上,我可以通过将执行环境设置为jdk的32位变体(我使用1.6.0_23)来解决此问题。 And I tried a lot of things before... 我之前尝试了很多东西

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

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