简体   繁体   English

“Android库项目无法启动”?

[英]“Android library projects cannot be launched”?

Now I am totally confused by this error message: Android library projects cannot be launched. 现在我对此错误消息感到困惑: 无法启动Android库项目。

I carefully checked the build path and library, everything seems "OK", and there is no error on Problems view, however, when I tried to run my application as an Android project, it failed and showed that message. 我仔细检查了构建路径和库,一切似乎都没问题,并且在Problems视图上没有错误,但是,当我尝试将我的应用程序作为Android项目运行时,它失败并显示该消息。

Any explanation for why it's happening is appreciated! 任何关于它为什么发生的解释都表示赞赏!

From Android's Developer Documentation on Managing Projects from Eclipse with ADT: 来自Android的开发者文档,关于使用ADT从Eclipse管理项目:

Setting up a Library Project 建立图书馆计划

Next, set the project's Properties to indicate that it is a library project: 接下来,设置项目的属性以指示它是一个库项目:

  1. In the Package Explorer , right-click the library project and select Properties . 包资源管理器中 ,右键单击库项目,然后选择“ 属性”
  2. In the Properties window, select the "Android" properties group at left and locate the Library properties at right. 在“ 属性”窗口中,选择左侧的“Android”属性组,然后在右侧找到“ 库”属性。
  3. Select the "is Library" checkbox and click Apply . 选中“is Library”复选框,然后单击“ 应用”
  4. Click OK to close the Properties window. 单击“ 确定”关闭“ 属性”窗口。

So, open your project properties, un-select the "Is Library" checkbox, and click Apply to make your project a normal Android project (not a library project). 因此,打开项目属性,取消选中“Is Library”复选框,然后单击Apply以使项目成为普通的Android项目(而不是库项目)。

Through the this steps you can . 通过这些步骤,您可以。

  1. In Eclipse , Right Click on Project from Package Explorer . Eclipse中右键单击 Package Explorer中的 Project
  2. Select Properties ,. 选择属性 ,。
  3. Select Android from Properties pop up window, Properties弹出窗口中选择Android
  4. See " Is Library " check box, 请参阅“ 是库 ”复选框,
  5. If it is checked then Unchecked "Is Library" check box. 如果选中,选中库”复选框。
  6. Click Apply and than OK . 单击应用,然后单击确定

有了我,我在Eclipse>项目属性> Android下勾选了库,我刚才做的是取消选中勾选的库。

It says “Android library projects cannot be launched” because Android library projects cannot be launched. 它说“Android库项目无法启动”,因为Android库项目无法启动。 That simple. 那么简单。 You cannot run a library. 您无法运行库。 If you want to test a library, create an Android project that uses the library, and execute it. 如果要测试库,请创建一个使用该库的Android项目,然后执行它。

In Eclipse Project -> Clean Modify project.properties like this : 在Eclipse Project中 - > Clean修改project.properties,如下所示:

target=android-10
android.library.reference.1=F:/svn/WiEngine_library

our project surely is configured as "library" thats why you get the message : "Android library projects cannot be launched." 我们的项目肯定被配置为“库”,这就是为什么你会得到这样的信息:“Android库项目无法启动。”

right-click in your project and select Properties. 在项目中单击鼠标右键,然后选择“属性”。 In the Properties window -> "Android" -> uncheck the option "is Library" and apply -> Click "ok" to close the properties window. 在“属性”窗口 - >“Android” - >取消选中“是库”选项并应用 - >单击“确定”关闭属性窗口。

Through the following steps you can do it . 通过以下步骤,您可以执行此操作。

In Eclipse window , Right Click on your Project from Package Explorer. 在Eclipse窗口中,右键单击Package Explorer中的Project。 1. Select Properties, 2. Select Android from Properties, 3. Check "Is Library" check box, 4. If it is checked then Unchecked "Is Library" check box. 1.选择属性,2。从属性中选择Android,3。选中“Is Library”复选框,4。如果选中,则取消选中“Is Library”复选框。 5. Click Apply and than OK. 5.单击Apply,然后单击OK。

right-click in your project and select Properties. 在项目中单击鼠标右键,然后选择“属性”。 In the Properties window -> "Android" -> uncheck the option "is Library" and apply -> Click "ok" to close the properties window. 在“属性”窗口 - >“Android” - >取消选中“是库”选项并应用 - >单击“确定”关闭属性窗口。

This is the best answer to solve the problem 这是解决问题的最佳答案

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

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