androidgradlepush-notificationpushwoosh

android pushwoosh he method 'java.io.File android.support.v4.content.ContextCompat


I installed the required grade for lara Pushwoosh but that gives an error. I figured configurations.all but this time with such a conflict is happening elsewhere. Grade as follows:

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'
}

from this error:

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)

Please help me

UPDATE

The problem was solved. A grade were as follows:

    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'

classpath:

    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
     }

Solution

  • You need to update your Android SDK to the latest version: Google Play Services Library and Google Support Library.