0

我正在尝试在 android 中使用https://github.com/gabrielemariotti/cardslib这个库。我正在使用文档在 Eclipse 中构建示例。但是,当我尝试运行它时,出现此错误:

06-09 09:22:07.322: E/AndroidRuntime(9811): FATAL EXCEPTION: main
06-09 09:22:07.322: E/AndroidRuntime(9811): Process: it.gmariotti.cardslib.demo, PID: 9811
06-09 09:22:07.322: E/AndroidRuntime(9811): java.lang.RuntimeException: Unable to start activity ComponentInfo{it.gmariotti.cardslib.demo/it.gmariotti.cardslib.demo.MainActivity}: android.view.InflateException: Binary XML file line #44: Error inflating class it.gmariotti.cardslib.library.view.CardView
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.app.ActivityThread.access$800(ActivityThread.java:135)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.os.Handler.dispatchMessage(Handler.java:102)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.os.Looper.loop(Looper.java:136)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.app.ActivityThread.main(ActivityThread.java:5017)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at java.lang.reflect.Method.invokeNative(Native Method)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at java.lang.reflect.Method.invoke(Method.java:515)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at dalvik.system.NativeStart.main(Native Method)
06-09 09:22:07.322: E/AndroidRuntime(9811): Caused by: android.view.InflateException: Binary XML file line #44: Error inflating class it.gmariotti.cardslib.library.view.CardView
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.view.LayoutInflater.createView(LayoutInflater.java:620)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at it.gmariotti.cardslib.demo.fragment.HeaderFragment.onCreateView(HeaderFragment.java:56)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.app.Fragment.performCreateView(Fragment.java:1700)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.app.BackStackRecord.run(BackStackRecord.java:684)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.app.Activity.performStart(Activity.java:5240)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2168)
06-09 09:22:07.322: E/AndroidRuntime(9811):     ... 11 more
06-09 09:22:07.322: E/AndroidRuntime(9811): Caused by: java.lang.reflect.InvocationTargetException
06-09 09:22:07.322: E/AndroidRuntime(9811):     at java.lang.reflect.Constructor.constructNative(Native Method)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at android.view.LayoutInflater.createView(LayoutInflater.java:594)
06-09 09:22:07.322: E/AndroidRuntime(9811):     ... 25 more
06-09 09:22:07.322: E/AndroidRuntime(9811): Caused by: java.lang.NoClassDefFoundError: it.gmariotti.cardslib.library.R$styleable
06-09 09:22:07.322: E/AndroidRuntime(9811):     at it.gmariotti.cardslib.library.view.CardView.initAttrs(CardView.java:195)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at it.gmariotti.cardslib.library.view.BaseCardView.init(BaseCardView.java:121)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at it.gmariotti.cardslib.library.view.BaseCardView.<init>(BaseCardView.java:101)
06-09 09:22:07.322: E/AndroidRuntime(9811):     at it.gmariotti.cardslib.library.view.CardView.<init>(CardView.java:172)
06-09 09:22:07.322: E/AndroidRuntime(9811):     ... 28 more

在此处输入图像描述

我究竟做错了什么?如问题 https://plus.google.com/+GabrieleMariotti/posts/KKU9EF6VMYr中所述,我已在没有任何 .java 包的情况下导入它们

4

0 回答 0