Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<uses-library /> in Android Manifest

I'm a newbie for Android and I need help regarding this issue. I am developing a game using Eclipse. In my project, I added AndEngine and AndEngine Augmented Reality as libraries. I was testing the project out in my Android device, every time I tap the text which uses the class of AR, it force close. I was told to register AndEngine in my Android Manifest file. I have checked about it and used <uses-library />. Now, I placed these two lines in my manifest:

<uses-library android:name="org.andengine.extension.augmentedreality" 
           android:required="true"/> 
       <uses-library android:name="org.andengine" 
            android:required="true"/>

but I get this error message: Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY

when I comment out those <uses-library /> lines, I can run the app but it force close when tapping the text that directs to the class of AR. Anything wrong in using it? Or any better way in doing it? Please post all your advises in an easy-to-understand-for-newbies way. THANK YOU!

like image 676
Monica Negapatan Avatar asked Sep 28 '12 18:09

Monica Negapatan


People also ask

What is use of native library?

<uses-native-library> Stay organized with collections Save and categorize content based on your preferences. description: Specifies a vendor-provided shared native library that the application must be linked against.

What is Android library module?

An Android library is structurally the same as an Android app module. It can include everything needed to build an app, including source code, resource files, and an Android manifest.


2 Answers

<uses-library> is not meant to include libraries in your application. It is used to restrict app availability in Google Play based on the availability of a library already on the device like maps. AndEngine is a library project so include it in your build via Ant, Maven or whatever IDE you use.

In case you aren't familiar with what a library project is here's a link:

https://www.vogella.com/tutorials/AndroidLibraryProjects/article.html

like image 167
JustinMorris Avatar answered Sep 19 '22 14:09

JustinMorris


If this element is present and its android:required attribute is set to true, the PackageManager framework won't let the user install the application unless the library is present on the user's device.

<uses-library> - specifies a shared library that the application must be linked against. This element tells the system to include the library's code in the class loader for the package.

like image 33
Jaydev Avatar answered Sep 20 '22 14:09

Jaydev