开发者

Android Shared Library not Running

开发者 https://www.devze.com 2023-02-26 10:07 出处:网络
Okay I have a project that is using the android-rss library (org.mcsoxford.rss).I created a separate library project for the android-rss.When I try to run my project I get an error saying that the lau

Okay I have a project that is using the android-rss library (org.mcsoxford.rss). I created a separate library project for the 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". I went through the tutorial on Android on how to reference the library eclipse project. I have everything setup right. I also put in the xml file a uses-library. Not sure what the problem is. Here is my the uses in the 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. 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开发者_如何学Python 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:44 - BOTM] Launch canceled!


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.

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 update project \ --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. 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.

The library is compiled by the Android build framework when you build your mobile app which was specified in the --path argument above."


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.


While installing the application on to the device, PackageManager checks for the shared libraries that are been used by the application. 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. 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. This will allow the application to be installed on the device, even if the shared library is missing.

0

精彩评论

暂无评论...
验证码 换一张
取 消