简体   繁体   English

Android共享库未运行

[英]Android Shared Library not Running

Okay I have a project that is using the android-rss library (org.mcsoxford.rss). 好的,我有一个使用android-rss库(org.mcsoxford.rss)的项目。 I created a separate library project for the android-rss. 我为android-rss创建了一个单独的库项目。 When I try to run my project I get an error saying that the launch was canceled. 当我尝试运行我的项目时,出现错误消息,提示启动已取消。 "Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY". “安装错误:INSTALL_FAILED_MISSING_SHARED_LIBRARY”。 I went through the tutorial on Android on how to reference the library eclipse project. 我遍历了Android上有关如何引用库Eclipse项目的教程。 I have everything setup right. 我一切设置正确。 I also put in the xml file a uses-library. 我还在xml文件中添加了一个uses-library。 Not sure what the problem is. 不确定是什么问题。 Here is my the uses in the Android-Manifest.xml 这是我在Android-Manifest.xml中的用途

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
 ... 
 <uses-library android:required="true" android:name="org.mcsoxford.rss"></uses-library>
...
</manifest>

And I have it referenced in the ANdroid Library. 我在ANdroid库中引用了它。 I can build the project and see the reference to the library in the project. 我可以构建项目,并查看对项目中库的引用。 No errors nothing. 没有错误就没有。 The reference lib is exported too. 参考库也被导出。

Here are my console output errors: 这是我的控制台输出错误:

[2011-04-18 11:46:43 - BOTM] Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY [2011-04-18 11:46:43 - BOTM] Please check logcat output for more details. [2011-04-18 11:46:43-BOTM]安装错误:INSTALL_FAILED_MISSING_SHARED_LIBRARY [2011-04-18 11:46:43-BOTM]请检查logcat输出以获取更多详细信息。
[2011-04-18 11:46:44 - BOTM] Launch canceled! [2011-04-18 11:46:44-BOTM]启动已取消!

While installing the application on to the device, PackageManager checks for the shared libraries that are been used by the application. 在将应用程序安装到设备上时,PackageManager会检查该应用程序使用的共享库。 If the shared libraries are missing on the target device, it will not allow user to install the application on that device. 如果目标设备上缺少共享库,则它将不允许用户在该设备上安装应用程序。

So, basically the library "org.mcsoxford.rss" is missing from the device on which you are trying to install your application. 因此,基本上,试图安装应用程序的设备都缺少“ org.mcsoxford.rss”库。 In order to over come this installation issue, you can make the following change on the manifest file: 为了解决此安装问题,您可以对清单文件进行以下更改:

android:required="**false**"

The above field states that you application will still work with out the library that has been mentioned on the uses-library tag. 上面的字段表明您的应用程序仍然可以使用uses-library标记中提到的库。 This will allow the application to be installed on the device, even if the shared library is missing. 即使缺少共享库,也可以将应用程序安装在设备上。

Did you mention in the application launcher activity in the manifest file as follows, 您是否在清单文件的应用程序启动器活动中提到了以下内容,

  <application>
<activity android:name=".LoginScreen"
              android:label="@string/app_name"
              android:screenOrientation="portrait">
        <intent-filter>
              <action android:name="android.intent.action.MAIN" />
              <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

Here Login screen is my main activity to launch as soon as app starts. 登录屏幕是我在应用启动后立即启动的主要活动。

I haven't check that yet, but maybe it will help. 我还没有检查,但也许会有所帮助。 Please download android-rss from: https://github.com/ahorn/android-rss and look into README file. 请从以下网址下载android-rss: https//github.com/ahorn/android-rss并查看README文件。

That part may be useful: "To reference this library project from within your Android application, navigate to the /tools/ directory and use the following command: 该部分可能有用:“要从您的Android应用程序中引用此库项目,请导航至/ tools /目录并使用以下命令:

android update project \\ --target \\ --path path/to/your/project \\ --library path/to/android-rss android更新项目\\ --target \\ --path path / to / your / project \\ --library path / to / android-rss

This command appends to the "default.properties" file in your Android project a new "android.library.reference" property. 此命令将新的“ android.library.reference”属性附加到Android项目中的“ default.properties”文件。 The value of this new property should be the relative path to the directory which you created when you fetched the Android RSS library source code with Git. 这个新属性的值应该是您使用Git提取Android RSS库源代码时创建的目录的相对路径。

The library is compiled by the Android build framework when you build your mobile app which was specified in the --path argument above." 当您在上面的--path参数中指定构建移动应用程序时,该库由Android构建框架编译。”

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

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