Question

I have downloaded an android project from Github. https://github.com/lemonlabs/ExpandableButtonMenu

It is an ExpandableButtonMenu library.

There is a demo activity also provided for seeing it in action. But,whatever I tried, I dont seem to have got the app to run(it compiles, and crashes). I am using Eclipse Juno.

Here is Exactly what I have done:

  1. Extract the Download Zip.

  2. Go to File->import->Android->Existing Android Code into workspace

  3. Browse for the extracted folder.

  4. After that, TWO projects are visible for selection(one is the demo, and one is the library project)

  5. Select both

  6. Mark the library project as library from properties->islibrary

  7. Right Click on the demo project->properties->Android->Library->Add the library project from step 4.

    I also tried going to the build path of the demo project and adding the library project to the build path.

The code returns NO errors, and it compiles, but the app crashes with the following error:

>  05-04 10:28:15.264: E/AndroidRuntime(3639): FATAL EXCEPTION: main
> 05-04 10:28:15.264: E/AndroidRuntime(3639):
> java.lang.RuntimeException: Unable to instantiate activity
> ComponentInfo{lt.lemonlabs.android.samples.expandablebuttonmenu/lt.lemonlabs.android.samples.expandablebuttonmenu.DemoActivity}:
> java.lang.ClassNotFoundException:
> lt.lemonlabs.android.samples.expandablebuttonmenu.DemoActivity 05-04
> 10:28:15.264: E/AndroidRuntime(3639):     at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
> 05-04 10:28:15.264: E/AndroidRuntime(3639):   at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
> 05-04 10:28:15.264: E/AndroidRuntime(3639):   at
> android.app.ActivityThread.access$600(ActivityThread.java:123) 05-04
> 10:28:15.264: E/AndroidRuntime(3639):     at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
> 05-04 10:28:15.264: E/AndroidRuntime(3639):   at
> android.os.Handler.dispatchMessage(Handler.java:99) 05-04
> 10:28:15.264: E/AndroidRuntime(3639):     at
> android.os.Looper.loop(Looper.java:137) 05-04 10:28:15.264:
> E/AndroidRuntime(3639):   at
> android.app.ActivityThread.main(ActivityThread.java:4424) 05-04
> 10:28:15.264: E/AndroidRuntime(3639):     at
> java.lang.reflect.Method.invokeNative(Native Method) 05-04
> 10:28:15.264: E/AndroidRuntime(3639):     at
> java.lang.reflect.Method.invoke(Method.java:511) 05-04 10:28:15.264:
> E/AndroidRuntime(3639):   at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
> 05-04 10:28:15.264: E/AndroidRuntime(3639):   at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:592) 05-04
> 10:28:15.264: E/AndroidRuntime(3639):     at
> dalvik.system.NativeStart.main(Native Method) 05-04 10:28:15.264:
> E/AndroidRuntime(3639): Caused by: java.lang.ClassNotFoundException:
> lt.lemonlabs.android.samples.expandablebuttonmenu.DemoActivity 05-04
> 10:28:15.264: E/AndroidRuntime(3639):     at
> dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
> 05-04 10:28:15.264: E/AndroidRuntime(3639):   at
> java.lang.ClassLoader.loadClass(ClassLoader.java:501) 05-04
> 10:28:15.264: E/AndroidRuntime(3639):     at
> java.lang.ClassLoader.loadClass(ClassLoader.java:461) 05-04
> 10:28:15.264: E/AndroidRuntime(3639):     at
> android.app.Instrumentation.newActivity(Instrumentation.java:1025)
> 05-04 10:28:15.264: E/AndroidRuntime(3639):   at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)

Edit:: Java Build Path Screenshot: enter image description here

Was it helpful?

Solution

Seems to be a problem in java build path.

  1. Downloaded the zip file. Extracted.

  2. Imported both the projects to Eclipse. Made Main as Library project.

  3. Referenced Main and AppCompat

  4. Ran the project

There are no java files in the src folder

Copy the java files from the link for both the library project and the DemoActivity

or

The java files exist under the java folder. Copy the same to your source folder src/

Then download this

https://github.com/JakeWharton/NineOldAndroids

and reference the same in your main library project

enter image description here

You are done and can run the project

enter image description here

enter image description here

Finally

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top