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
Related
I've been having this problem since upgrading to Android Studio 4.0 on macOS. When I try to start my app from Android Studio, I get the following error:
Could not identify launch activity: Default Activity not found
Error while Launching activity
What's a bit unique about my project is that the default activity is defined in the manifest of another library used by my project, not the project itself. This was all working fine before the upgrade, but now it isn't for me. When I open the project containing the dependency, it builds and runs fine. I've already tried the following steps:
clean the project, rebuild
invalidate caches and restart
reinstall Android Studio
delete all generated files and folders (build, gradle, .idea, etc)
You can solve the problem as follows:
Click your Module Selection window,then click Edit Configurations…
Then set Launch Options to Nothing; that's okay:
To dovetail off of Mike N.'s comment, it looks like it is an issue to be resolved in the next point release: https://issuetracker.google.com/issues/158019870
For the details of the quick fix, for me I looked at the Merged Manifest tab, which is at the bottom-left of the AndroidManifest.xml pane. This shows all of the library manifests combined with your activity's.
The dialog said an error occurred where browser:1.0.0 manifest had a minSdk of 15 whereas all the rest of my minSdk are 14. I clicked on:
use a compatible library with a minSdk of at most 14, or increase this
project's minSdk version to at least 15.
Which brought up my minSdk to 15, and the error with the launcher went away, it will now insta-launch on my device. So I would sit tight for AS 4.0.1 but in the meantime, check the Merged Manifest.
For me this was happening in a project in which the main activity was declared in the manifest of an imported module (e.g. not in "app" module).
The solution for me was to add again the activity declaration in the manifest file of my top project:
<activity android:name="com.cristian_slav.elements.MainActivity"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
On my side it was a issue with the manifest. You can detect this type of issue by watching the merged manifest tab. For more details you can watch the link shared by Mike N. in the first comment.
The problem will arise in new projects when one forgets to tick the default activity checkbox during adding anyone of the first or subsequent new activity.
This can be rectified at later stage by going to Run> Edit Configurations > Launch : in which change to specified activity and select the activity you choose to keep as the first page on launch of app.
Try these steps:
Close Android Studio
Go to
C:\Users\my_user_name.AndroidStudio4.0\system\caches
Delete "caches" folder
Relaunch Android Studio
set Launch Options to (Nothing)
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>
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
The task is very simple but I can't find any solution.
I have an application which is based on my Android Library Project.
Activities are not defined in my main app but in the library project.
Eclipse doesn't allow me reference my library project from the test project targeted to main app.
Is there a working example to see how it is done?
If you want to use activity from Library Project, and you already attached it as library to build path, than you need also to put targeted activity in android manifest.
<activity android:name="com.packageInWhichActivityIs.activityName"></activity>
I`m assuming that you are getting class not found exception. Next time please provide more specific information.
I am trying to fork my android app, and came upon a method thanks to my other question here using a library project. It is working fine enough for drawables and String assets. But now I've run into a problem.
I have a class (not an activity) which extends Application. I moved this class into my library project, and want to use it for the main application class in my two derived apps (works fine when directly in the main app).
Say my library is my.project.library and my app using the library is my.project
In the manifest for my.project I specified the following:
<application android:name="my.project.library.AppClass">
It compiles and deploys fine, but when I try to run it, it force-closes with the following exception:
11-15 03:14:25.707: E/AndroidRuntime(16800): java.lang.RuntimeException: Unable to instantiate application my.project.library.AppClass: java.lang.ClassNotFoundException: my.project.library.AppClass in loader dalvik.system.PathClassLoader[/data/app/my.project.apk]
From the drawables I also imported from the library, it seems that the library contents get in-lined into the main app. So I tried changing my manifest to:
<application android:name="my.project.AppClass">
but I still get the same error.
How can i reference a class in the library as my Application class in the main app?
Your original reference was correct.
That is:
<application android:name="my.project.library.AppClass">
Sounds like you not referencing the library project properly see http://developer.android.com/guide/developing/projects/projects-eclipse.html the Referencing a Library Project section.
I think you have not described the library that you are using in the manifest so you need to add something like this to the manifest.
<uses-library android:name="my.project.library" />