我安装了lara Pushwoosh所需的等级,但给出了错误。
我想到了configuration.all,但是这次发生这种冲突的地方是其他地方。
等级如下:

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "test"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'),      'proguard-rules.pro'
    }
}
repositories {
    jcenter()
    maven {
        url "https://jitpack.io"
    }
}

}

dependencies {
   compile fileTree(dir: 'libs', include: ['*.jar'])
   testCompile 'junit:junit:4.12'
   compile 'com.google.gms:google-services:3.0.0'
   compile 'com.android.support:appcompat-v7:23.4.0'
   compile 'com.android.support:recyclerview-v7:23.4.0'
   compile 'com.android.support:design:23.4.0'
   compile 'com.nineoldandroids:library:2.4.0'
   compile 'com.android.support:support-v4:23.4.0'

   compile 'com.pushwoosh:pushwoosh:+'
   compile 'com.google.android.gms:play-services:9.0.0'
   compile 'com.google.android.gms:play-services-location:8.4.0+'
   compile 'com.google.android.gms:play-services-gcm:8.4.0+'
   compile 'org.greenrobot:eventbus:3.0.0'
}

从这个错误:
09-19 23:02:19.291 23449-24503/com.jvr.meb360.ogretmen E/CustomActivityOnCrash: App has crashed, executing CustomActivityOnCrash's UncaughtExceptionHandler
                                                                            java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar)
                                                                                at com.google.android.gms.iid.zzd.zzeC(Unknown Source)
                                                                                at com.google.android.gms.iid.zzd.<init>(Unknown Source)
                                                                                at com.google.android.gms.iid.zzd.<init>(Unknown Source)
                                                                                at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
                                                                                at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
                                                                                at com.pushwoosh.GCMRegistrationService.a(Unknown Source)
                                                                                at com.pushwoosh.GCMRegistrationService.onHandleIntent(Unknown Source)

请帮我

更新

问题解决了。等级如下:
    android {
compileSdkVersion 24
buildToolsVersion "23.0.3"


defaultConfig {
    applicationId "MyBundle"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
repositories {

    maven {
        url "https://jitpack.io"
    }
}
}
dependencies {
  compile 'com.android.support:appcompat-v7:24+'
  compile 'com.android.support:design:24.2.1'
  compile 'com.android.support:cardview-v7:24.2.1'
  compile 'com.android.support:recyclerview-v7:24.2.1'
  compile 'com.android.support:support-v4:24.2.1'
  compile 'com.android.support:support-annotations:24.2.1'
  compile 'com.google.android.gms:play-services:9.6.1'
  compile 'com.pushwoosh:pushwoosh:4.8.4'
  compile 'com.google.android.gms:play-services-location:9.6.1'
  compile 'com.google.android.gms:play-services-gcm:9.6.1'
  compile 'com.google.firebase:firebase-messaging:9.0.0'
  compile 'com.squareup.okhttp3:okhttp:3.2.0'
}
apply plugin: 'com.google.gms.google-services'

类路径:
    dependencies {
      classpath 'com.android.tools.build:gradle:2.2.0'
      classpath 'com.google.gms:google-services:3.0.0'
      // NOTE: Do not place your application dependencies here; they belong
      // in the individual module build.gradle files
     }

最佳答案

您需要将Android SDK更新到最新版本:Google Play服务库和Google支持库。

关于android - android pushwoosh他方法'java.io.File android.support.v4.content.ContextCompat,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39581282/

10-09 09:09