i have an Error during run my flutter app after pub get adivery 4.6.1
this is Error :
PS D:\Android\WorkSpace\hoshan\hoshan> flutter run
Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\Android\WorkSpace\hoshan\hoshan\android\app\build.gradle' line: 4
* What went wrong:
An exception occurred applying plugin request [id: 'dev.flutter.flutter-gradle-plugin']
> Failed to apply plugin 'dev.flutter.flutter-gradle-plugin'.
> Cannot run Project.afterEvaluate(Closure) when the project is already evaluated.
* 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
Running Gradle task 'assembleDebug'... 2,443ms
Error: Gradle task assembleDebug failed with exit code 1
this is my app/build.gradle file:
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
// START: FlutterFire Configuration
id 'com.google.gms.google-services'
// END: FlutterFire Configuration
}
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'
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file("key.properties")
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
namespace "com.example.hoshan"
compileSdk 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.hoshan"
// 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 24
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
// Add namespace for adivery plugin
manifestPlaceholders = [
adiveryPluginNamespace: "com.adivery.plugin"
]
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled true // Enable R8 for release builds
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
flutter {
source '../..'
}
dependencies {}
and this is my android/build.gradle file:
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.15'
}
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
google()
mavenCentral()
}
afterEvaluate { project ->
if (project.hasProperty('android')) {
android {
if (project.plugins.hasPlugin("com.android.library")) {
namespace project.group ?: "com.${project.name}"
}
}
}
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
and gradle-wrapper.properties:
#Tue Mar 25 09:42:09 IRST 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
how can i fix this issue i try many ways and ask Ai do many thing but at last i faced this error again.
I would be grateful if you could help me.
i have an Error during run my flutter app after pub get adivery 4.6.1
this is Error :
this is my app/build.gradle file:
and this is my android/build.gradle file:
and gradle-wrapper.properties:
how can i fix this issue i try many ways and ask Ai do many thing but at last i faced this error again.
I would be grateful if you could help me.