[英]Failed to apply plugin [id 'com.android.internal.application']
This is the error I got这是我得到的错误
Failed to apply plugin [id 'com.android.internal.application']应用插件失败 [id 'com.android.internal.application']
The option 'android.enableSeparateAnnotationProcessing' is deprecated.
'android.enableSeparateAnnotationProcessing' 选项已弃用。 The current default is 'false'.
当前默认值为“假”。 It was removed in version 4.0 of the Android Gradle plugin.
它在 Android Gradle 插件的 4.0 版中被删除。 This feature was removed in AGP 4.0
此功能已在 AGP 4.0 中删除
This is my build.Gradle file module这是我的 build.Gradle 文件模块
apply from: '../config/checkstyle.gradle'
android {
compileSdkVersion 29
buildToolsVersion '29.0.3'
defaultConfig {
applicationId "Rafsan.PDF"
vectorDrawables.useSupportLibrary = true
minSdkVersion 21
multiDexEnabled true
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
}
lintOptions {
checkReleaseBuilds false
}
testOptions {
unitTests {
includeAndroidResources = true
returnDefaultValues = true
}
}
}
configurations {
all {
exclude module: 'httpclient'
}
}
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url "https://repository.aspose.com/repo/" }
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'junit:junit:4.12'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.preference:preference:1.0.0'
implementation 'com.android.support:support-annotations:28.0.0'
// persistence room library - for db operations
implementation 'androidx.room:room-runtime:2.0.0'
annotationProcessor 'androidx.room:room-compiler:2.0.0'
implementation 'com.jakewharton:butterknife:10.2.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
// material ripple, morphing button, material dialog, animations
implementation 'com.balysv:material-ripple:1.0.2'
implementation 'com.github.dmytrodanylyk:android-morphing-button:98a4986e56'
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
implementation 'com.airbnb.android:lottie:2.5.5'
// libraries for reading from doc and docx files
implementation group: 'org.apache.xmlbeans', name: 'xmlbeans', version: '2.4.0'
implementation group: 'org.apache.poi', name: 'poi', version: '3.9'
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: '3.9'
implementation group: 'org.apache.poi', name: 'poi-ooxml-schemas', version: '3.9'
implementation group: 'org.apache.poi', name: 'poi-scratchpad', version: '3.9'
// Itext pdf library
implementation 'com.itextpdf:itextg:5.5.10'
implementation 'com.madgag.spongycastle:core:1.58.0.0'
// Picasso, image editor, image cropper
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'jp.wasabeef:picasso-transformations:2.2.1'
implementation 'ja.burhanrashid52:photoeditor:0.2.1'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
// Viewpager transformation
implementation 'com.eftimoff:android-viewpager-transformers:1.0.1@aar'
// Image picker, and folder picker
implementation 'com.zhihu.android:matisse:0.5.3-beta3'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'lib.kashif:folderpicker:2.4'
// Zxing - for scanning qr code
implementation 'com.google.zxing:core:3.2.1'
implementation 'com.journeyapps:zxing-android-embedded:3.4.0'
// color picker
implementation 'com.github.danielnilsson9:color-picker-view:1.4.0@aar'
testImplementation 'org.mockito:mockito-core:2.23.4'
testImplementation 'org.robolectric:robolectric:4.3.1'
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.google.android.gms:play-services-ads:19.4.0'
implementation 'com.facebook.android:audience-network-sdk:5.11.0'
}
preBuild.dependsOn('checkstyle')
assemble.dependsOn('lint')
check.dependsOn('checkstyle')
and this is my build.Gradle project这是我的 build.Gradle 项目
buildscript {
repositories {
maven {
url "https://jcenter.bintray.com"
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.0.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I am using android studio 4.2 ( latest version )我正在使用 android studio 4.2(最新版本)
You should try default jdk.你应该试试默认的jdk。
Goto Project structure > Gradle setting > Gradle JDK > Android Studio default JDK.转到项目结构 > Gradle 设置 > Gradle JDK > Android Studio 默认 JDK。
If you didn't have Android Studio default JDK then click Download JDK and use that JDK for you project.如果您没有 Android Studio 默认 JDK,请单击下载 JDK 并为您的项目使用该 JDK。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.