从这个错误开始我的应用程序崩溃了:
FATAL EXCEPTION: main
Process: com.shotguntheapp.android, PID: 32127
java.lang.NoSuchMethodError: No static method setOnApplyWindowInsetsListener(Landroid/view
at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImpl
at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImpl
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImpl
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:143)
at com.shotguntheapp.android.Activities.MainActivity.onCreate(MainActivity.java:45)
at android.app.Activity.performCreate(Activity.java:6289)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2446)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2576)
at android.app.ActivityThread.access$1000(ActivityThread.java:155)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5539)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
我已经完成了一些研究,发现所有人都给了我相同的答案:我必须升级所有依赖项。不幸的是,我的android依赖项都是最新版本。 这是我的App Gradle脚本:
apply plugin: 'com.android.application'
//apply plugin: 'io.fabric'
android {
compileSdkVersion 25
buildToolsVersion '25.0.1'
defaultConfig {
applicationId "com.shotguntheapp.android"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "6.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
staging {
applicationId "com.shotguntheapp.android.staging"
versionName "6.0-staging"
}
production {
applicationId "com.shotguntheapp.android"
versionName "6.0"
}
}
}
//buildscript {
// repositories {
// jcenter()
// mavenCentral()
// maven { url 'https://maven.fabric.io/public' }
// }
// dependencies {
// classpath 'com.android.tools.build:gradle:1.5.0'
// // The Fabric Gradle plugin uses an open ended version to react
// // quickly to Android tooling updates
// classpath 'io.fabric.tools:gradle:1.+'
// }
//}
repositories {
flatDir {
dirs 'libs'
}
maven {
url "https://jitpack.io"
}
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven {
url "http://maven.batch.com/release"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile project('libs:paymentkit')
compile project('libs:materiallockview')
// compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
// transitive = true;
// }
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:design:25.0.1'
compile 'com.android.support:support-v4:25.0.1'
compile 'com.android.support:support-annotations:25.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.daprlabs.aaron:swipedeck:2.0.6'
compile 'com.mcxiaoke.volley:library-aar:1.0.1'
compile 'com.facebook.rebound:rebound:0.3.8'
compile 'com.wefika:horizontal-picker:1.1.1'
compile 'com.mixpanel.android:mixpanel-android:4.6.4'
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.google.android.gms:play-services-plus:10.0.1'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.google.android.gms:play-services-gcm:10.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.android.gms:play-services-location:10.0.1'
compile 'com.stripe:stripe-android:+'
compile 'com.orhanobut:dialogplus:1.11@aar'
compile 'com.facebook.fresco:fresco:0.14.1'
compile 'com.facebook.shimmer:shimmer:0.1.0@aar'
compile 'com.parse:parse-android:1.+'
compile 'com.google.code.gson:gson:2.4'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'io.smooch:core:latest.release'
compile 'io.smooch:ui:latest.release'
compile 'jp.wasabeef:fresco-processors:2.0.0'
compile 'com.batch.android:batch-sdk:1.5.+'
compile 'io.branch.sdk.android:library:1.+'
compile 'io.card:android-sdk:5.3.0'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.11'
compile 'cn.trinea.android.view.autoscrollviewpager:android-auto-scroll-view-pager:1.1.2'
compile 'com.google.code.gson:gson:2.4'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
感谢您的帮助!