3.0上在运行一个开源项目(github.com/BaronZ88/MinimalistWeather )时遇到的问题,下面就依据这个项目导入报错给予分析:
下面是具体报出来的错误:
E:\work_space\MinimalistWeather-master\app\build.gradleWarning:One of the plugins you are using supports Java 8 language features. To try the support built into the Android plugin, remove the following from your build.gradle: apply plugin: 'me.tatarka.retrolambda'To learn more, go to https://d.android.com/r/tools/java-8-support-message.htmlError:Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :library.Open File
Show DetailsError:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve project :library.Open File
Show DetailsError:Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve project :library.Open File
Show DetailsError:Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve project :library.Open File
Show DetailsError:Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve project :library.Open File
升级AS3.0之后,报出的错误刚开始也是在网上查了好久,一个个的改,终于,将问题找出来,解决了,让项目跑起来了,感觉很爽。
话不多说,思路如下:
导入AS3.0的话需要做一些配置:
首先由于android studio 3.0 对lambda 表达式支持,不需要使用第三方库,另外,JDK1.8才支持lambda
,所以需要删一些东西。
1.app--build.gradle中的 apply plugin: 'me.tatarka.retrolambda 需要删除,
dependencies中的:
releaseCompile project(path: ':library', configuration: 'release')
debugCompile project(path: ':library', configuration: 'debug')
但是,将library删除之后,你还需要将其在project strcture中重新导入
2. library的build.gradle中 apply plugin: 'me.tatarka.retrolambda' 删了
3.最后是删了project的build.gradle 中的:classpath 'me.tatarka:gradle-retrolambda:3.3.1'
4.最后需要将gradle.properties文件中添加android.enableAapt2=false ,关闭关闭aapt2的编译。
再进行编译,就能跑起来了
网友评论