Notification wirft Fehler bei der Verwendung von Vektor-Drawables
Ich erhalte die folgende Ausnahme, wenn ich einen Vektor verwende, mit dem das kleine Symbol für eine Benachrichtigung gezeichnet werden kann:
android.app.RemoteServiceException: Ungültige Benachrichtigung vom Paket com.qbes.xxx gesendet: Symbol konnte nicht erstellt werden: StatusBarIcon (pkg = com.qbes.xxxuser = 0 id = 0x7f020082 level = 0 visible = true num = 0)
Hier ist mein Code:
mNotificationBuilder = new android.support.v4.app.NotificationCompat.Builder(this)
.setDefaults(android.support.v4.app.NotificationCompat.DEFAULT_LIGHTS)
.setSound(null)
.setSmallIcon(R.drawable.logo_white)
.setColor(getResources().getColor(R.color.colorPrimary))
.setCategory(android.support.v4.app.NotificationCompat.CATEGORY_PROGRESS)
.setContentTitle("Trip in Progress...")
.setAutoCancel(false)
.setProgress(0, 0, progress)
.setOngoing(true)
.setPriority(android.support.v4.app.NotificationCompat.PRIORITY_MAX)
.setOnlyAlertOnce(true)
.setContentIntent(pendingIntent);
mNotificationBuilder.setContentText(body);
mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Notification note = mNotificationBuilder.build();
mNotificationManager.notify(Constants.NOTIFICATION_ID_Dash, note);
und meinbuild.gradle
(nur relevante Teile):
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.qbes.xxx"
minSdkVersion 16
targetSdkVersion 22
versionCode 720
versionName "0.7.20"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
}
PS: Der Code funktioniert einwandfrei, wenn ich ein PNG- oder JPG-Bild zeichne, bricht jedoch ab, wenn ich einen Vektor zeichne.
Ich habe einen ganzen Tag lang gesucht, aber nichts gefunden, was für mich funktioniert hat. Irgendwelche Ideen