From f04c49af74d2e76583fff92ce891f7a2fd528cf2 Mon Sep 17 00:00:00 2001 From: Mariotaku Lee Date: Wed, 15 Mar 2017 21:18:56 +0800 Subject: [PATCH] fixed crash on Nougat below --- build.gradle | 8 ++++++-- twidere/build.gradle | 14 +++++++------- .../mariotaku/twidere/service/StreamingService.kt | 4 +--- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index 91b21095a..3d8930111 100644 --- a/build.gradle +++ b/build.gradle @@ -34,7 +34,7 @@ subprojects { ext { libVersions = [ Kotlin : '1.1.1', - SupportLib : '25.2.0', + SupportLib : '25.3.0', MariotakuCommons: '0.9.11', RestFu : '0.9.42', ObjectCursor : '0.9.16', @@ -50,7 +50,11 @@ subprojects { LoganSquare : '1.3.7', IABv3 : '1.0.38', Mime4J : '0.7.2', - Stetho : '1.4.2' + Stetho : '1.4.2', + OSMDroid : '5.6.4', + LeakCanary : '1.5', + TwitterText : '1.14.3', + MediaViewerLibrary : '0.9.23' ] } diff --git a/twidere/build.gradle b/twidere/build.gradle index cd804e6d7..a62c91e94 100644 --- a/twidere/build.gradle +++ b/twidere/build.gradle @@ -36,8 +36,8 @@ android { applicationId "org.mariotaku.twidere" minSdkVersion 14 targetSdkVersion 25 - versionCode 300 - versionName '3.4.38' + versionCode 301 + versionName '3.4.39' multiDexEnabled true buildConfigField 'boolean', 'LEAK_CANARY_ENABLED', 'Boolean.parseBoolean("true")' @@ -113,12 +113,12 @@ dependencies { } // END Non-FOSS component - fdroidCompile 'org.osmdroid:osmdroid-android:5.6.4' + fdroidCompile "org.osmdroid:osmdroid-android:${libVersions['OSMDroid']}" debugCompile "com.facebook.stetho:stetho:${libVersions['Stetho']}" debugCompile "com.facebook.stetho:stetho-okhttp3:${libVersions['Stetho']}" debugCompile "com.facebook.stetho:stetho-js-rhino:${libVersions['Stetho']}" - debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5' + debugCompile "com.squareup.leakcanary:leakcanary-android:${libVersions['LeakCanary']}" debugCompile('com.jayway.jsonpath:json-path:2.2.0') { exclude group: 'net.minidev', module: 'json-smart' } @@ -141,7 +141,7 @@ dependencies { compile "com.android.support:customtabs:${libVersions['SupportLib']}" compile "com.android.support:design:${libVersions['SupportLib']}" compile "com.android.support:percent:${libVersions['SupportLib']}" - compile 'com.twitter:twitter-text:1.14.3' + compile "com.twitter:twitter-text:${libVersions['TwitterText']}" compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.squareup:otto:1.3.8' compile 'dnsjava:dnsjava:2.1.8' @@ -176,8 +176,8 @@ dependencies { compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar' compile 'jp.wasabeef:glide-transformations:2.0.1' - compile 'com.github.mariotaku.MediaViewerLibrary:base:0.9.23' - compile 'com.github.mariotaku.MediaViewerLibrary:subsample-image-view:0.9.23' + compile "com.github.mariotaku.MediaViewerLibrary:base:${libVersions['MediaViewerLibrary']}" + compile "com.github.mariotaku.MediaViewerLibrary:subsample-image-view:${libVersions['MediaViewerLibrary']}" compile 'com.github.mariotaku:SQLiteQB:0.9.12' compile "com.github.mariotaku.ObjectCursor:core:${libVersions['ObjectCursor']}" compile 'com.github.mariotaku:MultiValueSwitch:0.9.7' diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/service/StreamingService.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/service/StreamingService.kt index e9a4756c8..6bbb98b22 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/service/StreamingService.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/service/StreamingService.kt @@ -76,9 +76,7 @@ class StreamingService : BaseService() { } override fun onDestroy() { - submittedTasks.forEach { _, future -> - future.cancel() - } + submittedTasks.values.forEach { it.cancel() } threadPoolExecutor.shutdown() submittedTasks.clear() removeNotification()