I install 'sqflite' and add 'sqflite: ^2.3.2' on 'dependencies' into "pubspec.yaml" as the following picture:
My "andriod/build.gradle":
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
gradle-wrapper.properties:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
I get the following error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':sqflite'.
> Could not resolve all files for configuration ':sqflite:classpath'.
> Could not find gradle-7.4.2.jar (com.android.tools.build:gradle:7.4.2).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.4.2/gradle-7.4.2.jar
> Could not find bundletool-1.11.4.jar (com.android.tools.build:bundletool:1.11.4).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/bundletool/1.11.4/bundletool-1.11.4.jar
> Failed to notify project evaluation listener.
> Could not get unknown property 'android' for project ':sqflite' of type org.gradle.api.Project.
> Could not get unknown property 'android' for project ':sqflite' of type org.gradle.api.Project.
* 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 1s
Exception: Gradle task assembleDebug failed with exit code 1
I tried to modify the classpath of dependencies in the andriod/build.gradle file but I didn't get any results.
Flutter doctor is :
[√] Flutter (Channel stable, 3.16.1, on Microsoft Windows [Version 10.0.22631.3155], locale en-US)
• Flutter version 3.16.1 on channel stable at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 7f20e5d18c (3 months ago), 2023-11-27 09:47:30 -0800
• Engine revision 22b600f240
• Dart version 3.2.1
• DevTools version 2.28.3
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at C:\Users\ASUS\AppData\Local\Android\sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.0)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.9.34607.119
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2023.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
[√] VS Code (version 1.86.2)
• VS Code at C:\Users\ASUS\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.82.0
[√] Connected device (5 available)
• RNE L21 (mobile) • FFY5T18410008930 • android-arm64 • Android 8.0.0 (API 26)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 12 (API 31) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.3155]
• Chrome (web) • chrome • web-javascript • Google Chrome 122.0.6261.69
• Edge (web) • edge • web-javascript • Microsoft Edge 121.0.2277.128
[√] Network resources
• All expected network resources are available.
• No issues found!
Process finished with exit code 0