应用程序在setContentView android上崩溃,没有堆栈跟踪

应用程序在setContentView android上崩溃,没有堆栈跟踪,android,android-layout,android-manifest,build.gradle,Android,Android Layout,Android Manifest,Build.gradle,应用程序在执行行setContentView(R.layout.activity\u main)时崩溃在我的手机中三星galaxy s4安卓5.0定制版工作正常。但我尝试了另外3款(安卓4.0+)手机,bluestack it应用程序崩溃 我无法跟踪我的应用程序中错误的错误。没有异常的堆栈跟踪,应用程序只是崩溃并静默关闭。 任何帮助 问题不在于布局文件,因为它只能在我的手机上正常工作 布局是抽屉布局和使用片段 这是build.gradel apply plugin: 'com.android.a

应用程序在执行行
setContentView(R.layout.activity\u main)时崩溃在我的手机中三星galaxy s4安卓5.0定制版工作正常。但我尝试了另外3款(安卓4.0+)手机,bluestack it应用程序崩溃

我无法跟踪我的应用程序中错误的错误。没有异常的堆栈跟踪,应用程序只是崩溃并静默关闭。 任何帮助

问题不在于布局文件,因为它只能在我的手机上正常工作

布局是抽屉布局和使用片段

这是build.gradel

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "com.iorzb.malik.proximity"
    minSdkVersion 17
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.0'
    compile 'com.android.support:design:23.2.0'
    compile 'com.google.android.gms:play-services:8.1.0'
    compile 'com.google.android.gms:play-services-location:7.5.0'
    compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
    compile files('libs/your jar volley.jar')
    compile 'com.google.code.gson:gson:2.6.2'
}
这是清单文件

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.iorzb.malik.proximity"
    android:versionCode="1"
    android:versionName="1.0">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

<application
    android:name=".Help.AppController"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name=".MainActivity"
        android:configChanges="orientation|keyboardHidden"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>



</application>

这个问题是在谷歌图书馆

compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
请删除所有v7:23.2.0并安装任何其他版本。您的代码将自动运行。 换衣服

compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'

希望你能解决你的问题。

我找到了解决办法。我刚刚从nav\u header\u main.xml中删除了图像视图

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout `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:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:openDrawer="start">

    <include
        layout="@layout/app_bar_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <FrameLayout
            android:id="@+id/container_body"
            android:layout_width="fill_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />


    </LinearLayout>
    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header_main"
        app:menu="@menu/activity_main_drawer" />

</android.support.v4.widget.DrawerLayout>
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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"
    android:fitsSystemWindows="true"
    tools:context="com.iorzb.malik.proximity.MainActivity">
    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">
        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay" />
    </android.support.design.widget.AppBarLayout>
    <include layout="@layout/content_main" />
</android.support.design.widget.CoordinatorLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="@dimen/nav_header_height"
    android:background="@drawable/side_nav_bar"
    android:gravity="bottom"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:theme="@style/ThemeOverlay.AppCompat.Dark">

    <ImageView
        android:id="@+id/imageView"
        android:background="@drawable/round_corner"
        android:layout_marginTop="20dp"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="fitXY"
        android:paddingTop="@dimen/nav_header_vertical_spacing"
        android:src="@drawable/logo_proximity" />

</LinearLayout>
<ImageView
    android:id="@+id/imageView"
    android:background="@drawable/round_corner"
    android:layout_marginTop="20dp"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scaleType="fitXY"
    android:paddingTop="@dimen/nav_header_vertical_spacing"
    android:src="@drawable/logo_proximity" />

它工作得很好。我不知道它是怎么工作的。有人能说出这个图像视图中的错误吗,
或者缺少任何内容。

您应该发布xml布局和活动代码。如果它在android 5.0上运行,并不意味着你的布局xml没有bug,没有logcat报告,应用程序不会崩溃。也许你遗漏了什么。我在这里添加了xml和java代码。感谢您的回复。@MalikRizwan您使用Vector Drawables吗?我删除了工具栏,然后尝试了一下,但运气不好。请检查我的更新答案,希望这对您有所帮助。问题是android:background=“@drawable/round_corner”行中的drawable xml
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
<ImageView
    android:id="@+id/imageView"
    android:background="@drawable/round_corner"
    android:layout_marginTop="20dp"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scaleType="fitXY"
    android:paddingTop="@dimen/nav_header_vertical_spacing"
    android:src="@drawable/logo_proximity" />