Reputation: 1
i just finished a prototype and when i run flutter build apk --release i get this error: (flutter 3.22.1) how am i supposed to fix it? thanks in advance:
FAILURE: Build failed with an exception.
Failed to notify project evaluation listener. Could not get unknown property 'android' for project ':mapbox_gl' of type org.gradle.api.Project. Could not get unknown property 'android' for project ':mapbox_gl' of type org.gradle.api.Project.
ps: that's my android\build.gradle:
`buildscript {
ext.kotlin_version = '2.0.0'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.3' // Adjust if necessary
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
classpath "com.google.gms:google-services:4.4.2"
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://api.mapbox.com/downloads/v2/releases/maven' }
}
}
rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(":app")
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
`
and this is my android\app\build.gradle:
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id "com.google.gms.google-services"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader("UTF-8") { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
if (flutterVersionCode == null) {
flutterVersionCode = "1"
}
def flutterVersionName = localProperties.getProperty("flutter.versionName")
if (flutterVersionName == null) {
flutterVersionName = "1.0"
}
android {
namespace = "com.example.testproject"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.testproject"
// 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.
minSdk = 23
targetSdk = flutter.targetSdkVersion
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
multiDexEnabled true // Enable multidex
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'androidx.multidex:multidex:2.0.1'
// implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.6.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib:2.0.0"// Specify the Kotlin version
// implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-places-v9:0.12.0'
implementation "com.google.android.gms:play-services-location:21.2.0"
implementation platform('com.google.firebase:firebase-bom:33.1.0')
implementation 'com.google.firebase:firebase-auth'
}
repositories {
maven { url 'https://api.mapbox.com/downloads/v2/releases/maven' }
}
flutter {
source = "../.."
}
i updated the mapbox_gl dependency still same problem
Upvotes: 0
Views: 103