Reputation: 1
Multiple build operations failed.
Could not create task ':flutter_plugin_android_lifecycle:generateDebugUnitTestConfig'.
Could not create task ':google_maps_flutter_android:generateDebugUnitTestConfig'.
Could not create task ':image_picker_android:generateDebugUnitTestConfig'.
Could not create task ':shared_preferences_android:generateDebugUnitTestConfig'.
Could not create task ':url_launcher_android:generateDebugUnitTestConfig'.
Could not create task ':flutter_plugin_android_lifecycle:generateDebugUnitTestConfig'.
this and base files have different roots: E:\tracking App project\Dmft_bokaro\build\flutter_plugin_android_lifecycle and C:\Users\Win11\AppData\Local\Pub\Cache\hosted\pub.dev\flutter_plugin_android_lifecycle-2.0.15\android.
`dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
shared_preferences: ^2.1.2
flutter_map: ^0.14.0
latlong2: ^0.8.2
http: ^0.13.4
geolocator: ^7.1.1
intl: ^0.17.0
fluttertoast: ^8.0.7
flutter_plugin_android_lifecycle: ^2.0.15
permission_handler: ^10.3.0
flutter_native_splash: ^2.3.1
maps_launcher: ^2.2.0
dio: ^5.2.1+1
modal_progress_hud_nsn: ^0.4.0
image_picker: ^0.8.9
table_calendar: ^3.0.0
google_maps_flutter: ^2.3.1
flutter_launcher_icons: ^0.13.1`
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "com.example.dmft_bokaro"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.dmft_bokaro"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
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
}
I have tried to flutter clean, flutter pub get, flutter upgrade... my debugging apk is running fine
Upvotes: 0
Views: 293
Reputation: 1
The following algorithm helped me solve the problem:
1. Use the menu "Tools > Flutter > Flutter Clean" or enter the command "flutter clran
" in the terminal.
2. Enter the command into the terminal: "flutter pub cache repair
"
3. Use the menu: “File > Invalidate Caches...”: check all the boxes, there are three of them. Next > Click “Invalidate and restart”, and then wait for Android Studio to launch. open the “Android” module and rejoice at the message “Gradle Sync Finished”.
I also want to point out that the problem seems to be with the Gradle version. Try downgrading via the menu: Tools > AGP Upgrade Assistant.
Good luck!
Upvotes: 0
Reputation: 5986
Add the below code on the following path android/app/build.gradle
buildTypes {
release {
signingConfig signingConfigs.release
}
debug {
signingConfig signingConfigs.debug
}
}
Upvotes: 0
Reputation: 11
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.release
}
}
signingConfig signingConfigs.release please change debug to release mode like this
Upvotes: 1