java - 无法应用插件 [id 'com.android.internal.application']
问题描述
这是我得到的错误
无法应用插件 [id 'com.android.internal.application']
'android.enableSeparateAnnotationProcessing' 选项已弃用。当前默认值为“假”。它在 Android Gradle 插件的 4.0 版中被删除。此功能已在 AGP 4.0 中删除
这是我的 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')
这是我的 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
}
我正在使用 android studio 4.2(最新版本)
解决方案
你应该试试默认的jdk。
转到项目结构 > Gradle 设置 > Gradle JDK > Android Studio 默认 JDK。
如果您没有 Android Studio 默认 JDK,请单击下载 JDK 并为您的项目使用该 JDK。
推荐阅读
- python-2.7 - 加快 matplotlib 动画中的线条绘制
- jquery - 导航栏的引导下拉菜单不起作用(角度)
- java - 更改相对于锚点的视图大小
- windows - 如何在 Windows 中设置 docker 音量?
- python - 我得到 TypeError: unhashable type: 'list',同时试图找到词频
- python - 在python中查找最后一个文件名
- python-3.x - wordsegement python库:ValueError:max()arg是一个空序列
- python - 将 ASCII 转换为轮廓 shapefile
- rust - 如何在rust中创建一个迭代器重复最后一个元素
- vue.js - nuxt-i18n 的延迟加载语言环境