Совершенно неожиданно я получил эту ошибку, которую не могу найти способ исправить. Плагин с идентификатором com.android.application не найден. Если есть еще файлы, которые вам нужно просмотреть, не стесняйтесь спрашивать меня. Спасибо!
Это отсылает меня к этому файлу:
Вот мой build.gradle (проект OddJob):
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.tamir.offen.actionbar"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
url 'https://dl.bintray.com/spark/maven'
}
}
configurations.all {
resolutionStrategy {
force 'com.android.support:support-annotations:23.1.1'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation "com.google.android.gms:play-services-location:15.0.1"
implementation 'com.android.support:support-v4:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'me.spark:submitbutton:1.0.1'
implementation 'com.wdullaer:materialdatetimepicker:3.1.3'
// for the bottom nav bar:
implementation 'com.android.support:design:27.1.1'
}
Вот build.gradle (приложение-модуль):
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.tamir.offen.actionbar"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation "com.google.android.gms:play-services-location:15.0.1"
implementation 'com.android.support:support-v4:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'me.spark:submitbutton:1.0.1'
implementation 'com.wdullaer:materialdatetimepicker:3.1.3'
// for the bottom nav bar:
implementation 'com.android.support:design:27.1.1'
}




Android Studio: Plugin with id
'com.android.application'not found
Вам не хватает classpath 'com.android.tools.build:gradle:3.1.3' в проекте верхнего уровня dependencies.
Проверить проект верхнего уровня build.gradle
build.gradle(Project OddJob):
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
//
//task clean(type: Delete) {
// delete rootProject.buildDir
//}
Я получил эту ошибку: Объявление настраиваемой «чистой» задачи при использовании стандартных подключаемых модулей жизненного цикла Gradle запрещено. А также, что вы подразумеваете под "Проверить проект верхнего уровня build.gradle"
Просто удалите чистую часть задачи и попробуйте еще раз. Обновил мой ответ.
Спасибо за быстрые повторы! Я удалил чистую часть задачи и получил эту ошибку: не удается прочитать имя пакета из C: \ Users \ tamir \ Desktop \ OddJob \ src \ main \ AndroidManifest.xml
Попробуйте Android Studio> Build> Clean Project.
Я попытался очистить свой проект, и это не помогло (та же ошибка)
Обновите свой вопрос с помощью AndroidManifest.xml. Кажется, в этом файле есть ошибка или неправильный пакет.
Попробуй это
Добавьте следующий код в начало файла build.gradle в своем проекте следующим образом:
/ Top-level build file where you can add configuration options common to all sub-
projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Откройте gradle-wrapper.properties и добавьте URL-адрес, подобный этому:
Wed May 30 16:36:49 IST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip //add this line in you project.
это помогает тебе
Могу ли я просто скопировать и вставить это в build.gradle (проект)?