更新时间:2022-10-23 18:57:11
我记得遇到类似驱使我坚果你一个问题。我也认为,取消勾选的项目是库复选框会解决这个问题,但实际上并非如此。
在很多失去小时,我随后找到了罪魁祸首:一个额外的,多余的,邪恶的,完全误导性和破坏性线项目的的.classpath
:
< classpathentry样=SRC路径=/ RogueProjLib/>
(我不知道它是如何悄悄的)
在我删除它,则在找不到RogueProjLib.apk!的走了,安装工程和运行正常,与在是库复选框选中
在此基础上,我会回答你的问题如下:
的.classpath
...是的,做检查是库 希望这有助于。
I built my app using a library project (that I also created, to be reused in other apps). It builds fine, but when I try to install & run it through Eclipse (Ctrl+F11), I get this red Could not find MyLib.apk! error line in my console:
Console output:
[2013-11-30 14:42:59 - MyApp] ------------------------------
[2013-11-30 14:42:59 - MyApp] Android Launch!
[2013-11-30 14:42:59 - MyApp] adb is running normally.
[2013-11-30 14:42:59 - MyApp] Performing com.sfinja.myapp.ActivitySubClass activity launch
[2013-11-30 14:42:59 - MyApp] Automatic Target Mode: using device '5752068FC64500EA'
[2013-11-30 14:43:00 - MyApp] Application already deployed. No need to reinstall.
[2013-11-30 14:43:00 - MyLib] Could not find MyLib.apk!
[2013-11-30 14:43:00 - MyApp] Starting activity com.sfinja.myapp.ActivitySubClass on device 5752068FC64500EA
[2013-11-30 14:43:00 - MyApp] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.sfinja.myapp/.ActivitySubClass }
So I searched SO and found this thread which solves the problem by simply unchecking the library project's Is Library
checkbox.
Sure enough, my Library Project (MyLib) had this checkbox checked so I unchecked it and I no longer receive this error in the console, but then I started getting runtime NullPointerExceptions.
This clearly suggests that I have a problem in my project setup/configuration (although it builds fine) but in order to find what it is, I believe I need to understand a bit more about this confusing checkbox:
Is Library
checkbox checked but none of them presents the problem exhibited by MyLib. So, to check or not to check "IsLibrary"?Is Library
checkbox be unchecked? Is that thread's correct answer from 2 years ago still valid?
I recall encountering a problem similar to yours that drove me nuts. I also thought that unchecking the projects Is Library checkbox would solve the problem but in actuality it didn't.
After lots of lost hours I then found the culprit: An extra, redundant, wicked and totally misleading and destructive line in the project's .classpath
:
<classpathentry kind="src" path="/RogueProjLib"/>
(I had no idea how it snuck in)
Once I removed it, the the "Could not find RogueProjLib.apk!" went away and project installed and ran fine, with the Is Library checkbox checked!
Based on that, I would answer your questions as follows:
.classpath
... Yes, do check Is Library.Hope this helps.