android - App Runs in Emulator but Gives NoClassDefFound Error When Trying to Run on Device -
i testing app first on android device (galaxy s3 mini) has been tested several times in emulator. app contains custom list view (dynamiclistview: http://www.youtube.com/watch?v=_bzivjmgh-q). code class demo app can found here http://developer.android.com/shareables/devbytes/listviewdragginganimation.zip
the extended listview class in same package main activity , added in main activity layout, after app installed , start logcat prints class cannot found. i've searched web , don't seem find solution or similar problem. feel stuck problem don't know how go fixing , appreciate offered.
the following logged on...
10-07 08:35:20.627: e/dalvikvm(16558): not find class 'com.amanda.tiara.dynamiclistview$2', referenced method com.amanda.tiara.dynamiclistview.<clinit>
followed later by... (take note of last 2 lines)
10-07 08:32:39.443: e/androidruntime(15341): fatal exception: main 10-07 08:32:39.443: e/androidruntime(15341): java.lang.exceptionininitializererror 10-07 08:32:39.443: e/androidruntime(15341): @ java.lang.class.getdeclaredconstructors(native method) 10-07 08:32:39.443: e/androidruntime(15341): @ java.lang.class.getconstructor(class.java:503) 10-07 08:32:39.443: e/androidruntime(15341): @ android.view.layoutinflater.createview(layoutinflater.java:511) 10-07 08:32:39.443: e/androidruntime(15341): @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:601) 10-07 08:32:39.443: e/androidruntime(15341): @ android.view.layoutinflater.rinflate(layoutinflater.java:654) 10-07 08:32:39.443: e/androidruntime(15341): @ android.view.layoutinflater.inflate(layoutinflater.java:439) 10-07 08:32:39.443: e/androidruntime(15341): @ android.view.layoutinflater.inflate(layoutinflater.java:351) 10-07 08:32:39.443: e/androidruntime(15341): @ android.view.layoutinflater.inflate(layoutinflater.java:307) 10-07 08:32:39.443: e/androidruntime(15341): @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:250) 10-07 08:32:39.443: e/androidruntime(15341): @ android.app.activity.setcontentview(activity.java:1694) 10-07 08:32:39.443: e/androidruntime(15341): @ com.amanda.tiara.mainactivity.oncreate(mainactivity.java:40) 10-07 08:32:39.443: e/androidruntime(15341): @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1082) 10-07 08:32:39.443: e/androidruntime(15341): @ android.app.activitythread.performlaunchactivity(activitythread.java:1699) 10-07 08:32:39.443: e/androidruntime(15341): @ android.app.activitythread.handlelaunchactivity(activitythread.java:1754) 10-07 08:32:39.443: e/androidruntime(15341): @ android.app.activitythread.access$1500(activitythread.java:156) 10-07 08:32:39.443: e/androidruntime(15341): @ android.app.activitythread$h.handlemessage(activitythread.java:1000) 10-07 08:32:39.443: e/androidruntime(15341): @ android.os.handler.dispatchmessage(handler.java:130) 10-07 08:32:39.443: e/androidruntime(15341): @ android.os.looper.loop(sourcefile:351) 10-07 08:32:39.443: e/androidruntime(15341): @ android.app.activitythread.main(activitythread.java:3821) 10-07 08:32:39.443: e/androidruntime(15341): @ java.lang.reflect.method.invokenative(native method) 10-07 08:32:39.443: e/androidruntime(15341): @ java.lang.reflect.method.invoke(method.java:538) 10-07 08:32:39.443: e/androidruntime(15341): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:969) 10-07 08:32:39.443: e/androidruntime(15341): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:727) 10-07 08:32:39.443: e/androidruntime(15341): @ dalvik.system.nativestart.main(native method) 10-07 08:32:39.443: e/androidruntime(15341): caused by: java.lang.noclassdeffounderror: com.amanda.tiara.dynamiclistview$2 10-07 08:32:39.443: e/androidruntime(15341): @ com.amanda.tiara.dynamiclistview.<clinit>(dynamiclistview.java:517) 10-07 08:32:39.443: e/androidruntime(15341): ... 24 more
edit
protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); //remove title bar this.requestwindowfeature(window.feature_no_title); setcontentview(r.layout.activity_main); lv = (dynamiclistview)findviewbyid(r.id.mylist); lv.setonitemclicklistener(new onitemclicklistener() { public void onitemclick(adapterview<?> parent, view view, int position, long id) { dialogfragment actionoptions = new actionoptions(); actionoptions.show(getsupportfragmentmanager(), "actions_options"); } }); lst = new arraylist<anactivity>(); adp = new activityadapter(this,lst); lv.mactivities = lst; lv.setadapter(adp); adp.lv = lv; //adding internal reference listview calc = (button)findviewbyid(r.id.calc); calc.setonclicklistener(new onclicklistener(){ public void onclick(view v){ datetime begin = new datetime(); (int = 0; < lst.size(); i++){ lst.get(i).starttime = begin; begin = begin.plushours(lst.get(i).duration.hours); begin = begin.plusminutes(lst.get(i).duration.minutes); } adp.notifydatasetchanged(); } }); start_pause = (button)findviewbyid(r.id.start_pause); start_pause.setonclicklistener(new onclicklistener(){ public void onclick(view v){ if (running) adp.pause(); else adp.go(); running = !running; } }); button list_actions = (button) findviewbyid(r.id.list_actions); list_actions.setonclicklistener(new onclicklistener(){ public void onclick(view v){ showeditdialog(); }}); }
edit 2
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res/com.amanda.tiara.dynamiclistview" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="0dp" android:paddingright="0dp" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".mainactivity" > <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:paddingleft="3dp" > <textview android:id="@+id/schedule" android:layout_width="wrap_content" android:layout_height="wrap_content" android:fontfamily="calibri" android:text="schedule" android:textsize="32dp" > </textview> <button android:id="@+id/list_actions" style="?android:attr/buttonstylesmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="add" /> <button android:id="@+id/start_pause" style="?android:attr/buttonstylesmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="start/stop" /> <button android:id="@+id/calc" style="?android:attr/buttonstylesmall" android:layout_width="wrap_content" android:layout_height="30dp" android:text="c" /> </linearlayout> <com.appfactory.timemania.dynamiclistview android:id="@+id/mylist" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#0000" android:footerdividersenabled="true" android:headerdividersenabled="true" android:paddingtop="10dp" />
Comments
Post a Comment