Skip to content

Commit

Permalink
android: Upgrade AGP, fix building with AGP 8, upgrade all java depen…
Browse files Browse the repository at this point in the history
…dencies.
  • Loading branch information
hpoul committed Aug 20, 2023
1 parent aacee34 commit 726ded7
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 31 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## 5.0.0+2

* Android: Upgrade AGP, fix building with AGP 8

## 5.0.0+1

* fix building on MacOS
* MacOS: fix building on MacOS

## 5.0.0

Expand Down
20 changes: 12 additions & 8 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ group 'design.codeux.biometric_storage'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.7.0'
ext.kotlin_version = '1.8.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
classpath 'com.android.tools.build:gradle:8.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -25,8 +25,13 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

kotlin {
jvmToolchain(17)
}

android {
compileSdkVersion 31
namespace "design.codeux.biometric_storage"
compileSdk 31

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -42,12 +47,11 @@ android {
}

dependencies {
def biometric_version = "1.2.0-alpha04"
def biometric_version = "1.2.0-alpha05"

api "androidx.core:core-ktx:1.8.0"
api "androidx.fragment:fragment-ktx:1.5.0"
api "androidx.core:core-ktx:1.10.1"
api "androidx.fragment:fragment-ktx:1.6.1"

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "androidx.biometric:biometric:$biometric_version"
implementation "io.github.microutils:kotlin-logging:1.7.6"
implementation "io.github.oshai:kotlin-logging-jvm:5.0.1"
}
3 changes: 1 addition & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="design.codeux.biometric_storage">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<!--suppress DeprecatedClassUsageInspection -->
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.content.Context
import android.content.pm.PackageManager
import android.os.Build
import android.security.keystore.KeyProperties
import mu.KotlinLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import java.io.File
import java.io.IOException
import javax.crypto.Cipher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import io.flutter.embedding.engine.plugins.activity.*
import io.flutter.plugin.common.*
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result
import mu.KotlinLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import java.io.PrintWriter
import java.io.StringWriter
import java.util.concurrent.ExecutorService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package design.codeux.biometric_storage

import android.security.keystore.KeyGenParameterSpec
import android.security.keystore.KeyProperties
import mu.KotlinLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import java.io.File
import java.nio.charset.Charset
import java.security.KeyStore
Expand Down
19 changes: 14 additions & 5 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,19 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

kotlin {
jvmToolchain(17)
}

android {
compileSdkVersion 33
ndkVersion "21.1.6352462"

compileOptions {
sourceCompatibility = 17
targetCompatibility = 17
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
Expand Down Expand Up @@ -62,18 +71,18 @@ android {
lint {
disable 'InvalidPackage'
}
namespace 'design.codeux.biometric_storage_example'
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'org.slf4j:slf4j-api:1.7.30'
implementation 'com.github.tony19:logback-android:2.0.0'
implementation "io.github.microutils:kotlin-logging:1.7.6"
implementation "androidx.appcompat:appcompat:1.4.1"
implementation 'org.slf4j:slf4j-api:2.0.7'
implementation 'com.github.tony19:logback-android:3.0.0'
implementation "io.github.oshai:kotlin-logging-jvm:5.0.1"
implementation "androidx.appcompat:appcompat:1.6.1"

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.4.0'
Expand Down
3 changes: 1 addition & 2 deletions example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="design.codeux.biometric_storage_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
3 changes: 1 addition & 2 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="design.codeux.biometric_storage_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine

import io.flutter.plugins.GeneratedPluginRegistrant
import mu.KotlinLogging
import io.github.oshai.kotlinlogging.KotlinLogging

private val logger = KotlinLogging.logger {}

Expand Down
3 changes: 1 addition & 2 deletions example/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="design.codeux.biometric_storage_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
6 changes: 3 additions & 3 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.7.0'
ext.kotlin_version = '1.8.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.android.tools.build:gradle:8.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
3 changes: 3 additions & 0 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
org.gradle.jvmargs=-Xmx1536M

android.useAndroidX=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: biometric_storage
description: |
Secure Storage: Encrypted data store optionally secured by biometric lock with support
for iOS, Android, MacOS. Partial support for Linux, Windows and web (localStorage).
version: 5.0.0+1
version: 5.0.0+2
homepage: https://github.com/authpass/biometric_storage/

environment:
Expand Down

0 comments on commit 726ded7

Please sign in to comment.