关于崩溃的任何想法 - 只发生在setContentView上的一个特定设备MI 4中。未找到的资源是android资源。此外,我们的代码中没有任何动画,但看起来像是由android执行的。
我尝试在源代码和生成的文件中搜索 linear_out_slow_in 但只能在一个生成的文件中找到 - mockable-android-25.jar
请注意,应用程序在我们拥有的20多个测试设备和435个其他客户设备上运行良好。这个问题尤其适用于MI 4设备。
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2661)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2722)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6114)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:874)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:764)
Caused by: android.content.res.Resources$NotFoundException: File res/interpolator/linear_out_slow_in.xml from xml type anim resource ID #0x10c000e
at android.content.res.ResourcesImpl.loadXmlResourceParser(ResourcesImpl.java:1018)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2125)
at android.content.res.Resources.getAnimation(Resources.java:1153)
at android.view.animation.AnimationUtils.loadInterpolator(AnimationUtils.java:275)
at com.android.internal.policy.DecorView.<init>(DecorView.java:235)
at com.android.internal.policy.PhoneWindow.generateDecor(PhoneWindow.java:2342)
at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:2680)
at com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:2051)
at android.support.v7.app.n.x(SourceFile:3379)
at android.support.v7.app.n.b(SourceFile:289)
at android.support.v7.app.f.setContentView(SourceFile:140)
at com.qualto.android.activities.MainActivity.onCreate(SourceFile:127)
at android.app.Activity.performCreate(Activity.java:6736)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2614)
以下是查看xml导致崩溃
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:fitsSystemWindows="true">
<include layout="@layout/include_list_viewpager"/>
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/navigation_header"
app:menu="@menu/navigation_drawer"/>
</android.support.v4.widget.DrawerLayout>
Gradle文件
apply plugin: 'com.android.application'
ext {
PUBLISH_VERSION = '1.0.1'
VERSION_CODE = 10
SUPPORTLIB_VER = '25.3.1'
PLAYSERVICE_VER = '10.2.0'
}
android {
signingConfigs {
//removed
}
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.qualto.android"
minSdkVersion 14
targetSdkVersion 22
versionCode project.VERSION_CODE
versionName project.PUBLISH_VERSION
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude '.readme'
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
//buildConfigField "boolean", "DEBUG", "true"
//minifyEnabled true
//shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
aidl.srcDirs = ['src/main/aidl']
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:appcompat-v7:${project.SUPPORTLIB_VER}"
compile "com.android.support:support-v4:${project.SUPPORTLIB_VER}"
compile "com.android.support:recyclerview-v7:${project.SUPPORTLIB_VER}"
compile "com.android.support:cardview-v7:${project.SUPPORTLIB_VER}"
compile "com.android.support:support-annotations:${project.SUPPORTLIB_VER}"
compile "com.android.support:design:${project.SUPPORTLIB_VER}"
compile 'com.google.code.gson:gson:2.7'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile "com.google.android.gms:play-services-gcm:${project.PLAYSERVICE_VER}"
}