2017-06-14 59 views
-1

这是我的活动代码,其中应用程序崩溃 我尝试在很多设备工作正常 但与任何移动采用Android 7.0版本坠毁应用程序崩溃,如果运行在android 7.0 android.view.InflateException:二进制XML文件行#108:错误充气类ImageButton

我尝试昌它的图像无法正常工作 当我删除图像是做工精细 这是我的错误android.view.InflateException:二进制XML文件行#108:二进制XML文件行#108:错误膨胀类ImageButton 如果我删除该图像中的该行108给另一个图像行中的错误

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v4.widget.NestedScrollView 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
tools:context="com.ytubasi.zezo.zezomarket.MyService"> 




    <LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 






    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_marginLeft="3dp" 
     android:layout_marginRight="3dp" 
     android:orientation="vertical"> 
     <Space 
      android:layout_width="match_parent" 
      android:layout_height="10dp" /> 

     <Button 
      android:id="@+id/button58" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:background="@drawable/buttonblue" 
      android:drawableRight="@drawable/newsa" 
      android:gravity="center" 
      android:onClick="Send" 
      android:text="@string/myOrders" 
      android:textColor="@android:color/black" 
      android:textSize="16sp" 
      android:textStyle="bold" 
      tools:ignore="ButtonStyle,RtlHardcoded" /> 

     <Space 
      android:layout_width="match_parent" 
      android:layout_height="50dp" /> 
     <TextView 
      android:id="@+id/Candy" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:gravity="center" 
      android:text="@string/chose_your_order" 
      android:textColor="@android:color/black" 
      android:textSize="24sp" 
      android:textStyle="bold" /> 
     <Space 
      android:layout_width="match_parent" 
      android:layout_height="50dp" /> 
     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:orientation="vertical"> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="horizontal" 
       android:weightSum="3" 
       tools:ignore="DisableBaselineAlignment"> 

       <LinearLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:orientation="vertical"> 

        <ImageButton 
         android:id="@+id/Market" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:background="@drawable/market" 
         android:onClick="markets" 
         tools:ignore="ContentDescription" 
         /> 

        <TextView 
         android:id="@+id/editTex2t" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:ems="10" 
         android:gravity="center" 
         android:text="@string/super_market" 
         android:textColor="@color/colorPrimaryDark" 
         android:textSize="18sp" 
         android:textStyle="bold" /> 

       </LinearLayout> 

       <LinearLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:orientation="vertical"> 

        <ImageButton 

        android:id="@+id/phyermace" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:background="@drawable/phyermace" 
         android:onClick="phermacy" 
         tools:ignore="ContentDescription" /> 

        <TextView 
         android:id="@+id/Phyrmacy" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:ems="10" 
         android:gravity="center" 
         android:onClick="markets" 
         android:text="@string/pharmacy" 
         android:textColor="@color/colorPrimaryDark" 
         android:textSize="18sp" 
         android:textStyle="bold" /> 
       </LinearLayout> 

       <LinearLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:orientation="vertical"> 

        <ImageButton 
         android:id="@+id/IceCream" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:background="@drawable/candy" 
         android:onClick="candy" 
         tools:ignore="ContentDescription" 
         /> 

        <TextView 
         android:id="@+id/Restureant" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:ems="10" 
         android:gravity="center" 
         android:onClick="markets" 
         android:text="@string/candy_and_icecream" 
         android:textColor="@color/colorPrimaryDark" 
         android:textSize="18sp" 
         android:textStyle="bold" /> 
       </LinearLayout> 
      </LinearLayout> 

      <Space 
       android:layout_width="match_parent" 
       android:layout_height="50dp" /> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="horizontal" 
       android:weightSum="3" 
       android:baselineAligned="false"> 

       <LinearLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:orientation="vertical"> 

        <ImageButton 
         android:id="@+id/Nuts" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:background="@drawable/nuts" 
         android:onClick="nuts" 
         tools:ignore="ContentDescription" /> 

        <TextView 
         android:id="@+id/edwwqitTrext22" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:ems="10" 
         android:gravity="center" 
         android:onClick="markets" 
         android:text="@string/nuts" 
         android:textColor="@color/colorPrimaryDark" 
         android:textSize="18sp" 
         android:textStyle="bold" /> 

       </LinearLayout> 

       <LinearLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:orientation="vertical"> 

        <ImageButton 
         android:id="@+id/Charge" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:background="@drawable/charge" 
         android:onClick="charge" 
         tools:ignore="ContentDescription" /> 

        <TextView 
         android:id="@+id/editText2q2" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:ems="10" 
         android:gravity="center" 
         android:onClick="markets" 
         android:text="@string/transfer_and_charge" 
         android:textColor="@color/colorPrimaryDark" 
         android:textSize="18sp" 
         android:textStyle="bold" /> 
       </LinearLayout> 

       <LinearLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:orientation="vertical"> 

        <ImageButton 
         android:id="@+id/Reasturant" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:background="@drawable/resterent" 
         android:onClick="resturant" 
         tools:ignore="ContentDescription" /> 

        <TextView 
         android:id="@+id/editTextf2" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:ems="10" 
         android:gravity="center" 
         android:onClick="markets" 
         android:text="@string/restaurant" 
         android:textColor="@color/colorPrimaryDark" 
         android:textSize="18sp" 
         android:textStyle="bold" /> 
       </LinearLayout> 
      </LinearLayout> 

      <Space 
       android:layout_width="match_parent" 
       android:layout_height="50dp" /> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="horizontal" 
       android:weightSum="3" 
       tools:ignore="DisableBaselineAlignment"> 

       <LinearLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:orientation="vertical"> 

        <ImageButton 
         android:id="@+id/Library" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:background="@drawable/library" 
         android:onClick="library" 
         tools:ignore="ContentDescription" /> 

        <TextView 
         android:id="@+id/editTrqqext22" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:ems="10" 
         android:gravity="center" 
         android:onClick="markets" 
         android:text="@string/library" 
         android:textColor="@color/colorPrimaryDark" 
         android:textSize="18sp" 
         android:textStyle="bold" /> 

       </LinearLayout> 

       <LinearLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:orientation="vertical"> 

        <ImageButton 
         android:id="@+id/Perfumes" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:background="@drawable/perfum" 
         android:onClick="perfume" 
         tools:ignore="ContentDescription" /> 

        <TextView 
         android:id="@+id/Perfusdsddmes" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:ems="10" 
         android:gravity="center" 
         android:onClick="markets" 
         android:text="@string/perfumes" 
         android:textColor="@color/colorPrimaryDark" 
         android:textSize="18sp" 
         android:textStyle="bold" /> 
       </LinearLayout> 

       <LinearLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:orientation="vertical"> 

        <ImageButton 
         android:id="@+id/Roses" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:background="@drawable/rose" 
         android:onClick="roses" 
         tools:ignore="ContentDescription" /> 

        <TextView 
         android:id="@+id/editText3vb2" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:ems="10" 
         android:gravity="center" 
         android:onClick="markets" 
         android:text="@string/roses" 
         android:textColor="@color/colorPrimaryDark" 
         android:textSize="18sp" 
         android:textStyle="bold" /> 
       </LinearLayout> 
      </LinearLayout> 

      <Space 
       android:layout_width="match_parent" 
       android:layout_height="50dp" /> 
      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="horizontal" 
       android:weightSum="3" 
       tools:ignore="DisableBaselineAlignment"> 

       <LinearLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:orientation="vertical"> 

        <ImageButton 
         android:id="@+id/luxury" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:background="@drawable/luxyry" 
         android:onClick="luxuary" 
         tools:ignore="ContentDescription" /> 

        <TextView 
         android:id="@+id/editTrext22" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:ems="10" 
         android:gravity="center" 
         android:onClick="markets" 
         android:text="@string/luxury" 
         android:textColor="@color/colorPrimaryDark" 
         android:textSize="18sp" 
         android:textStyle="bold" /> 

       </LinearLayout> 

       <LinearLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:orientation="vertical"> 

        <ImageButton 
         android:id="@+id/CofeShopo" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:background="@drawable/coffe" 
         android:onClick="cofeshop" 
         tools:ignore="ContentDescription" /> 

        <TextView 
         android:id="@+id/editText22" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:ems="10" 
         android:gravity="center" 
         android:onClick="markets" 
         android:text="@string/coffee_shop" 
         android:textColor="@color/colorPrimaryDark" 
         android:textSize="18sp" 
         android:textStyle="bold" /> 
       </LinearLayout> 

       <LinearLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:orientation="vertical"> 

        <ImageButton 
         android:id="@+id/Atarashop" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:background="@drawable/atara" 
         android:onClick="attara" 
         tools:ignore="ContentDescription" /> 

        <TextView 
         android:id="@+id/editText32" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:ems="10" 
         android:gravity="center" 
         android:onClick="markets" 
         android:text="@string/atara_shop" 
         android:textColor="@color/colorPrimaryDark" 
         android:textSize="18sp" 
         android:textStyle="bold" /> 
       </LinearLayout> 
      </LinearLayout> 

      <Space 
       android:layout_width="match_parent" 
       android:layout_height="50dp" /> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="horizontal" 
       android:weightSum="2" 
       tools:ignore="DisableBaselineAlignment"> 

       <LinearLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:orientation="vertical"> 

        <ImageButton 
         android:id="@+id/Bakeries" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:background="@drawable/bakeries" 
         android:onClick="bakers" 
         tools:ignore="ContentDescription" /> 

        <TextView 
         android:id="@+id/editText1" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:ems="10" 
         android:gravity="center" 
         android:onClick="markets" 
         android:text="@string/bakeries" 
         android:textColor="@color/colorPrimaryDark" 
         android:textSize="18sp" 
         android:textStyle="bold" /> 

       </LinearLayout> 

       <LinearLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:orientation="vertical"> 

        <ImageButton 
         android:id="@+id/NeedTo" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:background="@drawable/need" 
         android:onClick="needto" 
         tools:ignore="ContentDescription" /> 

        <TextView 
         android:id="@+id/editText21" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:ems="10" 
         android:gravity="center" 
         android:onClick="markets" 
         android:text="@string/need_to" 
         android:textColor="@color/colorPrimaryDark" 
         android:textSize="18sp" 
         android:textStyle="bold" /> 
       </LinearLayout> 

      </LinearLayout> 


     </LinearLayout> 
    </LinearLayout> 


    <Space 
     android:layout_width="match_parent" 
     android:layout_height="50dp" /> 


    </LinearLayout> 


    </android.support.v4.widget.NestedScrollView > 

