Failling to add library to android studio project - android

I want to add Github library to my project in android studio , and I tried more than 7 time . Every time I have problem. I don't know what can I do Please help me
This is the library.

The library you are using is using a value for android:icon in its manifest, and so are you. Since the compiler doesn't know which icon to use, this error is thrown. So in your manifest, add tools:replace="android:icon" to override the library's manifest like so:
<Application
tools:replace="android:icon"
... >
// Other elements here
</Application>

Related

Android Studio: The activity 'MainActivity' is not declared in AndroidManifest.xml

I know that there are some similiar questions to this one but I've tried the suggestions that I found in the asnwers but none of them worked for me so I decided to publish my version of the problem.
I'm using this android studio project https://github.com/rosjava/android_core that has multiples modules inside as you can see. I had another project that I had to import to this android_core one so I downgraded its graddle version, since the version was more updated, and added it as an imported module.
After I fixed some building problems I got the "Default Activity not found" error which seemed odd to me since I had an activity marked to be the default activity so either way I decided to add it here too:
The next warning is the one on the bottom of the image which, once again, sounds odd to me since I had everything declared in the oringal project's AndroidManifest.xml file it's exactly the same on this one:
I have tried re-building, Invalidating Cache/Restarting and deleting and re-extend the AppCompactActivity class but nothing seems to work.
What am I missing? Thanks in Advance!
In the root of the manifest xml should be a manifest node with an attribute package. Make sure that the package 'com.example.prj_' is the value.
Then in your activity node you only have to place the value '.MainActivity'. Otherwise you can get some build errors for the resources in the R class.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.prj_">
<application
...>
<activity
android:name=".MainActivity"
...
</activity>
</application>
</manifest>
Add .MainActivity to your Android Manifest file.
<application
...>
<activity
android:name=".MainActivity"
...
</activity>
</application>
There are apparently race conditions with background computation of the merged manifest vs. automatic checks of it. The workaround would be to open AndroidManifest.xml and click on Merged Manifest, this forces the merge. Then clicking Run should pass the automatic tests.
See also https://issuetracker.google.com/issues/158019870
There are some ways to clean a project for removing this error.
1- File-> Sync Project with Gradle Files
2- Files -> invalidate cache / Restart
3- android:name=".MainActivity" --> android:name="com.example.prj.MainActivity"

Library project activity not found error

I am working on a project , where i need to render pdf on my device screen.
For that i am using mupdf library.
I have included it in my project.
Now from library project , i need to use MuPDFActivity.class through intent for showing pdf.
But i am getting activitynotfound exception.
I have tried of including library's activity in my manifest.
<activity
android:name="com.example.xrgpc.mupdf.MuPDFActivity"
android:label="#string/app_name">
</activity>
But i am getting same error.
Will some one guide me what's i am doing wrong.
check your library minSdk, if your library minSdk smaller then app you can not declaring at AndroidManifest.xml
And change if you import appcompat Activity to AppCompatActivity

Android Studio inserting android:theme in Manifest file

I'm new to Android Studio (trying it out to compare with Eclipse) so following a tutorial. I added an android:theme to my manifest file
<activity
android:name="be.wotcha.myfirstapp.MainActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.AppCompat.Light" >
Now I'm trying to get rid of the android:theme so I edit the file and delete it, but every time I run Build/Clean Project Studio puts the android:theme back into the Manifest file and generates an error. Is there a simple way to stop Studio overwriting my edit? I'm using Studio 1.0.2 latest build
Well, if You dont set your theme, the Android will set the default one for You. So set another theme or leave it in peace. App need to have some theme. App.Compat.Light is apparently the default one.
EDIT: What error do You get?
Please check if you are changing the main AndroidManifest.xmlfile which is located under yourProjectName/src/main/AndroidManifest.xml

Android minimum sdk - Android Studio Issue

I'm a beginner in android and having some trouble with Android Studio.
I'm trying to set my minimumSDK version to 11 and have it set in AndroidManifest.xml,but keep getting errors saying it's still set to 8.
You set the minimum SDK in the build.gradle file in Android Studio. Be careful there are two similarly named files in your project. It should be the one located inside your module, not your root project folder.
Change your Android manifest.xml to:
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="xx" />
<application
...
/>
Clean the project
Restart the eclipse (If required)
Note: There will be 2 AndroidManifest.xml
1. Project/Bin/AndroidManifest.xml
2. Project/AndroidManifest.xml --> This is the one that has to be changed.
However, ensure that it is correct in both the AndroidManifest.xml

INSTALL_FAILED_MISSING_SHARED_LIBRARY Using NDK

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

Categories

Resources