Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8696983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:24:11+00:00 2026-06-13T01:24:11+00:00

I have library project and regular android project which uses it. Library project: src

  • 0

I have library project and regular android project which uses it.

Library project:

src folder package com.myproject

MainActivity
ChildActivity

AndroidManifest.xml

 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.project.library">
        <uses-sdk android:minSdkVersion="8" />
        <application>
            <activity android:name="com.myproject.MainActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name="com.myproject.ChildActivity">
            </activity>
        </application>
 </manifest>

Standalone project(is an Android project and uses library project):

src folder package com.myproject

ChildActivity

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.project">
        <uses-sdk android:minSdkVersion="8" />
        <application>
            <activity android:name="com.myproject.MainActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name="com.myproject.ChildActivity">
            </activity>
        </application>
</manifest>

What I want to achieve:

ChildActivity from Android project should override ChildActivity from library project.

Compilation fails:

[2012-10-16 20:02:02 - Standalone] Dx 
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/myproject/ChildActivity;
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.command.dexer.Main.processClass(Main.java:486)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.command.dexer.Main.access$400(Main.java:67)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:135)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.command.dexer.Main.processOne(Main.java:418)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.dx.command.dexer.Main.run(Main.java:206)
[2012-10-16 20:02:02 - Standalone] Dx   at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
[2012-10-16 20:02:02 - Standalone] Dx   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[2012-10-16 20:02:02 - Standalone] Dx   at java.lang.reflect.Method.invoke(Method.java:597)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:180)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:703)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:577)
[2012-10-16 20:02:02 - Standalone] Dx   at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
[2012-10-16 20:02:02 - Standalone] Dx   at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[2012-10-16 20:02:02 - Standalone] Dx   at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
[2012-10-16 20:02:02 - Standalone] Dx   at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:321)
[2012-10-16 20:02:02 - Standalone] Dx   at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:396)
[2012-10-16 20:02:02 - Standalone] Dx   at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
[2012-10-16 20:02:02 - Standalone] Dx   at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
[2012-10-16 20:02:02 - Standalone] Dx   at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
[2012-10-16 20:02:02 - Standalone] Dx   at org.eclipse.core.internal.resources.Project.build(Project.java:124)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.ide.eclipse.adt.internal.project.ProjectHelper.doFullIncrementalDebugBuild(ProjectHelper.java:1000)
[2012-10-16 20:02:02 - Standalone] Dx   at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:147)
[2012-10-16 20:02:02 - Standalone] Dx   at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:855)
[2012-10-16 20:02:02 - Standalone] Dx   at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:704)
[2012-10-16 20:02:02 - Standalone] Dx   at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1047)
[2012-10-16 20:02:02 - Standalone] Dx   at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1251)
[2012-10-16 20:02:02 - Standalone] Dx   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
[2012-10-16 20:02:02 - Standalone] Dx 1 error; aborting
[2012-10-16 20:02:02 - Standalone] Conversion to Dalvik format failed with error 1

If I change src folder in Standalone project to com.myproject.standalone and change manifest entry to

<activity android:name="com.myproject.standalone.ChildActivity">

I got exception:

android.content.ActivityNotFoundException: Unable to find explicit activity class
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:24:13+00:00Added an answer on June 13, 2026 at 1:24 am

    You don’t need to declare an activity in both manifests. pick one and use it. I prefer using the app manifest for all activity declarations.

    Update: Also, a library project should NEVER EVER contain references to any project that references it. That is called circular dependency.

    Update: So your code is a little confusing, but it looks like you are declaring classes with the same fully qualified name in both the library and standalone projects. This won’t work. They need to have different qualified names. The qualified name is the full package and class name. Your AndroidManifest for the library declares the package as “com.myproject.library” but then declares 2 activities with the package “com.myproject”. If they are in the library project, change the qualified name to “com.myproject.library.ActivityName” or use the “.ActivityName” shorthand. If they are in the same package, they need to be in a different package.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The situation I have is that I have an Android Project (regular) which uses
I have a library project which includes a object (.o) file. I have the
I have created one library project in iphone and my images folder is present
I have a class library project which contains some content files configured with the
I have a library project which contains an abstract class, let's say ClassA .
I have a library project that uses a jar (httpmime-4.1.3.jar). I'd like to take
I have a library-only Android eclipse project (no main class, only library classes) that
I have library project which referred by many applications. Now I got a new
I have a library project that should be the base for several web applications.
We have a Library Project that we use for all our central reused code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.