From d193b282f1de179be2ef6f851d90117d4a20d0b4 Mon Sep 17 00:00:00 2001 From: timo Date: Wed, 5 Jan 2022 19:36:03 +0100 Subject: [PATCH] target sdk 30 and adapt code, so we can deploy to play store --- sudoq-app/sudoqapp/build.gradle | 4 ++-- .../de/sudoq/controller/menus/SplashActivity.kt | 13 ++++++++----- .../sudoq/controller/menus/SudokuLoadingActivity.kt | 9 ++++++--- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/sudoq-app/sudoqapp/build.gradle b/sudoq-app/sudoqapp/build.gradle index 79d0e71f..20883f4c 100644 --- a/sudoq-app/sudoqapp/build.gradle +++ b/sudoq-app/sudoqapp/build.gradle @@ -9,12 +9,12 @@ allprojects { } android { - compileSdkVersion 29 + compileSdkVersion 30 defaultConfig { applicationId "de.sudoq" minSdkVersion 14 - targetSdkVersion 29 + targetSdkVersion 30 resConfigs "en", "de", "fr" testApplicationId "de.sudoq.test" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/sudoq-app/sudoqapp/src/main/kotlin/de/sudoq/controller/menus/SplashActivity.kt b/sudoq-app/sudoqapp/src/main/kotlin/de/sudoq/controller/menus/SplashActivity.kt index bb0fd9f3..bee64817 100644 --- a/sudoq-app/sudoqapp/src/main/kotlin/de/sudoq/controller/menus/SplashActivity.kt +++ b/sudoq-app/sudoqapp/src/main/kotlin/de/sudoq/controller/menus/SplashActivity.kt @@ -88,7 +88,7 @@ class SplashActivity : SudoqCompatActivity() { try { currentVersionName = this.packageManager.getPackageInfo(this.packageName, 0).versionName } catch (e: PackageManager.NameNotFoundException) { - Log.v(LOG_TAG, e.message) + e.message?.let { Log.v(LOG_TAG, it) } } /* is this a new version? */ @@ -312,7 +312,7 @@ class SplashActivity : SudoqCompatActivity() { try { files = assets.list(relPath) } catch (e: IOException) { - Log.e(LOG_TAG, e.message) + e.message?.let { Log.e(LOG_TAG, it) } } return files } @@ -336,9 +336,12 @@ class SplashActivity : SudoqCompatActivity() { `in`.close() out.flush() out.close() - } catch (e: Exception) { - Log.e(LOG_TAG, e.message) - Log.e(LOG_TAG, "there seems to be an exception") + } catch (e: IOException) { + e.message?.let { Log.e(LOG_TAG, it) } + Log.e(LOG_TAG, "there seems to be an io exception") + } catch (e: FileNotFoundException) { + e.message?.let { Log.e(LOG_TAG, it) } + Log.e(LOG_TAG, "there seems to be a file not found exception") } } diff --git a/sudoq-app/sudoqapp/src/main/kotlin/de/sudoq/controller/menus/SudokuLoadingActivity.kt b/sudoq-app/sudoqapp/src/main/kotlin/de/sudoq/controller/menus/SudokuLoadingActivity.kt index 5a080c1c..4b016c45 100644 --- a/sudoq-app/sudoqapp/src/main/kotlin/de/sudoq/controller/menus/SudokuLoadingActivity.kt +++ b/sudoq-app/sudoqapp/src/main/kotlin/de/sudoq/controller/menus/SudokuLoadingActivity.kt @@ -303,9 +303,12 @@ class SudokuLoadingActivity : SudoqListActivity(), OnItemClickListener, OnItemLo `in`.close() out.flush() out.close() - } catch (e: Exception) { - Log.e(LOG_TAG, e.message) - Log.e(LOG_TAG, "there seems to be an exception") + } catch (e: IOException) { + e.message?.let { Log.e(LOG_TAG, it) } + Log.e(LOG_TAG, "there seems to be an io exception") + } catch (e: FileNotFoundException) { + e.message?.let { Log.e(LOG_TAG, it) } + Log.e(LOG_TAG, "there seems to be a file not found exception") } Log.v("file-share", "tmpfile: " + tmpFile.absolutePath) Log.v("file-share", "gamefile is null? " + (gameFile == null))