![](/img/trans.png)
[英]Android Studio - 'com.android.internal.application' Java 11 - fix gradle projects not visibile in Android studio
[英]Failed to apply plugin [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。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.