From 6c8a79387b75ab08fed2a9e2b07b1467adfd0bc5 Mon Sep 17 00:00:00 2001 From: LivingWithHippos Date: Thu, 7 Dec 2023 12:56:50 +0100 Subject: [PATCH] updated libraries to fix build errors --- .github/workflows/build.yaml | 46 ++++++++++++------- app/app/build.gradle | 2 + .../view/AuthenticationFragment.kt | 2 +- .../utilities/extension/ViewExtension.kt | 4 +- app/build.gradle | 4 +- app/gradle/wrapper/gradle-wrapper.properties | 2 +- app/versions.gradle | 4 +- 7 files changed, 40 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index df45edde..ad6f5da2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -8,7 +8,7 @@ on: - master defaults: run: - # github does not appreciate ~ as home indicator. Prefer the full path. + # github does not appreciate ~ as home indicator. Prefer the full path. working-directory: /home/runner/work/unchained-android/unchained-android/app jobs: lint-release: @@ -17,6 +17,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - name: Setup + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' - name: Run tests run: ./gradlew ktfmtCheck build: @@ -24,41 +29,50 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - name: Setup + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' - name: Retrieve keystore for apk signing env: - ENCODED_KEYSTORE: ${{ secrets.KEYSTORE }} + ENCODED_KEYSTORE: ${{ secrets.KEYSTORE }} run: echo "$ENCODED_KEYSTORE" | base64 --decode > /home/runner/work/unchained-android/unchained-android/app/release.pfk - name: Build the app env: - KEYSTORE: /home/runner/work/unchained-android/unchained-android/app/release.pfk - KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} - KEY_ALIAS: ${{ secrets.KEY_ALIAS }} - KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + KEYSTORE: /home/runner/work/unchained-android/unchained-android/app/release.pfk + KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} run: ./gradlew clean assembleRelease --stacktrace - name: Save apk uses: actions/upload-artifact@v3 with: - name: apk - path: /home/runner/work/unchained-android/unchained-android/app/app/build/outputs/apk/release/*.apk + name: apk + path: /home/runner/work/unchained-android/unchained-android/app/app/build/outputs/apk/release/*.apk build-debug: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 + - name: Setup + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' - name: Retrieve keystore for apk signing env: - ENCODED_KEYSTORE: ${{ secrets.KEYSTORE }} + ENCODED_KEYSTORE: ${{ secrets.KEYSTORE }} run: echo "$ENCODED_KEYSTORE" | base64 --decode > /home/runner/work/unchained-android/unchained-android/app/release.pfk - name: Build the app env: - KEYSTORE: /home/runner/work/unchained-android/unchained-android/app/release.pfk - KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} - KEY_ALIAS: ${{ secrets.KEY_ALIAS }} - KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + KEYSTORE: /home/runner/work/unchained-android/unchained-android/app/release.pfk + KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} run: ./gradlew clean assembleDebug --stacktrace - name: Save apk uses: actions/upload-artifact@v3 with: - name: apk-debug - path: /home/runner/work/unchained-android/unchained-android/app/app/build/outputs/apk/debug/*.apk - + name: apk-debug + path: /home/runner/work/unchained-android/unchained-android/app/app/build/outputs/apk/debug/*.apk diff --git a/app/app/build.gradle b/app/app/build.gradle index 7b3c4dba..8a0966fd 100644 --- a/app/app/build.gradle +++ b/app/app/build.gradle @@ -45,6 +45,7 @@ ktfmt { } android { + namespace "com.github.livingwithhippos.unchained" compileSdk 34 @@ -158,6 +159,7 @@ android { buildFeatures { dataBinding true + buildConfig true } compileOptions { diff --git a/app/app/src/main/java/com/github/livingwithhippos/unchained/authentication/view/AuthenticationFragment.kt b/app/app/src/main/java/com/github/livingwithhippos/unchained/authentication/view/AuthenticationFragment.kt index dc9763b4..9f2b2c97 100644 --- a/app/app/src/main/java/com/github/livingwithhippos/unchained/authentication/view/AuthenticationFragment.kt +++ b/app/app/src/main/java/com/github/livingwithhippos/unchained/authentication/view/AuthenticationFragment.kt @@ -184,7 +184,7 @@ class AuthenticationFragment : UnchainedFragment(), ButtonListener { val link = SpannableString(getString(R.string.this_link)) link.setSpan(UnderlineSpan(), 0, link.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) - val colorSecondary = requireContext().getThemeColor(R.attr.colorSecondary) + val colorSecondary = requireContext().getThemeColor(com.google.android.material.R.attr.colorSecondary) link.setSpan( ForegroundColorSpan(colorSecondary), 0, diff --git a/app/app/src/main/java/com/github/livingwithhippos/unchained/utilities/extension/ViewExtension.kt b/app/app/src/main/java/com/github/livingwithhippos/unchained/utilities/extension/ViewExtension.kt index ef85720e..e6d4f8d2 100644 --- a/app/app/src/main/java/com/github/livingwithhippos/unchained/utilities/extension/ViewExtension.kt +++ b/app/app/src/main/java/com/github/livingwithhippos/unchained/utilities/extension/ViewExtension.kt @@ -332,12 +332,12 @@ fun SwipeRefreshLayout.setRefreshThemeColor(themed: Boolean) { // get a reference to the current theme val typedValue = TypedValue() val theme: Resources.Theme = context.theme - theme.resolveAttribute(R.attr.colorSurface, typedValue, true) + theme.resolveAttribute(com.google.android.material.R.attr.colorSurface, typedValue, true) // arrow color val arrowColor = typedValue.data // this function accept a number of colors, the refresh indicator will rotate between them. setColorSchemeColors(arrowColor) - theme.resolveAttribute(R.attr.colorPrimary, typedValue, true) + theme.resolveAttribute(com.google.android.material.R.attr.colorPrimary, typedValue, true) // background color val backgroundColor = typedValue.data setProgressBackgroundColorSchemeColor(backgroundColor) diff --git a/app/build.gradle b/app/build.gradle index 0c45a74e..239eef68 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,7 +4,7 @@ buildscript { ext { versions_plugin_version = '0.50.0' - kotlin_version = '1.8.22' + kotlin_version = '1.9.20' } repositories { @@ -27,7 +27,7 @@ buildscript { plugins { id "com.github.ben-manes.versions" version "$versions_plugin_version" - id 'org.jetbrains.kotlin.android' version '1.8.22' apply false + id 'org.jetbrains.kotlin.android' version '1.9.20' apply false } allprojects { diff --git a/app/gradle/wrapper/gradle-wrapper.properties b/app/gradle/wrapper/gradle-wrapper.properties index ac047aba..81b32e53 100644 --- a/app/gradle/wrapper/gradle-wrapper.properties +++ b/app/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sun Jun 05 12:13:53 CEST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/app/versions.gradle b/app/versions.gradle index 9100c04a..8934ed42 100644 --- a/app/versions.gradle +++ b/app/versions.gradle @@ -1,6 +1,6 @@ def versions = [:] versions.aboutlibraries = "10.9.2" -versions.android_gradle_plugin = "7.4.1" +versions.android_gradle_plugin = "8.2.0" versions.annotations = "1.3.0" versions.appcompat = "1.6.0" versions.arch_core = "2.1.0" @@ -20,7 +20,7 @@ versions.fragment = "1.6.2" versions.hilt_navigation = "1.1.0" versions.jsoup = "1.17.1" versions.junit = "4.13.2" -versions.kotlin = "1.8.22" +versions.kotlin = "1.9.20" versions.ktlint = "11.0.0" versions.lifecycle = "2.6.2" versions.lottie = "5.2.0"