Gradle build failed to produce an .apk file. It's likely that this file was generated under C:\Users\zeyad\StudioProjects\level_7_buzzer\build, but the tool couldn't find it
< /code>
То, что я понял и пытался после небольшой суеты, что из -за некомпредсаточности трепета C: \ users \ zeyad \ studioprojects \ level_7_buzzer \ android \ app \ build \ outputs \ flutter-apk < /code> < /p>
Но трепетание указывает на
build\app\outputs\flutter-apk\< /code> < /p>
Ниже приведены мои файлы:
версия Android Studio: < /p>
Build #AI-242.21829.142.2422.12329062, built on September 6, 2024
Runtime version: 21.0.3+-12282718-b509.11 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 10.0
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 2048M
Cores: 8
Registry:
ide.experimental.ui=true
i18n.locale=
Non-Bundled Plugins:
Dart (242.24931)
io.flutter (85.2.2)
< /code>
Flutter Doctor: < /p>
C:\Users\zeyad>flutter doctor -v
[√] Flutter (Channel stable, 3.32.5, on Microsoft Windows [Version 10.0.18362.1256], locale en-US) [455ms]
• Flutter version 3.32.5 on channel stable at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision fcf2c11572 (2 weeks ago), 2025-06-24 11:44:07 -0700
• Engine revision dd93de6fb1
• Dart version 3.8.1
• DevTools version 2.45.1
[√] Windows Version (10 Pro 64-bit, 1903) [1,429ms]
[√] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [6.4s]
• Android SDK at C:\Users\zeyad\AppData\Local\Android\Sdk
• Platform android-35, build-tools 36.0.0
• ANDROID_SDK_ROOT = C:\Users\zeyad\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
• All Android licenses accepted.
[√] Chrome - develop for the web [25ms]
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[X] Visual Studio - develop Windows apps [24ms]
X Visual Studio not installed; this is necessary to develop Windows apps.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2024.2) [19ms]
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
[√] Android Studio (version 2024.2.safe) [17ms]
• Android Studio at C:\src\android-studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
[√] Connected device (4 available) [398ms]
• 23028RNCAG (mobile) • HMTCCMHM8HGE45WC • android-arm • Android 13 (API 33)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.18362.1256]
• Chrome (web) • chrome • web-javascript • Google Chrome 138.0.7204.96
• Edge (web) • edge • web-javascript • Microsoft Edge 138.0.3351.77
[√] Network resources [730ms]
• All expected network resources are available.
! Doctor found issues in 1 category.
android/build.gradle
buildscript {
ext.kotlin_version = '1.9.10' // or the latest stable version available
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:8.2.2" // Use the latest stable version of the Gradle plugin
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // Kotlin Gradle plugin
classpath "com.google.gms:google-services:4.4.2" // Google services plugin, if needed
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
tasks.register("clean", Delete) {
delete rootProject.layout.buildDirectory
}
App/build.gradle
plugins {
id "com.android.application"
id "org.jetbrains.kotlin.android" //
id "dev.flutter.flutter-gradle-plugin"
id "com.google.gms.google-services"
}
android {
namespace = "com.example.level_7_buzzer"
compileSdk = 35
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17" // Use string for jvmTarget
}
defaultConfig {
applicationId = "com.example.level_7_buzzer"
minSdk = 23
targetSdk = 34 // Ensure this matches your project needs
versionCode = 1 // Update as necessary
versionName = "1.0" // Update as necessary
}
buildTypes {
release {
signingConfig = signingConfigs.debug // Consider using a release signing config for production
}
}
}
flutter {
source = "../.."
}
dependencies {
implementation platform("com.google.firebase:firebase-bom:33.10.0") // Use the latest BoM version
implementation "com.google.firebase:firebase-analytics" // Version not specified due to using BoM
implementation "com.google.firebase:firebase-auth" // Version not specified due to using BoM
implementation "com.google.firebase:firebase-firestore" // Version not specified due to using BoM
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" // Ensure this uses the updated version variable
}
< /code>
settings.gradle
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.3.1" apply false
id "org.jetbrains.kotlin.android" version "2.0.20" apply false
}
include ":app"
< /code>
Свойства Gradle-Wraper < /p>
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
< /code>
gradle.properties
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
< /code>
local.properties
sdk.dir=C:\\Users\\zeyad\\AppData\\Local\\Android\\Sdk
flutter.sdk=C:\\src\\flutter
flutter.buildMode=release
flutter.versionName=1.0.0
flutter.versionCode=1
< /code>
pubspec.yaml
name: level_7_buzzer
description: "A new Flutter project."
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/arc ... nKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1
environment:
sdk: ^3.6.0
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
flutter:
sdk: flutter
firebase_core: ^3.15.1
cloud_firestore: ^5.6.11
audioplayers: ^6.5.0
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.8
dev_dependencies:
flutter_test:
sdk: flutter
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^5.0.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter packages.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/beep.mp3
- assets/notification_1.mp3
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/to/asset-from-package
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/to/font-from-package
Подробнее здесь: https://stackoverflow.com/questions/796 ... -this-file