Плагин [id: 'com.android.application', версия: '7.3.0', apply: false] не найден ни в одном из следующих источников: - ПлAndroid

Форум для тех, кто программирует под Android
Ответить
Anonymous
 Плагин [id: 'com.android.application', версия: '7.3.0', apply: false] не найден ни в одном из следующих источников: - Пл

Сообщение Anonymous »

Я только что создал новый проект Flutter. Ничего не изменяя, я попытался запустить проект на физическом устройстве (SM N975F (мобильное) • RF8M802FS2E • android-arm64 • Android 12 (API 31)), но получил сообщение Ошибка сборки с ошибкой исключения. Я застрял здесь уже на неделю.
Ниже приведено полное описание ошибки:

Код: Выделить всё

    FAILURE: Build failed with an exception.

* Where:
Settings file '/Users/sule/Desktop/smcsw/android/settings.gradle' line: 21

* What went wrong:
Plugin [id: 'com.android.application', version: '7.3.0', apply: false] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Included Builds (None of the included builds contain this plugin)
- Plugin Repositories (could not resolve plugin artifact 'com.android.application:com.android.application.gradle.plugin:7.3.0')
Searched in the following repositories:
Google
MavenRepo
Gradle Central Plugin Repository

* 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 3s
Running Gradle task 'assembleDebug'...                               4.4s
Error: Gradle task assembleDebug failed with exit code 1
Ниже приведены подробные сведения о моем докторе по флаттеру:

Код: Выделить всё

[✓] Flutter (Channel stable, 3.22.2, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-GB)
• Flutter version 3.22.2 on channel stable at /usr/local/Caskroom/flutter/3.22.2/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 761747bfc5 (6 weeks ago), 2024-06-05 22:15:13 +0200
• Engine revision edd8546116
• Dart version 3.4.3
• DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/sule/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
• All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 11.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 11C505
✗ Flutter requires Xcode 14 or higher.
Download the latest version or update via the Mac App Store.
! CocoaPods 1.11.3 out of date (1.13.0 is recommended).
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to
your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To upgrade see https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods for
instructions.

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1)
• Android Studio at /Applications/Android Studio.app/Contents
• 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 17.0.10+0-17.0.10b1087.21-11609105)

[✓] VS Code (version 1.91.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.48.0

[✓] Connected device (3 available)
• SM N975F (mobile) • RF8M802FS2E • android-arm64  • Android 12 (API 31)
• macOS (desktop)   • macos       • darwin-x64     • Mac OS X 10.15.7 19H2 darwin-x64
• Chrome (web)      • chrome      • web-javascript • Google Chrome 126.0.6478.127

[✓] Network resources
• All expected network resources are available.

! Doctor found issues in 1 category.
Ниже мой Android/app/build.gradle:

Код: Выделить всё

plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader("UTF-8") { reader ->
localProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
if (flutterVersionCode == null) {
flutterVersionCode = "1"
}

def flutterVersionName = localProperties.getProperty("flutter.versionName")
if (flutterVersionName == null) {
flutterVersionName = "1.0"
}

android {
namespace = "com.example.smcsw"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.smcsw"
// 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.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.debug
}
}
}

flutter {
source = "../.."
}
Ниже мой Android/build.gradle:

Код: Выделить всё

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
}
Ниже мой Android/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 "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}
Ниже мой Android/gradle.properties:

Код: Выделить всё

org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
Ниже приведен мой файл my gradle-wrapper.propertes:

Код: Выделить всё

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
Я застрял здесь уже неделю. Я пробовал менять сборки, URL-адрес распространения и бесконечно искать в Интернете, но безрезультатно. Пожалуйста, помогите мне.

Подробнее здесь: https://stackoverflow.com/questions/787 ... -was-not-f
Ответить

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

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

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

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

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