应用程序崩溃在Android 4.1.2和工作在Android 5.0.1完成

时间:2015-11-25 09:13:10

标签: android android-layout appcompat-v7-r22.2

我的应用程序正在使用android 5.1.1并在虚拟设备android 4.1.1中运行应用程序

我收到了这个错误

java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$layout
                                                           at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:324)
                                                           at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:246)
                                                           at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106)
                                                           at done.ui.MainActivity.onCreate(MainActivity.java:42)
                                                           at android.app.Activity.performCreate(Activity.java:5008)
                                                           at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
                                                           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
                                                           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
                                                           at android.app.ActivityThread.access$600(ActivityThread.java:130)
                                                           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
                                                           at android.os.Handler.dispatchMessage(Handler.java:99)
                                                           at android.os.Looper.loop(Looper.java:137)
                                                           at android.app.ActivityThread.main(ActivityThread.java:4745)
                                                           at java.lang.reflect.Method.invokeNative(Native Method)
                                                           at java.lang.reflect.Method.invoke(Method.java:511)
                                                           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
                                                           at dalvik.system.NativeStart.main(Native Method)

我的傻瓜

apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "done.ui"
    minSdkVersion 15
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
//compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/PayPalAndroidSDK-2.11.2.jar')
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:recyclerview-v7:22.1.1'
compile 'com.android.support:design:22.2.0'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.facebook.android:facebook-android-sdk:4.2.0'
compile 'com.pubnub:pubnub-android:3.7.4'
compile 'com.amazonaws:aws-android-sdk-core:2.+'
compile 'com.android.support:cardview-v7:22.1.1'
compile 'com.amazonaws:aws-android-sdk-ddb:2.+'
compile 'com.amazonaws:aws-android-sdk-ddb-mapper:2.+'
compile 'com.github.ksoichiro:android-observablescrollview:1.5.0'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.github.kanytu:android-parallax-recyclerview:v1.4'
compile 'com.google.android.gms:play-services-ads:8.3.0'
compile 'com.google.android.gms:play-services-identity:8.3.0'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
}

repositories {
maven {
    url "https://jitpack.io"
}
}

这是主要活动.xml 主要活动中出现此错误的错误是什么

    <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"
tools:context=".MainActivity"
>
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    >
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">
    <include
        android:id="@+id/app_toolbar"
        layout="@layout/app_toolbar" />

    <done.ui.tabs.SlidingTabLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="10dp"
        android:background="@color/primaryColor"
        android:paddingBottom="5dp"
        android:paddingTop="5sp" />

    <android.support.v4.view.ViewPager
        android:id="@+id/pager"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />

</LinearLayout>
    <!--<com.github.clans.fab.FloatingActionButton-->
        <!--android:id="@+id/fab"-->
        <!--android:layout_width="wrap_content"-->
        <!--android:layout_height="wrap_content"-->
        <!--android:src="@drawable/ic_add_white_24dp"-->
        <!--app:fab_colorNormal="@color/accent"-->
        <!--android:layout_marginLeft="16dp"-->
        <!--android:layout_marginBottom="16dp"-->
        <!--app:fab_colorPressed="@color/accent_pressed"-->
        <!--app:fab_colorRipple="@color/ripple"-->
        <!--android:layout_alignParentBottom="true"-->
        <!--android:layout_alignParentLeft="true"-->
        <!--android:layout_alignParentStart="true" />-->
    <android.support.design.widget.FloatingActionButton
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_add_white_24dp"
        app:fabSize="normal"
        app:elevation="4dp"
        app:borderWidth="0dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentBottom="true"
        android:layout_marginLeft="16dp"
        android:layout_marginBottom="16dp"
        app:backgroundTint="@color/accent_pressed"
        />

</RelativeLayout>
<fragment
    android:id="@+id/fragment_navigation_drawer"
    android:name="done.ui.NavigationDrawer.FragmentDrawer"
    android:layout_width="@dimen/nav_drawer_width"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    app:layout="@layout/fragment_navigation_drawer"
    tools:layout="@layout/fragment_navigation_drawer" />

0 个答案:

没有答案