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!
<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
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.
creat a libs folder inside the res folder and put the AndEngine jars in it.set the class path of jar.
Related
I am currently working on a Xamarin.Forms application that uses native barcode scanning capabilities of the mobile device. I have integrated two different device SDKS from different manufacturers (Casio & Denso).
The main launcer is SplashActivity, which shows the splash screen, detects device info and launces one of the following:
CasioActivity
DensoActivity
These activities are responsible for subscribing to scan events raised by corresponding device.
Denso integration is done with a DLL file supplied by the manufacturer, while Casio integration is done through a Xamarin Bindings project, following this tutorial.
Deployment to Casio works fine but when I deploy the application on the Denso unit, I get the following error message in Visual Studio:
install_failed_missing_shared_library device.sdk is required
I believe that the Casio SDK (*.aar file) is forcing that the app runs only on Casio devices. I tried adding the following to the application manifest:
<uses-library android:name="device.sdk" android:required="false" />
and also tried adding the UsesLibrary attribute to all activities to make device.sdk optional but none worked. It appears that the bindings project is injecting the following to the manifest file on deployment:
<uses-library android:name="device.sdk" android:required="true" />
Is there any way to prevent the injection of the above line into the manifest file?
I would like to make the application compatible with both of these units.
I solved this by modifying the aar file.
Use 7zip to extract the aar file to a folder
Find the application manifest in the extracted folder
Set android:required attribute to false.
Zip the folder again
Change the file extension from .zip to .aar
Put the new file under Jars folder as shown here
I've looked through my whole project directory, and for the life of me, I cannot find where it would think it is an Android Auto. Going through this page:
https://developer.android.com/training/auto/start/index.html#auto-metadata
Nowhere in my Android manifest, do I set an automotive.
Could a library add to the manifest to make it an Automotive app?
Are there other things in the manifest I can check?
Please cross check in your res/xml file and see if you have any media or notification
under - uses element.
You can also check in your manifest file if you have added Car GMS package in the meta-data element.
<meta-data
android:name="com.google.android.gms.car.application"
android:resource="#xml/your_auto_xml_file"
/>
If the library you are importing in happens to be from the merchant who builds up the customized DHU, then these lib can infuse those properties in your project. One easy way would be to remove the library and see if it resolves the issue.
I am looking to use the android sample project 'Bluetooth chat' as a library so that I can use it inside another application.
I have marked the project as a library in its properties and I have referenced the project in my application. I understand I need to update my applications manifest file, however I am totally lost as to what needs to be added/changed(I am a total beginner).
I am just looking to launch the sample from the click of a button within my application.
I have read the documentation about referencing but I am still pretty confused. Any guidance would be much appreciated!
if you access your project you enter your manifest file for entry lie that
<activity
android:name="<Package name>.<java file name>"
/>
Make Sure your lib and your project in same folder.
I am using a a project of Combination of NDK and android that is related to augmented Reality
I want to and this project in another project.
I have read posts on different Question regarding this issue but they all are explicitly related to google map api.
I've made the other project as a library and now using it in my new project.
I've added permission in Manifest file.
Here are is the specific part of it.
<uses-library android:required="true" android:name="com.qualcomm.QCARSamples.VirtualButtons" />
<activity android:name="com.qualcomm.QCARSamples.VirtualButtons.VirtualButtons"
android:label="#string/title_activity_putit_out_demos" />
so if any body can guide me where i am wrong
The only thing suspicious I see is the uses-library tag, do you have the lib in your device/emulator? If yes then you should have the following files in it,
/system/etc/permissions/com.qualcomm.QCARSamples.VirtualButtons.xml
/system/framework/com.qualcomm.QCARSamples.VirtualButtons.jar
Without the lib the apk installation will fail with INSTALL_FAILED_MISSING_SHARED_LIBRARY error.
i have figured it out with one simple way
follow the steps to get rid off this thing
right click on the Project you want to make library
go to
Properties->Android-> check is Library option (in right lower area)
click apply and then Ok
and go to main project in which you want to add it as library
right click on it go to properties-> android click on add button (right lower area) add the project
click apply and then ok
and in Manifest file
and the main class of the library project to triger its functionality
`<activity>your activity goes here </activity>`
No need to Add <uses-library> permission in manifest file
I am trying to integrate unity to eclipse (more precise unity with qualcomm to eclipse) for android development. I followed the steps from here probably 10 times already and still have some features not to be working (Camera issues).
I am building an app which combines unity with qualcomm. I need a simple android development environment as well, so my idea is to make a part of it in unity and port to eclipse for further development.
If I build and launch my app straight from Unity everything works well: ARCamera, simple Camera and all other features work as intended. If I export the program to eclipse and launch it from there I get a black window on ARCamera and blue window if I change the view to simple Camera.
Does anyone has a clue what am I doing wrong?
If I am using qualcomm in eclipse (no unity) everything works
If I am using qualcomm in unity (no eclipse) everything works
If I try to export qualcomm with unity to eclipse - camera doesn't work
I am using HTC Nexus One
Mindaugai, do you have permissions properly set in the Manifest after you export to Eclipse? I'm refering to these:
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" android:required="true" />
You might also need this one:
<uses-feature android:name="android.hardware.camera.front" android:required="true" />
If someone is still interested what was the problem, the links above are missing few things:
Add classes.jar, QCAR.jar, and QCARUnityPlayer.jar to your custom Android project.
Copy config.xml and qcar-resources.dat from the StagingArea/raw/QCAR folder to the new project's assets folder.
Copy the AndroidManifest.xml file from the StagingArea to your new project as well.
Instead of extending PlayerActivity in your class, extend QCARPlayerActivity
By doing those things I managed to get it work.
I used
*Unity v. 1.5
*Vuforia SDK 1.5.9
*Android SDK 4.0
and I made it working, so either, the integration has been fixed or my slightly different approach just worked.
Here are steps I did:
Follow the integration instruction from here
In the library project add QCAR.jar and QCARUnityPlayer.jar from ./plugins to the build path
Make sure that those libraries are exported by checking proper checkboxes in Project properties > Java build path > Order and Export
Copy AndroidManifest.xml from the lib project to your custom project
Modify AndroidManifest.xml to link to your custom Activity that extends QCARPlayerActivity
It should work now.
Tips&Hints
If you are getting an error that says: error: Error: String types not allowed (at 'configChanges' with value 'fontScale|keyboard|keyboardHidden|locale|mnc|
mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen').
just switch to higher SDK (I used 4.0 but 3.2 should work as well).