ActivityNotFoundException in library projecy while the Activity is there and is declared in Manifest

I am trying to use this library. But the library project as well as the demo project on the github page is for Android Studio, but for some reason I use Eclipse. So I added the library and the demo project to Eclipse (see below for how I did that) and uploaded them here:

So what I did was that I created a new library project in Eclipse and copied all the files from the github library project. Following screenshot shows my project structure:

I added this library project to my demo project just like we add the app_compat v7 project.

enter image description here

Then I went on the create a demo project in Eclipse and copied all the files and resources from the demo project in their github repository.

But when I run it, it gives me android.content.ActivityNotFoundException: Unable to find explicit activity class {br.com.edsilfer/br.com.customsearchable.SearchActivity}; have you declared this activity in your AndroidManifest.xml?

Following are the Logcat of the demo project, and the manifest of the library project:

FROM LOGCAT OF DEMO PROJECT:

08-22 02:53:26.110: E/AndroidRuntime(2405): FATAL EXCEPTION: main
08-22 02:53:26.110: E/AndroidRuntime(2405): Process: br.com.edsilfer, PID: 2405
08-22 02:53:26.110: E/AndroidRuntime(2405): android.content.ActivityNotFoundException: Unable to find explicit activity class {br.com.edsilfer/br.com.customsearchable.SearchActivity}; have you declared this activity in your AndroidManifest.xml?
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1777)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1501)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.app.Activity.startActivityForResult(Activity.java:3745)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.app.Activity.startActivityForResult(Activity.java:3706)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:820)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.app.Activity.startActivity(Activity.java:4016)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.app.Activity.startActivity(Activity.java:3984)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at br.com.edsilfer.Main.onOptionsItemSelected(Main.java:82)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.app.Activity.onMenuItemSelected(Activity.java:2885)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:353)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.support.v7.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:144)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.support.v7.internal.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:99)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.support.v7.app.AppCompatDelegateImplV7.onMenuItemSelected(AppCompatDelegateImplV7.java:541)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.support.v7.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:811)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.support.v7.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:153)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.support.v7.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:958)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.support.v7.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:948)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.support.v7.widget.ActionMenuView.invokeItem(ActionMenuView.java:598)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.support.v7.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:139)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.view.View.performClick(View.java:4780)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.view.View$PerformClick.run(View.java:19866)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.os.Handler.handleCallback(Handler.java:739)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.os.Handler.dispatchMessage(Handler.java:95)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.os.Looper.loop(Looper.java:135)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at android.app.ActivityThread.main(ActivityThread.java:5254)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at java.lang.reflect.Method.invoke(Native Method)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at java.lang.reflect.Method.invoke(Method.java:372)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
08-22 02:53:26.110: E/AndroidRuntime(2405):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

MANIFEST OF LIB PROJECT:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="br.com.customsearchable">

    <uses-sdk
        android:minSdkVersion="22"
        android:targetSdkVersion="22" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name">
        <activity android:name="br.com.customsearchable.SearchActivity"
                  android:launchMode="singleTop"
                  android:windowSoftInputMode="adjustResize|stateVisible"
                  android:theme="@style/Theme.AppCompat.Translucent" >
        </activity>
    </application>
</manifest>


Source: eclipse

Leave a Reply