昨天我更新了我的Android應用程序之後,我收到了一些三星Galaxy Note II的奇怪錯誤。我有一些Note II設備,我無法自行復制這個問題。如何調試混淆的Android代碼?
(97號線是與標籤開頭的行)
我相信我的類擴展v4.fragment和FragmentActivity因爲它的工作原理每次我都測試了它的設備上。但我仍然收到這些崩潰報告,但我不知道如何解決這些問題。
任何想法?
Java.lang.RuntimeException: Unable to start activity ComponentInfo{com.zyz.mobile/com.zyz.mobile.jade.JadeActivity}: android.view.InflateException: Binary XML file line #97: Error inflating class fragment at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2308) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2362) at android.app.ActivityThread.access$700(ActivityThread.java:168) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1329) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5493) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1209) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1025) at dalvik.system.NativeStart.main(Native Method) Caused by: android.view.InflateException: Binary XML file line #97: Error inflating class fragment at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:719) at android.view.LayoutInflater.rInflate(LayoutInflater.java:761) at android.view.LayoutInflater.inflate(LayoutInflater.java:498) at android.view.LayoutInflater.inflate(LayoutInflater.java:398) at android.view.LayoutInflater.inflate(LayoutInflater.java:354) at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:361) at android.app.Activity.setContentView(Activity.java:1956) at com.zyz.mobile.jade.JadeActivity.onCreate(Unknown Source) at android.app.Activity.performCreate(Activity.java:5372) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2270) ... 11 more Caused by: java.lang.NullPointerException at com.zyz.mobile.jade.BookshelfFragment.a(Unknown Source) at android.support.v4.app.p.a(Unknown Source) at android.support.v4.app.p.b(Unknown Source) at android.support.v4.app.p.a(Unknown Source) at android.support.v4.app.h.onCreateView(Unknown Source) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691) ... 21 more
的XML
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="20dp"
>
<com.zyz.mobile.widget.MyButton
android:id="@+id/bookshelf_help"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="@drawable/jade_button"
android:textColor="@color/white"
android:text="@string/help"
android:textSize="20sp"
android:layout_margin="1dp"
android:gravity="bottom|left"
/>
<com.zyz.mobile.widget.MyButton
android:id="@+id/bookshelf_option"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="@drawable/jade_button"
android:textColor="@color/white"
android:text="@string/option"
android:textSize="20sp"
android:layout_margin="1dp"
android:gravity="bottom|left"
/>
<com.zyz.mobile.widget.MyButton
android:id="@+id/bookshelf_open"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="@drawable/jade_button"
android:textColor="@color/white"
android:text="@string/open_book"
android:textSize="20sp"
android:layout_margin="1dp"
android:gravity="bottom|left"
/>
</LinearLayout>
<com.zyz.mobile.widget.MyTextView
android:id="@+id/history_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/history_title"
android:textColor="@color/black"
android:textSize="20sp"
android:background="@color/grey"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
/>
<fragment
class="com.zyz.mobile.jade.BookshelfFragment"
android:id="@+id/bookshelf_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
這是我自己的片段。我不知道它所引用的'a'變量是什麼。我會嘗試在這個方向進行調試。謝謝。 –
是否有ProGuard的發佈版本的堆棧跟蹤?這很可能是你的問題。 –
我明白了。那麼我認爲,如果我不運行ProGuard,它會更好,因爲它是一個開源應用程序。謝謝。 –