Execution failed for task ':app:packagexxxxRelease'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Unable to find EOCD signature
现象2
1 2 3
Execution failed for task ':app:packageGame_ZHRelease'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > java.lang.IllegalArgumentException (no error message)
2.4 Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8
现象(项目创建时)
1 2 3 4 5 6 7
An exception occurred applying plugin request [id: 'com.android.application'] > Failed to apply plugin 'com.android.internal.application'. > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. You can try some of the following options: - changing the IDE settings. - changing the JAVA_HOME environment variable. - changing `org.gradle.java.home` in `gradle.properties`.
解决办法
依次点击:File——>Project Struct——>SDK Location——>JDK location was moved to Gradle Settings,在打开的对话框中,将Gradle JDK修改为11
2.5 java.lang.IllegalAccessError: class org.jetbrains.kotlin.kapt3.base.KaptContext Android
现象
1 2 3 4
java.lang.IllegalAccessError: class org.jetbrains.kotlin.kapt3.base.KaptContext (in unnamed module @0x6acdb135) cannot access class com.sun.tools.javac.util.Context (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.util to unnamed module @0x6acdb135 at org.jetbrains.kotlin.kapt3.base.KaptContext.<init>(KaptContext.kt:28) at org.jetbrains.kotlin.kapt3.KaptContextForStubGeneration.<init>(KaptContextForStubGeneration.kt:40) at
3.1 The 'kotlin-android-extensions' Gradle plugin is deprecated
现象
1
The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.
3.2 Warning: Mapping new ns xx/common/02 to old ns xx/common/01
现象
1 2 3 4 5
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
解决办法(buildToolsVersion引起-修改前)
1 2
compileSdkVersion 30 buildToolsVersion "30.0.3"
去掉buildToolsVersion或将buildToolsVersion版本降低
1 2
compileSdkVersion 30 buildToolsVersion "30.0.2"
四 工具类
4.1 Task list not build
现象
解决办法
点击Task list not build,进入Settings——>Experimental,将Do not build Gradle task list duraing Gradle sync前面的勾选去掉,并应用