diff --git a/drift_sqflite/android/app/build.gradle b/drift_sqflite/android/app/build.gradle index 75d120ed..0ba45de5 100644 --- a/drift_sqflite/android/app/build.gradle +++ b/drift_sqflite/android/app/build.gradle @@ -26,6 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'com.example.drift_sqflite' compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion diff --git a/drift_sqflite/android/build.gradle b/drift_sqflite/android/build.gradle index 83ae2200..8e0b4a4d 100644 --- a/drift_sqflite/android/build.gradle +++ b/drift_sqflite/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:8.0.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/drift_sqflite/android/gradle/wrapper/gradle-wrapper.properties b/drift_sqflite/android/gradle/wrapper/gradle-wrapper.properties index cc5527d7..8b635de2 100644 --- a/drift_sqflite/android/gradle/wrapper/gradle-wrapper.properties +++ b/drift_sqflite/android/gradle/wrapper/gradle-wrapper.properties @@ -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-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip diff --git a/drift_sqflite/integration_test/drift_sqflite_test.dart b/drift_sqflite/integration_test/drift_sqflite_test.dart index e072f0c2..ff8a9488 100644 --- a/drift_sqflite/integration_test/drift_sqflite_test.dart +++ b/drift_sqflite/integration_test/drift_sqflite_test.dart @@ -6,7 +6,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:path/path.dart'; -import 'package:sqflite/sqflite.dart' show getDatabasesPath; +import 'package:sqflite/sqflite.dart' show DatabaseException, getDatabasesPath; class SqfliteExecutor extends TestExecutor { @override @@ -99,11 +99,19 @@ Future main() async { await database.customStatement('CREATE TABLE y (foo INTEGER PRIMARY KEY ' 'REFERENCES x (foo) DEFERRABLE INITIALLY DEFERRED);'); + // On Android, the failing commit of the transaction rolls it back implicitly, + // causing the drift's rollback recovery to fail. This is expected and not + // harmful since the end result (transaction not applied) is the same. On + // iOS, the transaction stays active despite the failing commit. + final expectedException = Platform.isAndroid + ? isA() + : isA(); + await expectLater( database.transaction(() async { await database.customStatement('INSERT INTO y VALUES (2);'); }), - throwsA(isA()), + throwsA(expectedException), ); }); }