I am totally confused by this error message: Android library projects cannot be launched.
I carefully checked the build path and library, everything is "OK". And there is no error in Problems view. However, when I tried to run my application as an Android project, it failed and showed this message.
already i have set library in properties check. my build Path also all are fine. when run my application error message is coming.In my application i have added Google play service library
please tell me any suggestions.
Just uncheck the Is library from project properties.
go to project property file and Remove this line -
android:library=true;
just remove your library file and then goto the --- project > property > android > remove library > add new library > apply ... then
Related
I am trying to use this ExtendedCalendarView from github: https://github.com/tyczj/ExtendedCalendarView but I am not clear on how to add this to my android studio project. I tried to create a libs folder in my project folder and then pulled to the libs folder. Then I tried to sync the project but it did not work.
As they not offer gradle support, you need to download their library, and import it in Android Studio.
Do to this :
Go to File -> Project Structure
Then click the green + icon on the upper-left of the new window that just popped.
Choose Phone and Tablet application, and "Import existing Eclipse ADT or Gradle project as a module".
Select the library folder (the ExtendedCalendarView folder containing the AndroidManifest.xml folder), click Ok Next and Finish.
Wait for gradle project to sync
Then click on your main project module (often called "app"), and click on the upper-RIGHT green + icon, choose module dependency and select the extendedCalendarView module we just created. Then click Ok.
Wait for gradle project to sync
And you're good to go, your library is imported.
But, the library does not compile, you will see this error :
Error:(11, 9) Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application#icon value=(#mipmap/ic_launcher) from AndroidManifest.xml:11:9
is also present at XXXXXXXXXXXXXX:extendedCalendarView:unspecified:13:9 value=(#drawable/ic_launcher)
Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:8:5 to override
To fix it :
Add xmlns:tools="http://schemas.android.com/tools" to your AndroidManifest file, in the manifest element, next to your existing xmlns:android="http://schemas.android.com/apk/res/android"
Then add tools:replace="android:icon,android:theme" to your < application > element as the error message suggest.
Now the project compiles correctly !
Please ask me if you need any explanation or help.
Try cloning the library onto your computer then adding it as a module in Android Studio. Once you have completed that go to project settings and add the module as a dependency.
I have installed Android V4.0 and V3.2 SDK in my machine, when i try to create a project in my eclips it says Manifest file not found.
Manifest file is not at all getting generated. Normal android projects are getting created properly but if i create a project by pointing to ABS lib, it fails..
I have tried almost all the possible steps like, setting compiler version to 1.6, restarting etc...i'm sure i have latest ADT..
Kindly help me, what is the reason causing the problem
Try to get from git: https://github.com/JakeWharton/ActionBarSherlock
File > Import > Projects from git > Clone > URI: https://github.com/JakeWharton/ActionBarSherlock.git > Next > Finish
You are probably giving eclipse the incorrect project source folder. Check out this tutorial to correctly install ActionBarSherlock
When I select the properties to my project then go to Android and add a new Library, the eclipse automatically create a Android Depencies that contains all my .jars.
It does not add the new project to the list of referenced packages. When I try to Run the application I got the error: Conversion to Dalvik format failed with error 1. When i realize I have the .jars that i added both in the Android Dependencies and my /gen.
When I delete de Android Depencies I got error in my classes, saying that i´m not referencing the specifics .jar... But I have them in my /gen past.
Any Ideia how to make the eclipse refer to just one .jar?
Library is a special android feature that allows you to use an apk or another android project where you would for example share some code. It's detailed here :
http://developer.android.com/guide/developing/projects/projects-eclipse.html
I think that what you want to achieve is just adding a jar as a dependency which can be done with Project > Properties > Java Build Path > Libraries Tabs > Add Jars / Add External Jars.
tl;dr :
Project > Properties > Java Build Path > Libraries != Project > Properties > Android > Library
I did these steps to make my app work with the lib-sources using adt 17
add "lib-sources-project" to workspace
import/general/existingProjectsIntoWorkspace
mark this "lib-sources-project" as android library
lib/Properties/Android/IsLibrary must be checked
Add lib to main app
app/buildpath/ConfigureBuildPath/Projects Add "lib-sources-project"
app/buildpath/ConfigureBuildPath/OrderAndExport set check for "lib-sources-project" so your lib will be included into the buildresult
app/Properties/Android/Library Add "lib-sources-project" to the list.
Note since adt 17 you can have resources in your "lib-sources-project". Android Lint will tell you what you have to change to make it work.
Hoever i haven't succeeded yet to include a jar with resources without adding "lib-sources-project" as described above.
Maybe somebode knows how to do this.
I want to use MoPub for putting ads in my Android app.
I have downloaded the required resources and set-up a library project (mopub-android-sdk) in Eclipse. Now I want to add this project as a library to my Android app. But when I try to do that it gives this error:
Are the mopub-android-sdk files in the same parent folder as your project? This seems like the same problem addressed in this question/answer:
In eclipse, unable to reference an android library project in another android project
Place the referencing project in the same physical folder and see if the error persists.
To get around this, don't set up the mopub-sdk as a library project.
You can simply import it as a standard project.
Go to File > Import >Existing Projects Into Workspace, find the right project and click finish.
Right click your actual project and then click Build Path. Go to Link Source and then select the location of the project you just imported.
That should resolve the issue for you without requiring you to build a JAR.
-Franklin
One of my menu items in my application simply tries to invoke another activity (that belongs to a different project in the same workspace):
myActivity.startActivity(new Intent(myActivity, com.bill.the.App.class));
But that immediately results in an exception at runtime:
E/AndroidRuntime(3847): java.lang.NoClassDefFoundError: com.bill.the.App
Why?
What am I missing?
(the project compiles and build just fine, it's only at run time that this error occurs)
It could be that the project or library containing com.bill.the.App is included in compilation search path, but not included in the resulting apk file (that is deployed to the device). If you include the project or library containing com.bill.the.App using a wrong way, this can happen. Make sure that you include it by using Android Library Project (project properties -> Android) or by including the jar file in the project properties -> Java Build Path -> Libraries.
Just Open your AndroidManiFest.xml, and write following line in it before the </application> tag.
<activity android:name=".App"/>
I had the same problem when importing an old Eclipse/ADT project (made of several projects AKA modules) to Android Studio (2021.3.1.17).
The solution was to right-click the app's module > Open Module Settings > Dependencies > (app's module) > + (Add Dependency) > 3 Module Dependency > Select the module/project that contains the missing class.
The activity may not be registered in the manifest