
تحديث Android SDK
قم بتحديث Android SDk كما في الصور
1- Android Platforms
Android 15 فما فوق و ينصح باخر اصدار 16

SDK Tools
Android SDK Build-Tools 36.1.0

NDK 29.0.14033849

Android SDK Command-line Tools 19.0

تحديث فلاتر الى اخر اصدار Flutter 3.35.4

التعديلات المطلوب اجراءها في المشروع
تم قم بتحديث الاسطر المظللة باللون الأزرق في الملفات التالية من مجلد المشروع
\android\app\build.gradle
compileSdk 36
ndkVersion ‘29.0.14033849’
buildToolsVersion ‘36.0.0’
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
jvmTarget = “21”
targetSdk 36
import java.util.Properties
import java.io.FileInputStream
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'dev.flutter.flutter-gradle-plugin'
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
namespace 'com.exemple'
compileSdk 36
ndkVersion '29.0.14033849'
buildToolsVersion '36.0.0'
compileOptions {
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
kotlinOptions {
jvmTarget = "21"
}
packagingOptions {
jniLibs {
useLegacyPackaging false
}
}
defaultConfig {
applicationId 'com.exemple'
minSdk flutter.minSdkVersion
targetSdk 36
versionCode flutter.versionCode
versionName flutter.versionName
}
signingConfigs {
release {
if (keystoreProperties['keyAlias']) {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
}
buildTypes {
release {
// Uncomment the next line when you have keystore configured
signingConfig signingConfigs.release
// Using debug signing for now
// signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
android\gradle\wrapper\gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
android\build.gradle
ext.kotlin_version = ‘2.1.0’
classpath “com.android.tools.build:gradle:8.12.0”
buildscript {
ext.kotlin_version = '2.1.0'
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:8.12.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
}
تم قم بتنظيف المشروع
Flutter clean
Flutter pub get
تم قم ببناء التطبيق
flutter build appbundle --release
او
flutter build apk --release
و لا تنسى تغيير رقم الإصدار للتطبيق من ملف pubspec.yaml