2012-05-15 71 views
0

當我添加動畫XML文件到我的項目(我試圖縮放,旋轉,設置),並嘗試推出它的Android 2.1虛擬機,它具有以下消息墜毀在logcat的應用動畫文件崩潰使用SherlockActionBar

05-16 00:14:01.821: E/AndroidRuntime(898): Uncaught handler: thread main exiting due to uncaught exception 
05-16 00:14:01.861: E/AndroidRuntime(898): java.lang.RuntimeException: Unable to start activity ComponentInfo{su.k_r.tasstelecom/su.k_r.tasstelecom.CategoriesActivity}: android.view.InflateException: Binary XML file line #31: Error inflating class com.actionbarsherlock.internal.widget.ActionBarView 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496) 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.os.Handler.dispatchMessage(Handler.java:99) 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.os.Looper.loop(Looper.java:123) 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.app.ActivityThread.main(ActivityThread.java:4363) 
05-16 00:14:01.861: E/AndroidRuntime(898): at java.lang.reflect.Method.invokeNative(Native Method) 
05-16 00:14:01.861: E/AndroidRuntime(898): at java.lang.reflect.Method.invoke(Method.java:521) 
05-16 00:14:01.861: E/AndroidRuntime(898): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 
05-16 00:14:01.861: E/AndroidRuntime(898): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 
05-16 00:14:01.861: E/AndroidRuntime(898): at dalvik.system.NativeStart.main(Native Method) 
05-16 00:14:01.861: E/AndroidRuntime(898): Caused by: android.view.InflateException: Binary XML file line #31: Error inflating class com.actionbarsherlock.internal.widget.ActionBarView 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.view.LayoutInflater.createView(LayoutInflater.java:513) 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565) 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618) 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.view.LayoutInflater.rInflate(LayoutInflater.java:621) 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.view.LayoutInflater.inflate(LayoutInflater.java:407) 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 
05-16 00:14:01.861: E/AndroidRuntime(898): at com.actionbarsherlock.internal.ActionBarSherlockCompat.generateLayout(ActionBarSherlockCompat.java:1042) 
05-16 00:14:01.861: E/AndroidRuntime(898): at com.actionbarsherlock.internal.ActionBarSherlockCompat.installDecor(ActionBarSherlockCompat.java:912) 
05-16 00:14:01.861: E/AndroidRuntime(898): at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:846) 
05-16 00:14:01.861: E/AndroidRuntime(898): at com.actionbarsherlock.app.SherlockListActivity.setContentView(SherlockListActivity.java:212) 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.app.ListActivity.ensureList(ListActivity.java:305) 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.app.ListActivity.getListView(ListActivity.java:290) 
05-16 00:14:01.861: E/AndroidRuntime(898): at su.k_r.tasstelecom.CategoriesActivity.onCreate(CategoriesActivity.java:72) 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459) 
05-16 00:14:01.861: E/AndroidRuntime(898): ... 11 more 
05-16 00:14:01.861: E/AndroidRuntime(898): Caused by: java.lang.reflect.InvocationTargetException 
05-16 00:14:01.861: E/AndroidRuntime(898): at com.actionbarsherlock.internal.widget.ActionBarView.<init>(ActionBarView.java:235) 
05-16 00:14:01.861: E/AndroidRuntime(898): at java.lang.reflect.Constructor.constructNative(Native Method) 
05-16 00:14:01.861: E/AndroidRuntime(898): at java.lang.reflect.Constructor.newInstance(Constructor.java:446) 
05-16 00:14:01.861: E/AndroidRuntime(898): at android.view.LayoutInflater.createView(LayoutInflater.java:500) 
05-16 00:14:01.861: E/AndroidRuntime(898): ... 26 more 
05-16 00:14:01.861: E/AndroidRuntime(898): Caused by: java.lang.NullPointerException 
05-16 00:14:01.861: E/AndroidRuntime(898): at com.actionbarsherlock.internal.widget.ActionBarView$HomeView.setUp(ActionBarView.java:1302) 
05-16 00:14:01.861: E/AndroidRuntime(898): ... 30 more 

我甚至沒有在代碼中使用動畫。 我在哪裏做錯了?

在Android 4.0的一切都很正常

+0

什麼樣的代碼是在這裏:su.k_r.tasstelecom.CategoriesActivity.onCreate(CategoriesActivity.java:72) – dymmeh

+0

你R.java可能是過時。嘗試「項目>清潔」。 –

+0

@dymmeh'lv = getListView();'如果我評論這個,它仍然在沒有任何引用我的類的logcat – Ashot

回答

2

清潔ABS工程修復問題

+0

你好,我可能有同樣的問題[這裏](http://stackoverflow.com/questions/21008515/npe-while-inflating-actionbarsherlock-on-old -androids)。你是如何「清潔」ABS的?你的工作區有ABS嗎?如果我在Android Mavenized項目中導入它會怎麼樣? –

+0

在eclipse **項目中 - 清理項目**。很久以前,如果我的記憶不欺騙我,我從ABS來源創建了**圖書館項目**,並且我正在清理這個ABS項目。 – Ashot