今天由于开发环境问题,下载了最新版的AndroidStudio的,之前的项目编译报错,提示:
Error:Execution failed for task ':app:javaPreCompileDebug'.> Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor. Please add them to the annotationProcessor configuration. - permissionsdispatcher-processor-2.3.1.jar Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with previous behavior. Note that this option is deprecated and will be removed in the future. See https://developer.android.com/r/tools/annotation-processor-error-message.html for more details.
在project/app/build.gradle的android{defaultConfig{}}中添加:
build.gradle
apply plugin: 'com.android.application' .... androdi{ defaultConfig{ .... ... javaCompileOptions { annotationProcessorOptions { includeCompileClasspath true } } }}
—————————-2017年7月26日15:50:07————————————-
Information:Gradle tasks [:app:assembleBaiduDebug]C:\Users\Vincent\.gradle\caches\transforms-1\files-1.1\imagepicker-0.5.5.aar\2783c71f1a32429aa98ba1cbe71dc0ae\res\values\values.xmlError:(22, 5) style attribute '@android:attr/windowEnterAnimation' not foundError:(22, 5) style attribute '@android:attr/windowExitAnimation' not foundError:(31, 5) style attribute '@android:attr/windowEnterAnimation' not foundError:(31, 5) style attribute '@android:attr/windowExitAnimation' not foundError:E:\MyProject\Hss\app\build\intermediates\incremental\mergeBaiduDebugResources\merged.dir\values\values.xml:1862 style attribute '@android:attr/windowEnterAnimation' not foundError:E:\MyProject\Hss\app\build\intermediates\incremental\mergeBaiduDebugResources\merged.dir\values\values.xml:2545 style attribute '@android:attr/windowEnterAnimation' not foundError:failed linking referencesError:java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.AaptException: AAPT2 link failed:Error:com.android.builder.internal.aapt.AaptException: AAPT2 link failed:Error:Execution failed for task ':app:processBaiduDebugResources'.> Failed to execute aapt
解决方案:
关掉AAPT2即可
在Project/gradle.properties中添加 android.enableAapt2=false
android.enableAapt2=false
——————–2017年7月27日09:49:33——–
联系客服