Gradle Build не удалось создать файл AN.APK. Вполне вероятно, что этот файл был сгенерирован в соответствии с D: \ ProjeAndroid

Форум для тех, кто программирует под Android
Ответить Пред. темаСлед. тема
Anonymous
 Gradle Build не удалось создать файл AN.APK. Вполне вероятно, что этот файл был сгенерирован в соответствии с D: \ Proje

Сообщение Anonymous »

Я использую Android Studio Ladybug с последним трепетом и SDK. Моя версия Flutter - 3,32 (конюшня канала), а моя версия DART - 3,8,1
Недавно я клонировал проект от GitHub, который я нажимал на GitHub.
он работал нормально перед загрузкой в ​​GitHub, теперь, когда я клонировал его, это ошибки,
(как перед тем, как нажимать, может Помните) < /p>
Самая первая ошибка, которая получила имени пользователя, мое предыдущее имя пользователя (C: \ users \ username \ studioprojects), где я загружен в Github, было без пространств, но когда я клонирую его к другому ноутбуку, чье имя пользователя находится с пространствами между (c: \ user name \ studiioproject), так что это так, что это так, что это так. в папку (d: \ projects \ veurn_7_buzzer) с именем папки без пространств .. (d: \ projects)
Итак, как исправлена ​​ошибка. < /p>
Я также получил ошибку в Google-service. Загружено Google-service.json, затем вставьте его в папку приложения ... так что это разрешает ошибку, < /p>
Теперь после устранения неполадок приведенных выше ошибок я теперь застрял в < /p>
Error: Gradle build failed to produce an .apk file. It's likely that this file was generated under D:\projects\level_7_buzzer\build, but the tool couldn't find it.
< /code>
У меня нет d: \ projects \ level_7_buzzer \ ляточный каталог Build вместо этого у меня есть d: \ projects \ level_7_buzzer \ android \ app \ build < /p>
Что я думаю, чтобы обновить Android Studio для последней версии. Также попробовал Flutter Install и получите ошибку: < /p>
PS D:\projects\level_7_buzzer> flutter install
Installing app-release.apk to 23028RNCAG...
"build\app\outputs\flutter-apk\app-release.apk" does not exist.
Install failed
< /code>
Мой текущий клонированный проект находится в следующей папке :: d: \ projects \ level_7_buzzer
my Flutter находится в C: \ abc \ flutter
sdk.dir=c:lumersersumer name \ appdata \ local \ Android \ sdk (мой Sdk.dir Pathers in Spaces in MyTight in < /p) < /p) < /p in < /p in < /p) < /p in < /p in < /p in < /p in < /p) /> 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.properties:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
< /code>
android \build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '2.0.20' // or the latest stable version available
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:8.3.1" // 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 "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>
andoidmanifest.xml





















< /code>
mainactivity.kt
package com.example.level_7_buzzer

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity()
< /code>
local.properties::
sdk.dir=C:\\Users\\x y z\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\abc\\flutter
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1

my local.properties has space in between the username(user name) whereas my project has directory without a space in between.
sdk.dir=c:\\users\\x y z\\appdata\\....etc
and my flutter.sdk is in c:, and my project is in d:\projects\level_7_buzzer
< /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.7.0
cloud_firestore: ^5.4.5
audioplayers: ^6.1.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 ... -was-gener
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Android»