CodeAndMagic / GaugeView

An Android library for drawing gauges on Canvas.
Apache License 2.0
224 stars 156 forks source link

XML Error when creating Gauges #2

Open timkoers opened 11 years ago

timkoers commented 11 years ago

I get the a XML error when i try to run the app. Here is a copy of my log cat:

06-09 14:46:04.019: E/dalvikvm(2568): Could not find class 'org.codeandmagic.android.gauge.GaugeView', referenced from method MainActivity.onCreate 06-09 14:46:04.019: W/dalvikvm(2568): VFY: unable to resolve check-cast 1091 (org/codeandmagic/android/gauge/GaugeView;) in MainActivity; 06-09 14:46:04.034: W/dalvikvm(2568): VFY: unable to resolve virtual method 6304: Lorg/codeandmagic/android/gauge/GaugeView;.setTargetValue (F)V 06-09 14:46:04.769: W/dalvikvm(2568): threadid=1: thread exiting with uncaught exception (group=0x418282d0) 06-09 14:46:04.819: E/AndroidRuntime(2568): FATAL EXCEPTION: main 06-09 14:46:04.819: E/AndroidRuntime(2568): java.lang.RuntimeException: Unable to start activity ComponentInfo{MainActivity}: android.view.InflateException: Binary XML file line #32: Error inflating class org.codeandmagic.android.gauge.GaugeView 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2355) 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2391) 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.ActivityThread.access$600(ActivityThread.java:151) 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1335) 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.os.Handler.dispatchMessage(Handler.java:99) 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.os.Looper.loop(Looper.java:155) 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.ActivityThread.main(ActivityThread.java:5493) 06-09 14:46:04.819: E/AndroidRuntime(2568): at java.lang.reflect.Method.invokeNative(Native Method) 06-09 14:46:04.819: E/AndroidRuntime(2568): at java.lang.reflect.Method.invoke(Method.java:511) 06-09 14:46:04.819: E/AndroidRuntime(2568): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028) 06-09 14:46:04.819: E/AndroidRuntime(2568): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:795) 06-09 14:46:04.819: E/AndroidRuntime(2568): at dalvik.system.NativeStart.main(Native Method) 06-09 14:46:04.819: E/AndroidRuntime(2568): Caused by: android.view.InflateException: Binary XML file line #32: Error inflating class org.codeandmagic.android.gauge.GaugeView 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698) 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.view.LayoutInflater.inflate(LayoutInflater.java:489) 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.view.LayoutInflater.inflate(LayoutInflater.java:352) 06-09 14:46:04.819: E/AndroidRuntime(2568): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:365) 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.Activity.setContentView(Activity.java:1912) 06-09 14:46:04.819: E/AndroidRuntime(2568): at com.Tim.Koers.minitoolbox.MainActivity.onCreate(MainActivity.java:21) 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.Activity.performCreate(Activity.java:5066) 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1101) 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2311) 06-09 14:46:04.819: E/AndroidRuntime(2568): ... 11 more 06-09 14:46:04.819: E/AndroidRuntime(2568): Caused by: java.lang.ClassNotFoundException: org.codeandmagic.android.gauge.GaugeView 06-09 14:46:04.819: E/AndroidRuntime(2568): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) 06-09 14:46:04.819: E/AndroidRuntime(2568): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 06-09 14:46:04.819: E/AndroidRuntime(2568): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.view.LayoutInflater.createView(LayoutInflater.java:552) 06-09 14:46:04.819: E/AndroidRuntime(2568): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687) 06-09 14:46:04.819: E/AndroidRuntime(2568): ... 21 more 06-09 14:46:08.019: D/Process(2568): killProcess, pid=2568 06-09 14:46:08.034: D/Process(2568): dalvik.system.VMStack.getThreadStackTrace(Native Method) 06-09 14:46:08.034: D/Process(2568): java.lang.Thread.getStackTrace(Thread.java:599) 06-09 14:46:08.034: D/Process(2568): android.os.Process.killProcess(Process.java:944) 06-09 14:46:08.034: D/Process(2568): com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:108) 06-09 14:46:08.034: D/Process(2568): java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693) 06-09 14:46:08.034: D/Process(2568): java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690) 06-09 14:46:08.034: D/Process(2568): dalvik.system.NativeStart.main(Native Method)

Thanks! Tim

ToosoftwareUser commented 10 years ago

hi,have you resolve this problem?thanks

greenspand commented 10 years ago

Hi Tim, Based on your log it looks as though the class is not found. Check the package name and see if they match. Also try to acess the GaugeView class, from the XML file where you called it with CTRL+ mouse click on the class Package Name. If it doesn't lead you to it then it is clear that the package name is faulty. Cheers.

On 24/10/2014, Toosoftware notifications@github.com wrote:

hi,have you resolve this problem?thanks


Reply to this email directly or view it on GitHub: https://github.com/CodeAndMagic/GaugeView/issues/2#issuecomment-60353486

Mit freundlichen Grüßen / With regards, Sorin Irimies, Software Entwickler, @Bertrandt AG