Hello I hope someone can help me here.
I′m working on an application which uses UrbanAirship to receive PushNotifications
.
My Problem is that, since this morning, my app crashes when initializing UrbanAirship with takeOff.
I′m using Android Studio v2.1.1(stable) and updated my Build and Platform-Tools to use the most current version(s). After the crash occurred I tested if it is caused by the new Tools by using an older Version of these Tools and different Android Studio versions (2.0, 1.3 and 1.5). So I′m sure that should not be the Problem.
Here is the Code I′m using and the Stack Trace from my LogCat:
UAirship.takeOff(this, Config.getOptions(), mAirshipReadyCallback);
getOptions returns the following:
public static AirshipConfigOptions getOptions() {
return new AirshipConfigOptions.Builder()
.setDevelopmentAppKey("Key")
.setDevelopmentAppSecret("Secret")
.setProductionAppKey("Key")
.setProductionAppSecret("Secret")
.setInProduction(!BuildConfig.DEBUG)
.setGcmSender("Sender")
.setProductionLogLevel(3).build();
}
And my Callback is the following:
private UAirship.OnReadyCallback mAirshipReadyCallback = new UAirship.OnReadyCallback() {
@Override
public void onAirshipReady(UAirship uAirship) {
DefaultNotificationFactory notificationFactory;
notificationFactory = new DefaultNotificationFactory(getApplicationContext());
notificationFactory.setSmallIconId(R.drawable.ic_push);
notificationFactory.setLargeIcon(R.drawable.ic_launcher);
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
notificationFactory.setColor(getColor(R.color.main_list_item_text_enabled));
} else {
notificationFactory.setColor(getResources().getColor(R.color.main_list_item_text_enabled));
}
} catch (Resources.NotFoundException ex) {
Timber.e(ex.getCause(), ex.getMessage());
notificationFactory.setColor(Color.parseColor("0e457e"));
}
// Enable user notifications
Timber.i("Enable Airship!");
Timber.i("UAirship ChannelId: " + UAirship.shared().getPushManager().getChannelId());
uAirship.getPushManager().setNotificationFactory(notificationFactory);
uAirship.getPushManager().setUserNotificationsEnabled(true);
}
};
Finally the StackTrace:
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.zzeb(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.urbanairship.push.GcmRegistrar.register(GcmRegistrar.java:62)
at com.urbanairship.push.ChannelServiceDelegate.onUpdatePushRegistration(ChannelServiceDelegate.java:174)
at com.urbanairship.push.ChannelServiceDelegate.onHandleIntent(ChannelServiceDelegate.java:110)
at com.urbanairship.BaseIntentService.onHandleIntent(BaseIntentService.java:103)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.os.HandlerThread.run(HandlerThread.java:61)
Yesterday everything worked fine and I did not update any libraries I′m using.
Thank you in advance, greetings :)
Edit
Here are my gradle dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
maven { url 'https://repo.commonsware.com.s3.amazonaws.com' }
maven { url 'https://urbanairship.bintray.com/android' }
maven { url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2' }
}
compile('com.urbanairship.android:urbanairship-sdk:7.1.3') {
exclude group: 'com.google.android.support', module: 'support-v4'
exclude group: 'com.google.android.gms', module: 'play-services-gcm'
transitive = true
}
compile('de.keyboardsurfer.android.widget:crouton:1.8.5@aar') {
exclude group: 'com.google.android.support', module: 'support-v4'
transitive = true
}
compile('com.facebook.android:facebook-android-sdk:4.8.1') {
exclude group: 'com.google.android.support', module: 'support-v4'
}
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-v4:23.3.0'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.squareup.okhttp:logging-interceptor:2.6.0'
compile 'com.google.code.gson:gson:2.4'
compile 'com.jakewharton:butterknife:5.1.1'
compile 'com.jakewharton.timber:timber:4.1.1'
compile 'commons-io:commons-io:2.4'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') {
transitive = true;
}
compile 'org.xwalk:xwalk_core_library:16.45.421.19'
compile 'com.amplitude:android-sdk:2.5.0'
}
Edit 2
I also tried to use the UrbanAirship-SDK Version 6.4.1 without excluding google.gms and the android support libraries, without any effect.
Furthermore I updated every possible dependency inside my gradle use the newest version (just the changed):
compile'com.urbanairship.android:urbanairship-sdk:7.1.3'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
still no change
See Question&Answers more detail:
os