Android Studio - Failed to apply plugin [id #39;com.android.application#39;](Android Studio - 无法应用插件 [id com.android.application])
问题描述
我正在开发一个应用程序.在我的应用程序中,代码没有错误,但是当我尝试运行我的项目时,它会出现以下错误.
I am working on an app. In my app there is no error in code but when I try to run my project it gives following errors.
错误:(1, 1) 评估项目 ':app' 时出现问题.
Error:(1, 1) A problem occurred evaluating project ':app'.
无法应用插件 [id 'com.android.application']
Failed to apply plugin [id 'com.android.application']
无法创建AppPlugin"类型的插件.
Could not create plugin of type 'AppPlugin'.
我也试试这个 Gradle发出错误无法创建AppPlugin"类型的插件"
这也是 Android Studio 中的 Gradle 错误
以下是我的 build.gradle 文件
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.praval.healthfreak"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.android.support:design:23.2.1'
compile files('libs/YouTubeAndroidPlayerApi.jar')
}
推荐答案
2020 年 6 月 24 日更新
您需要更新到最新的 gradle
版本来解决这个问题.
You need to update to the latest gradle
version to solve this issue.
请确保您使用的是最新的 Android Studio
Please make sure you are on the latest Android Studio
然后通过更新这个依赖来更新你的项目级别build.gradle
and then update your project level build.gradle
by updating this dependency
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
}
}
它可能会显示一个弹出窗口询问您是否允许更新 gradle
,请更新它会自动下载最新的发行版,问题将得到解决.
It might show a popup asking your permission to update gradle
, please update and it will download the latest distribution automatically and the issue will be resolved.
否则你可以
从此处获取最新的 Gradle 5.6.4 并添加手动的
Get Latest Gradle 5.6.4 from here and Add it manually
如果您不想手动下载:
打开你的项目>毕业>包装器>gradle-wrapper.properties
并替换
distributionUrl=https://services.gradle.org/distributions/gradle-version-number-all.zip
有
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip
重建项目或再次运行 gradle sync.
Rebuild the project or just run gradle sync again.
这篇关于Android Studio - 无法应用插件 [id 'com.android.application']的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Android Studio - 无法应用插件 [id 'com.android.appl


- Android viewpager检测滑动超出范围 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01