سرمایه گذاری متفاوت در سال نو 🍎🌱 ۳۵٪ تخفیف نوروزی ➕ حضور رایگان در مسترمایند نخبگان صنعت نرم‌افزار 💻✅
۰ ثانیه
۰ دقیقه
۰ ساعت
۱ محمد علی
مشکل ناسازگاری تمام بخش‌های پروژه و بروز نبودن
جامعه فلاتر ایجاد شده در ۰۸ دی ۱۴۰۳

من مدام با خطا مواجه می‌شم نسخه‌های گریدل رو درست کردم وخیلی چیز‌های دیگه ولی دوباره خطلا می‌دهد خطلای جدید:Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Launching lib\main.dart on Android SDK built for x86 in debug mode...
You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-apply

You are applying Flutter's main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-apply

Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
  > 20 issues were found when checking AAR metadata:

      1.  Dependency 'androidx.fragment:fragment:1.7.1' requires libraries and applications that
          depend on it to compile against version 34 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Also, the maximum recommended compile SDK version for Android Gradle
          plugin 8.0.2 is 33.

          Recommended action: Update this project's version of the Android Gradle
          plugin to one that supports 34, then update this project to use
          compileSdk of at least 34.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

      2.  Dependency 'androidx.window:window:1.2.0' requires libraries and applications that
          depend on it to compile against version 34 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Also, the maximum recommended compile SDK version for Android Gradle
          plugin 8.0.2 is 33.

          Recommended action: Update this project's version of the Android Gradle
          plugin to one that supports 34, then update this project to use
          compileSdk of at least 34.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

      3.  Dependency 'androidx.window:window-java:1.2.0' requires libraries and applications that
          depend on it to compile against version 34 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Also, the maximum recommended compile SDK version for Android Gradle
          plugin 8.0.2 is 33.

          Recommended action: Update this project's version of the Android Gradle
          plugin to one that supports 34, then update this project to use
          compileSdk of at least 34.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

      4.  Dependency 'androidx.activity:activity:1.8.1' requires libraries and applications that
          depend on it to compile against version 34 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Also, the maximum recommended compile SDK version for Android Gradle
          plugin 8.0.2 is 33.

          Recommended action: Update this project's version of the Android Gradle
          plugin to one that supports 34, then update this project to use
          compileSdk of at least 34.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

      5.  Dependency 'androidx.lifecycle:lifecycle-livedata-core-ktx:2.7.0' requires libraries and applications that
          depend on it to compile against version 34 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Also, the maximum recommended compile SDK version for Android Gradle
          plugin 8.0.2 is 33.

          Recommended action: Update this project's version of the Android Gradle
          plugin to one that supports 34, then update this project to use
          compileSdk of at least 34.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

      6.  Dependency 'androidx.lifecycle:lifecycle-livedata:2.7.0' requires libraries and applications that
          depend on it to compile against version 34 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Also, the maximum recommended compile SDK version for Android Gradle
          plugin 8.0.2 is 33.

          Recommended action: Update this project's version of the Android Gradle
          plugin to one that supports 34, then update this project to use
          compileSdk of at least 34.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

      7.  Dependency 'androidx.lifecycle:lifecycle-viewmodel:2.7.0' requires libraries and applications that
          depend on it to compile against version 34 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Also, the maximum recommended compile SDK version for Android Gradle
          plugin 8.0.2 is 33.

          Recommended action: Update this project's version of the Android Gradle
          plugin to one that supports 34, then update this project to use
          compileSdk of at least 34.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

      8.  Dependency 'androidx.lifecycle:lifecycle-livedata-core:2.7.0' requires libraries and applications that
          depend on it to compile against version 34 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Also, the maximum recommended compile SDK version for Android Gradle
          plugin 8.0.2 is 33.

          Recommended action: Update this project's version of the Android Gradle
          plugin to one that supports 34, then update this project to use
          compileSdk of at least 34.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

      9.  Dependency 'androidx.lifecycle:lifecycle-viewmodel-savedstate:2.7.0' requires libraries and applications that
          depend on it to compile against version 34 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Also, the maximum recommended compile SDK version for Android Gradle
          plugin 8.0.2 is 33.

          Recommended action: Update this project's version of the Android Gradle
          plugin to one that supports 34, then update this project to use
          compileSdk of at least 34.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

     10.  Dependency 'androidx.core:core-ktx:1.13.1' requires libraries and applications that
          depend on it to compile against version 34 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Also, the maximum recommended compile SDK version for Android Gradle
          plugin 8.0.2 is 33.

          Recommended action: Update this project's version of the Android Gradle
          plugin to one that supports 34, then update this project to use
          compileSdk of at least 34.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

     11.  Dependency 'androidx.core:core:1.13.1' requires libraries and applications that
          depend on it to compile against version 34 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Also, the maximum recommended compile SDK version for Android Gradle
          plugin 8.0.2 is 33.

          Recommended action: Update this project's version of the Android Gradle
          plugin to one that supports 34, then update this project to use
          compileSdk of at least 34.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

     12.  Dependency 'androidx.lifecycle:lifecycle-runtime:2.7.0' requires libraries and applications that
          depend on it to compile against version 34 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Also, the maximum recommended compile SDK version for Android Gradle
          plugin 8.0.2 is 33.

          Recommended action: Update this project's version of the Android Gradle
          plugin to one that supports 34, then update this project to use
          compileSdk of at least 34.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

     13.  Dependency 'androidx.lifecycle:lifecycle-process:2.7.0' requires libraries and applications that
          depend on it to compile against version 34 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Also, the maximum recommended compile SDK version for Android Gradle
          plugin 8.0.2 is 33.

          Recommended action: Update this project's version of the Android Gradle
          plugin to one that supports 34, then update this project to use
          compileSdk of at least 34.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

     14.  Dependency 'androidx.savedstate:savedstate:1.2.1' requires libraries and applications that
          depend on it to compile against version 33 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Recommended action: Update this project to use a newer compileSdk
          of at least 33, for example 33.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

     15.  Dependency 'androidx.profileinstaller:profileinstaller:1.3.1' requires libraries and applications that
          depend on it to compile against version 33 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Recommended action: Update this project to use a newer compileSdk
          of at least 33, for example 33.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

     16.  Dependency 'androidx.startup:startup-runtime:1.1.1' requires libraries and applications that
          depend on it to compile against version 31 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Recommended action: Update this project to use a newer compileSdk
          of at least 31, for example 33.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

     17.  Dependency 'androidx.tracing:tracing:1.2.0' requires libraries and applications that
          depend on it to compile against version 33 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Recommended action: Update this project to use a newer compileSdk
          of at least 33, for example 33.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

     18.  Dependency 'androidx.arch.core:core-runtime:2.2.0' requires libraries and applications that
          depend on it to compile against version 33 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Recommended action: Update this project to use a newer compileSdk
          of at least 33, for example 33.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

     19.  Dependency 'androidx.window.extensions.core:core:1.0.0' requires libraries and applications that
          depend on it to compile against version 33 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Recommended action: Update this project to use a newer compileSdk
          of at least 33, for example 33.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

     20.  Dependency 'androidx.annotation:annotation-experimental:1.4.0' requires libraries and applications that
          depend on it to compile against version 34 or later of the
          Android APIs.

          :app is currently compiled against android-30.

          Also, the maximum recommended compile SDK version for Android Gradle
          plugin 8.0.2 is 33.

          Recommended action: Update this project's version of the Android Gradle
          plugin to one that supports 34, then update this project to use
          compileSdk of at least 34.

          Note that updating a library or application's compileSdk (which
          allows newer APIs to be used) can be done separately from updating
          targetSdk (which opts the app in to new runtime behavior) and
          minSdk (which determines which devices the app can be installed
          on).

* 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 5s
Error: Gradle task assembleDebug failed with exit code 1

Exited (1).
 

ببینید شما هر پروژه‌ای در هر زمانی دولوپ کنید بعد از مدتی به‌دلیل اپدیت‌ فلاتر و... ممکنه به چنین موارد و مشکلاتی بخورید، gradle، منسوخ شدن بعضی کلاس‌ها یا ویژگی‌ها و... . کاملا طبیعیه؛ در زمانی هم که پروژه می‌گیرید زیاد رخ میده. در ابتدا باید سعی کنید با حوصله خطا رو بخونید تا متوجه بشید دقیقا از کجا ایراد گرفته. مثلا یکی از موارد نوشته شده compileSdkVersion هست که مقدارش باید حداقل ۳۴ باشه یا ورژن gradle در android/build.gradle و.. . این‌ها باید اپدیت بشن. ضمن اینکه می‌تونید یک پروژه جدید ایجاد کنید و فایل‌ها assetها تنظیمات و.. رو کپی کنید. احتمال این هم بسیار زیاده که بعد از حل کردن این موارد به موارد منسوخ شده در کد مثل ThemeData بربخورید

یلدا محصلی ۰۹ دی ۱۴۰۳، ۰۶:۰۱