Gradle sync failed: Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated{apkData=Main{type=MAIN, fullName=xiaomiDebug, filters=[]}} of type com.android.build.gradle.internal.api.ApkVariantOutputImpl.
Gradle sync failed: Cannot choose between the following configurations of project :androidSDK: - debugApiElements - debugRuntimeElements - releaseApiElements - releaseRuntimeElements All of them match the consumer attributes: - Configuration 'debugApiElements': - Found com.android.build.api.attributes.BuildTypeAttr 'debug' but wasn't required. - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required. - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required. - Found org.gradle.api.attributes.Usage 'java-api' but wasn't required. - Configuration 'debugRuntimeElements': - Found com.android.build.api.attributes.BuildTypeAttr 'debug' but wasn't required. - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required. - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required. - Found org.gradle... (show balloon)
继续Tran Again提示需要更新Android SDK Build Tools version 至 26.0.2 之后报错
1 2
Error:android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor' configuration instead. Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r/tools/flavorDimensions-missing-error-message.html
Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r/tools/flavorDimensions-missing-error-message.html
根据官网说法:
1
you need to first declare one or more dimensions using the flavorDimensions property. After that, assign each flavor to one of the dimensions you declared
// Specifies two flavor dimensions. flavorDimensions "tier", "minApi"
productFlavors { free { // Assigns this product flavor to the "tier" flavor dimension. Specifying // this property is optional if you are using only one dimension. dimension "tier" ... }
Error:found unexpected optical bounds (red pixel) on top border at x=102. Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details Error:Execution failed for task ':ygj_new:merge_360DebugResources'. > Error: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
是因为项目.9图片中含有红色边线,删除即可
继续Try Again:
1 2 3 4
FAILURE: Build failed with an exception.
* What went wrong: Task 'compileDebug' is ambiguous in root project 'eachonline_upgrade'. Candidates are: 'compileDebugAidl', 'compileDebugAndroidTestAidl', 'compileDebugAndroidTestJavaWithJavac', 'compileDebugAndroidTestKotlin', 'compileDebugAndroidTestNdk', 'compileDebugAndroidTestRenderscript', 'compileDebugAndroidTestShaders', 'compileDebugAndroidTestSources', 'compileDebugJavaWithJavac', 'compileDebugKotlin', 'compileDebugNdk', 'compileDebugRenderscript', 'compileDebugShaders', 'compileDebugSources', 'compileDebugUnitTestJavaWithJavac', 'compileDebugUnitTestKotlin', 'compileDebugUnitTestSources'.
继续Tran Again:
1 2
Error:Execution failed for task ':ygj_new:transformClassesWithAndroidGradleClassShrinkerFor_360Debug'. > java.lang.ArrayIndexOutOfBoundsException (no error message)