您好,当我导出我的应用程序时,我的布局膨胀有问题。
导出我的应用程序时收到此错误消息:
10-10 13:25:25.559: E/ActivityThread(28191): Failed to inflate
10-10 13:25:25.559: E/ActivityThread(28191): android.view.InflateException: Binary XML file line #290: Error inflating class org.holoeverywhere.widget.ImageView
10-10 13:25:25.559: E/ActivityThread(28191): at org.holoeverywhere.LayoutInflater.createViewFromTag(LayoutInflater.java:450)
10-10 13:25:25.559: E/ActivityThread(28191): at org.holoeverywhere.LayoutInflater.rInflate(LayoutInflater.java:731)
10-10 13:25:25.559: E/ActivityThread(28191): at org.holoeverywhere.LayoutInflater.rInflate(LayoutInflater.java:734)
10-10 13:25:25.559: E/ActivityThread(28191): at org.holoeverywhere.LayoutInflater.rInflate(LayoutInflater.java:734)
10-10 13:25:25.559: E/ActivityThread(28191): at org.holoeverywhere.LayoutInflater.rInflate(LayoutInflater.java:734)
10-10 13:25:25.559: E/ActivityThread(28191): at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:538)
10-10 13:25:25.559: E/ActivityThread(28191): at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:488)
10-10 13:25:25.559: E/ActivityThread(28191): at android.support.v4.app._HoloActivity.requestDecorView(_HoloActivity.java:580)
10-10 13:25:25.559: E/ActivityThread(28191): at android.support.v4.app._HoloActivity.setContentView(_HoloActivity.java:604)
10-10 13:25:25.559: E/ActivityThread(28191): at com.example.workoutlog.HomePage.onCreate(HomePage.java:132)
10-10 13:25:25.559: E/ActivityThread(28191): at android.app.Activity.performCreate(Activity.java:5104)
10-10 13:25:25.559: E/ActivityThread(28191): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
10-10 13:25:25.559: E/ActivityThread(28191): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2262)
10-10 13:25:25.559: E/ActivityThread(28191): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2358)
10-10 13:25:25.559: E/ActivityThread(28191): at android.app.ActivityThread.access$600(ActivityThread.java:153)
10-10 13:25:25.559: E/ActivityThread(28191): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
10-10 13:25:25.559: E/ActivityThread(28191): at android.os.Handler.dispatchMessage(Handler.java:99)
10-10 13:25:25.559: E/ActivityThread(28191): at android.os.Looper.loop(Looper.java:137)
10-10 13:25:25.559: E/ActivityThread(28191): at android.app.ActivityThread.main(ActivityThread.java:5227)
10-10 13:25:25.559: E/ActivityThread(28191): at java.lang.reflect.Method.invokeNative(Native Method)
10-10 13:25:25.559: E/ActivityThread(28191): at java.lang.reflect.Method.invoke(Method.java:511)
10-10 13:25:25.559: E/ActivityThread(28191): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
10-10 13:25:25.559: E/ActivityThread(28191): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
10-10 13:25:25.559: E/ActivityThread(28191): at dalvik.system.NativeStart.main(Native Method)
10-10 13:25:25.559: E/ActivityThread(28191): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.holoeverywhere.widget.ImageView" on path: /mnt/asec/com.tigo-1/pkg.apk
10-10 13:25:25.559: E/ActivityThread(28191): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
10-10 13:25:25.559: E/ActivityThread(28191): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
10-10 13:25:25.559: E/ActivityThread(28191): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
10-10 13:25:25.559: E/ActivityThread(28191): at org.holoeverywhere.LayoutInflater._createView(LayoutInflater.java:330)
10-10 13:25:25.559: E/ActivityThread(28191): at org.holoeverywhere.LayoutInflater.onCreateView(LayoutInflater.java:590)
10-10 13:25:25.559: E/ActivityThread(28191): at org.holoeverywhere.LayoutInflater.createViewFromTag(LayoutInflater.java:444)
10-10 13:25:25.559: E/ActivityThread(28191): ... 23 more
10-10 13:25:25.579: D/AndroidRuntime(28191): Shutting down VM
10-10 13:25:25.579: W/dalvikvm(28191): threadid=1: thread exiting with uncaught exception (group=0x41f86930)
10-10 13:25:25.579: W/GAV2(28191): Thread[main,5,main]: dispatch call queued. Need to call GAServiceManager.getInstance().initialize().
10-10 13:25:25.589: E/AndroidRuntime(28191): FATAL EXCEPTION: main
10-10 13:25:25.589: E/AndroidRuntime(28191): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tigo/com.example.workoutlog.HomePage}: android.view.InflateException: Binary XML file line #290: Error inflating class org.holoeverywhere.widget.ImageView
10-10 13:25:25.589: E/AndroidRuntime(28191): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2308)
10-10 13:25:25.589: E/AndroidRuntime(28191): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2358)
10-10 13:25:25.589: E/AndroidRuntime(28191): at android.app.ActivityThread.access$600(ActivityThread.java:153)
10-10 13:25:25.589: E/AndroidRuntime(28191): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
10-10 13:25:25.589: E/AndroidRuntime(28191): at android.os.Handler.dispatchMessage(Handler.java:99)
10-10 13:25:25.589: E/AndroidRuntime(28191): at android.os.Looper.loop(Looper.java:137)
10-10 13:25:25.589: E/AndroidRuntime(28191): at android.app.ActivityThread.main(ActivityThread.java:5227)
10-10 13:25:25.589: E/AndroidRuntime(28191): at java.lang.reflect.Method.invokeNative(Native Method)
10-10 13:25:25.589: E/AndroidRuntime(28191): at java.lang.reflect.Method.invoke(Method.java:511)
10-10 13:25:25.589: E/AndroidRuntime(28191): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
10-10 13:25:25.589: E/AndroidRuntime(28191): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
10-10 13:25:25.589: E/AndroidRuntime(28191): at dalvik.system.NativeStart.main(Native Method)
10-10 13:25:25.589: E/AndroidRuntime(28191): Caused by: android.view.InflateException: Binary XML file line #290: Error inflating class org.holoeverywhere.widget.ImageView
10-10 13:25:25.589: E/AndroidRuntime(28191): at org.holoeverywhere.LayoutInflater.createViewFromTag(LayoutInflater.java:450)
10-10 13:25:25.589: E/AndroidRuntime(28191): at org.holoeverywhere.LayoutInflater.rInflate(LayoutInflater.java:731)
10-10 13:25:25.589: E/AndroidRuntime(28191): at org.holoeverywhere.LayoutInflater.rInflate(LayoutInflater.java:734)
10-10 13:25:25.589: E/AndroidRuntime(28191): at org.holoeverywhere.LayoutInflater.rInflate(LayoutInflater.java:734)
10-10 13:25:25.589: E/AndroidRuntime(28191): at org.holoeverywhere.LayoutInflater.rInflate(LayoutInflater.java:734)
10-10 13:25:25.589: E/AndroidRuntime(28191): at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:538)
10-10 13:25:25.589: E/AndroidRuntime(28191): at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:488)
10-10 13:25:25.589: E/AndroidRuntime(28191): at android.support.v4.app._HoloActivity.requestDecorView(_HoloActivity.java:580)
10-10 13:25:25.589: E/AndroidRuntime(28191): at android.support.v4.app._HoloActivity.setContentView(_HoloActivity.java:604)
10-10 13:25:25.589: E/AndroidRuntime(28191): at com.example.workoutlog.HomePage.onCreate(HomePage.java:132)
10-10 13:25:25.589: E/AndroidRuntime(28191): at android.app.Activity.performCreate(Activity.java:5104)
10-10 13:25:25.589: E/AndroidRuntime(28191): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
10-10 13:25:25.589: E/AndroidRuntime(28191): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2262)
10-10 13:25:25.589: E/AndroidRuntime(28191): ... 11 more
10-10 13:25:25.589: E/AndroidRuntime(28191): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.holoeverywhere.widget.ImageView" on path: /mnt/asec/com.tigo-1/pkg.apk
10-10 13:25:25.589: E/AndroidRuntime(28191): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
10-10 13:25:25.589: E/AndroidRuntime(28191): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
10-10 13:25:25.589: E/AndroidRuntime(28191): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
10-10 13:25:25.589: E/AndroidRuntime(28191): at org.holoeverywhere.LayoutInflater._createView(LayoutInflater.java:330)
10-10 13:25:25.589: E/AndroidRuntime(28191): at org.holoeverywhere.LayoutInflater.onCreateView(LayoutInflater.java:590)
10-10 13:25:25.589: E/AndroidRuntime(28191): at org.holoeverywhere.LayoutInflater.createViewFromTag(LayoutInflater.java:444)
10-10 13:25:25.589: E/AndroidRuntime(28191): ... 23 more
10-10 13:25:25.609: D/dalvikvm(28191): GC_CONCURRENT freed 1696K, 25% free 5716K/7588K, paused 10ms+18ms, total 71ms
10-10 13:25:28.983: W/GAV2(28191): Thread[Service Reconnect,5,main]: Service unavailable (code=1), using local store.
从 Eclipse 运行应用程序时不会出现该消息。我的proguard关闭了。这很奇怪,因为从 Eclipse 运行时一切都很好。
logcat 指向的行:
<android.widget.ImageView
android:id="@+id/workoutWall2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@drawable/workout_wall" />
感谢您的帮助!
这是我的 XML 它所指的:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/homePageLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background" >
<LinearLayout
android:id="@+id/tempTab"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@color/Black"
android:orientation="horizontal"
android:weightSum="2" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="50sp"
android:layout_weight="1"
android:orientation="vertical" >
<Button
android:id="@+id/homePageTab"
android:layout_width="fill_parent"
android:layout_height="45sp"
android:background="@color/transparent"
android:text="Home page"
android:textColor="@color/White" />
<LinearLayout
android:id="@+id/homeLine"
android:layout_width="fill_parent"
android:layout_height="5sp"
android:background="@color/Blue"
android:orientation="horizontal" >
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="50sp"
android:layout_weight="1"
android:orientation="vertical" >
<Button
android:id="@+id/extraTab"
android:layout_width="fill_parent"
android:layout_height="45sp"
android:background="@color/transparent"
android:text="Extra tools"
android:textColor="@color/White" />
<LinearLayout
android:id="@+id/extraLine"
android:layout_width="fill_parent"
android:layout_height="5sp"
android:background="@color/Black"
android:orientation="horizontal" >
</LinearLayout>
</LinearLayout>
</LinearLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/tempTab"
android:fillViewport="true"
android:hardwareAccelerated="false" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:id="@+id/blockHelper"
android:layout_width="match_parent"
android:layout_height="25sp"
android:layout_alignParentBottom="true"
android:layout_below="@+id/TextView06"
android:orientation="vertical" >
</LinearLayout>
<TextView
android:id="@+id/TextView04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/setToday"
android:layout_below="@+id/setToday"
android:gravity="center_horizontal"
android:text="today log"
android:textColor="@color/Black"
android:textSize="20sp" />
<ImageButton
android:id="@+id/calendarPage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/TextView04"
android:layout_below="@+id/TextView06"
android:background="@drawable/home_page_icon"
android:src="@drawable/calendar" />
<ImageButton
android:id="@+id/dietHomePage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/TextView04"
android:layout_alignLeft="@+id/textView2"
android:background="@drawable/home_page_icon"
android:src="@drawable/diet" />
<TextView
android:id="@+id/TextView05"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/calendarPage"
android:layout_below="@+id/calendarPage"
android:gravity="center_horizontal"
android:text="calendar"
android:textColor="@color/Black"
android:textSize="20sp" />
<TextView
android:id="@+id/TextView06"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/dietHomePage"
android:layout_alignRight="@+id/dietHomePage"
android:layout_below="@+id/dietHomePage"
android:gravity="center_horizontal"
android:text="diet"
android:textColor="@color/Black"
android:textSize="20sp" />
<ImageButton
android:id="@+id/liveWorkout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/setWorkOutProgram"
android:layout_below="@+id/setWorkOutProgram"
android:layout_marginTop="67dp"
android:background="@drawable/home_page_icon"
android:src="@drawable/stopwatch" />
<ImageButton
android:id="@+id/statistics"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/liveWorkout"
android:layout_marginTop="22dp"
android:background="@drawable/home_page_icon"
android:src="@drawable/line_chart" />
<TextView
android:id="@+id/TextView14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/liveWorkout"
android:layout_alignRight="@+id/liveWorkout"
android:layout_below="@+id/liveWorkout"
android:gravity="center_horizontal"
android:text="live"
android:textColor="@color/Black"
android:textSize="20sp" />
<TextView
android:id="@+id/TextView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/statistics"
android:layout_alignRight="@+id/statistics"
android:layout_below="@+id/statistics"
android:gravity="center_horizontal"
android:text="statistics"
android:textColor="@color/Black"
android:textSize="20sp" />
<TextView
android:id="@+id/TextView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/setWorkOutProgram"
android:layout_alignRight="@+id/setWorkOutProgram"
android:layout_below="@+id/setWorkOutProgram"
android:gravity="center_horizontal"
android:text="program"
android:textColor="@color/Black"
android:textSize="20sp" />
<TextView
android:id="@+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/goRoutines"
android:layout_alignRight="@+id/goRoutines"
android:layout_below="@+id/goRoutines"
android:gravity="center_horizontal"
android:text="routine"
android:textColor="@color/Black"
android:textSize="20sp" />
<RelativeLayout
android:id="@+id/dietWall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/home_page_icon"
android:clickable="true" >
<android.widget.ImageView
android:id="@+id/dietWall2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/diet_wall" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/dietWall2"
android:layout_alignRight="@+id/dietWall2"
android:layout_below="@+id/dietWall2"
android:gravity="center_horizontal"
android:text="diet wall"
android:textColor="@color/Black"
android:textSize="20sp" />
</RelativeLayout>
<ImageButton
android:id="@+id/setToday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignTop="@+id/liveWorkout"
android:background="@drawable/home_page_icon"
android:src="@drawable/calendar_today" />
<ImageButton
android:id="@+id/goRoutines"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/workoutWall"
android:layout_marginTop="38dp"
android:background="@drawable/home_page_icon"
android:src="@drawable/routine" />
<ImageButton
android:id="@+id/setWorkOutProgram"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/textView11"
android:layout_alignRight="@+id/dietWall"
android:layout_marginRight="32dp"
android:background="@drawable/home_page_icon"
android:src="@drawable/program" />
<ImageButton
android:id="@+id/personalDetails"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/textView11"
android:layout_alignParentRight="true"
android:layout_marginRight="60dp"
android:background="@drawable/home_page_icon"
android:src="@drawable/profile" />
<TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/personalDetails"
android:layout_alignRight="@+id/personalDetails"
android:layout_below="@+id/personalDetails"
android:gravity="center_horizontal"
android:text="details"
android:textColor="@color/Black"
android:textSize="20sp" />
<RelativeLayout
android:id="@+id/workoutWall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignRight="@+id/personalDetails"
android:background="@drawable/home_page_icon"
android:clickable="true" >
<android.widget.ImageView
android:id="@+id/workoutWall2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@drawable/workout_wall" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/workoutWall2"
android:layout_alignRight="@+id/workoutWall2"
android:layout_below="@+id/workoutWall2"
android:gravity="center_horizontal"
android:text="workout wall"
android:textColor="@color/Black"
android:textSize="15sp" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
<ProgressBar
android:id="@+id/loadingProgress"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:indeterminateDrawable="@drawable/rotate_progress"
android:visibility="gone" />
</RelativeLayout>