用Android Studio3.1打开很久以前的项目的时候报错哦:
- 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.api.attributes.VariantAttr 'debug' but wasn't required.
- Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
- Found org.gradle.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.api.attributes.VariantAttr 'debug' but wasn't required.
- Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
- Found org.gradle.usage 'java-runtime' but wasn't required.
- Configuration 'releaseApiElements':
- Found com.android.build.api.attributes.BuildTypeAttr 'release' but wasn't required.
- Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
- Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
- Found org.gradle.usage 'java-api' but wasn't required.
- Configuration 'releaseRuntimeElements':
- Found com.android.build.api.attributes.BuildTypeAttr 'release' but wasn't required.
- Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
- Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
- Found org.gradle.usage 'java-runtime' but wasn't required.
经过查找资料,最后的问题定位到apt插件的使用上面。应该是as3.1不让用apt插件了??我也不太清楚。。。因为这个项目用到了butterknife。并且是用apt这种方式引入进来的。
解决办法:
project下面的build.gradle文件里去掉:
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
app目录下面的build.gradle文件里去掉最上面的:
apply plugin: 'com.neenbedankt.android-apt'
然后把:
apt 'com.jakewharton:butterknife-compiler:8.4.0'
修改成
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
然后sync就好了。
每日语录:
因为懂得。所以慈悲。。。
单曲循环《大雨还在下》
一首高中时候听得老歌。还是因为那个时候的一个同学总是听。说是很好听。被迫跟着听了很久。听着听着。觉得还不错哎。今天突然想到了高中。就想到了这首歌。找来听听。嗯。还不错。不过现在的我。只觉得是个回忆。不适合单曲循环了。循环了十遍。就听不下去了。。所以。我的品位是变好了。还是 更坏了呢。。。