当地的build.gradle文件:

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.3" 
    useLibrary 'org.apache.http.legacy' 

    defaultConfig { 
     applicationId "com.ytubasi.zezo.zezomarket" 
     minSdkVersion 17 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner 
     "android.support.test.runner.AndroidJUnitRunner" 
     multiDexEnabled true 

    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 
     'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', 
    { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile files('libs/org.apache.http.legacy.jar') 

    compile 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.android.support:design:25.3.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.google.android.gms:play-services-maps:11.0.0' 
    compile 'com.google.android.gms:play-services-identity:11.0.0' 
    compile 'com.google.android.gms:play-services-drive:11.0.0' 
    compile 'com.google.android.gms:play-services-location:11.0.0' 
    compile 'com.google.android.gms:play-services-places:11.0.0' 
    compile 'com.android.volley:volley:1.0.0' 
    compile 'com.android.support:support-v4:25.3.1' 
    testCompile 'junit:junit:4.12' 
} 
+0

你可以发布你的本地build.gradle文件吗?此外,您是否安装了所有必需的7.0 SDK软件包,如Android SDK平台,Google API,Intel x86 Atom系统映像,Android模拟器,Android SDK工具和Android SDK平台工具? – DaveNOTDavid

+0

我会更新它,然后再回来 –

+0

好的,当你这样做的时候,让我知道! – DaveNOTDavid

回答

0

我发现图像按钮的Android 7.0和7.1坠毁时使用的XML图像作为背景

我cahnge所有图像背景PNG,做工精细

相关问题