I am not use sqflite in my project. but message throw
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-
Where:
Build file ‘C:UsersomorAppDataLocalPubCachehostedpub.devsqflite-2.2.8androidbuild.gradle’ line: 32 -
What went wrong:
A problem occurred evaluating project ‘:sqflite’.
No signature of method: build_2b5nv2gppswbcwhvgd3rrj7jc.android() is applicable for argument types: (build_2b5nv2gppswbcwhvgd3rrj7jc$_run_closure3) values: [build_2b5nv2gppswbcwhvgd3rrj7jc$_run_closure3@e2eb4ec]
- Try:
Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output. Run with –scan to get full insights.
==============================================================================
2: Task failed with an exception.
-
Where:
Script ‘C:flutterpackagesflutter_toolsgradleflutter.gradle’ line: 463 -
What went wrong:
A problem occurred configuring project ‘:sqflite’.
Failed to notify project evaluation listener.
Cannot invoke method substring() on null object
compileSdkVersion is not specified. Please add it to build.gradle
-
Try:
Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output. Run with –scan to get full insights.
============================================================================== -
Get more help at https://help.gradle.org
BUILD FAILED in 2s
Exception: Gradle task assembleDebug failed with exit code 1
I am not use sqflite in my project. but message throw
2
Answers
in pubspec.yaml
use
sqflite: 2.2.6
instead ofsqflite: ^2.2.8
I think adding namespace in 2.2.8 broke old android applications (i.e. generated with earlier flutter sdk version). Can you try to update sqflite to 2.2.8+1 – which adds a fix when namespace are not supported – or follow the gradle migration guide: https://docs.flutter.dev/release/breaking-changes/android-java-gradle-migration-guide