java - Android ClassNotFoundException after including GaugeView library -
i trying use gauge view github
sample application given library works perfect !
but when try include library project (properties > buildpath > projects > (add library project)), put view in layout , try reference view in code throws classnotfoundexception
the following error through logcat:
e/androidruntime( 542): fatal exception: main e/androidruntime( 542): java.lang.runtimeexception: unable start activity componentinfo{com.example.guagetest/com.example.guagetest.mainactivity}: android.view.inflateexception: binary xml file line #8: error inflating class org.codeandmagic.android.gauge.gaugeview e/androidruntime( 542): @ android.app.activitythread.performlaunchactivity(activitythread.java:1955) e/androidruntime( 542): @ android.app.activitythread.handlelaunchactivity(activitythread.java:1980) e/androidruntime( 542): @ android.app.activitythread.access$600(activitythread.java:122) e/androidruntime( 542): @ android.app.activitythread$h.handlemessage(activitythread.java:1146) e/androidruntime( 542): @ android.os.handler.dispatchmessage(handler.java:99) e/androidruntime( 542): @ android.os.looper.loop(looper.java:137) e/androidruntime( 542): @ android.app.activitythread.main(activitythread.java:4340) e/androidruntime( 542): @ java.lang.reflect.method.invokenative(native method) e/androidruntime( 542): @ java.lang.reflect.method.invoke(method.java:511) e/androidruntime( 542): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:784) e/androidruntime( 542): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:551) e/androidruntime( 542): @ dalvik.system.nativestart.main(native method) e/androidruntime( 542): caused by: android.view.inflateexception: binary xml file line #8: error inflating class org.codeandmagic.android.gauge.gaugeview e/androidruntime( 542): @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:691) e/androidruntime( 542): @ android.view.layoutinflater.rinflate(layoutinflater.java:739) e/androidruntime( 542): @ android.view.layoutinflater.inflate(layoutinflater.java:489) e/androidruntime( 542): @ android.view.layoutinflater.inflate(layoutinflater.java:396) e/androidruntime( 542): @ android.view.layoutinflater.inflate(layoutinflater.java:352) e/androidruntime( 542): @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:251) e/androidruntime( 542): @ android.app.activity.setcontentview(activity.java:1835) e/androidruntime( 542): @ com.example.guagetest.mainactivity.oncreate(mainactivity.java:16) e/androidruntime( 542): @ android.app.activity.performcreate(activity.java:4465) e/androidruntime( 542): @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1049) e/androidruntime( 542): @ android.app.activitythread.performlaunchactivity(activitythread.java:1919) e/androidruntime( 542): ... 11 more e/androidruntime( 542): caused by: java.lang.classnotfoundexception: org.codeandmagic.android.gauge.gaugeview e/androidruntime( 542): @ dalvik.system.basedexclassloader.findclass(basedexclassloader.java:61) e/androidruntime( 542): @ java.lang.classloader.loadclass(classloader.java:501) e/androidruntime( 542): @ java.lang.classloader.loadclass(classloader.java:461) e/androidruntime( 542): @ android.view.layoutinflater.createview(layoutinflater.java:552) e/androidruntime( 542): @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:680) e/androidruntime( 542): ... 21 more w/activitymanager( 77): force finishing activity com.example.guagetest/.mainactivity
i have no idea why not able find class. please help. there special done in sample application need work ?
the following layout:
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".mainactivity" > <org.codeandmagic.android.gauge.gaugeview android:id="@+id/gauge_view1" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" /> </linearlayout>
this activity:
package com.example.guagetest; import org.codeandmagic.android.gauge.gaugeview; import android.os.bundle; import android.app.activity; import android.view.menu; public class mainactivity extends activity { private gaugeview gauge; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); gauge = (gaugeview) findviewbyid(r.id.gauge_view1); gauge.settargetvalue(10); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.activity_main, menu); return true; } }
you didn't post code, fact spelling of particular word inconsistent in post suggests need check how you're spelling things in code. @ these 2 words carefully:
string correct = "gauge"; string wrongwrongwrong = "guage";
Comments
Post a Comment