Reputation: 151
App is getting crashed after launch throwing following error if we put GCM sender id in airshipconfig.properties file used in case of urban airship pushnotification.
Error:
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)
gradle file:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven {
url 'https://maven.fabric.io/public'
}
maven { url "https://urbanairship.bintray.com/android" }
maven { url "https://jitpack.io" }
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.0 rc2"
defaultConfig {
applicationId "com.samachar.newskannada"
minSdkVersion 14
targetSdkVersion 22
versionCode 2
versionName "1.0"
}
buildTypes {
debug {
buildConfigField 'String', 'CONTAINER_ID', '"containedid"' //Development
buildConfigField 'boolean', 'GTM_VERBOSE_ENABLE', 'true'
buildConfigField 'String', 'APP_KEY', '"appkey"'
minifyEnabled false
shrinkResources false
}
release {
buildConfigField 'String', 'CONTAINER_ID', '"GTM_id"' //Development
buildConfigField 'boolean', 'GTM_VERBOSE_ENABLE', 'true'
buildConfigField 'String', 'APP_KEY', '"appkey"'
//progard
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.5.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.github.bumptech.glide:glide:3.6.0'
// Urban Airship SDK
compile 'com.urbanairship.android:urbanairship-sdk:7.0.+'
// Recommended for in-app messaging
compile 'com.android.support:cardview-v7:23.1.1'
// Recommended for location services
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}
compile project(':Volley')
compile 'com.github.ybq:Android-SpinKit:1.0.2'
compile "com.squareup.picasso:picasso:2.4.0"
compile 'com.github.amlcurran.showcaseview:library:5.4.3'
compile "org.jsoup:jsoup:1.8.1"
}
Can anyone help me with this problem?
Upvotes: 0
Views: 468
Reputation: 4960
The error was the file created with File getFilesDir ()
, returns the absolute path to the directory on the filesystem where files created with openFileOutput(String, int)
are stored.
The returned path may change over time if the calling app is moved to an adopted storage device, so only relative paths should be persisted.
The getNoBackupFilesDir
was found in android.support.v4.content.ContextCompat
. Seems that the problem was that an old appcompat-v7 included in the project.
Try to download with the SDK manager the latest version of Android Support Library and then follow the steps for Adding libraries with resources and add the library to your application project.
Upvotes: 0