网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

解决Androidstudio2.3升级到Androidstudio3.0后apt报错问题

1.现象描述

创新互联公司网站建设由有经验的网站设计师、开发人员和项目经理组成的专业建站团队,负责网站视觉设计、用户体验优化、交互设计和前端开发等方面的工作,以确保网站外观精美、成都做网站、网站设计易于使用并且具有良好的响应性。

原来项目在Android studio 2.3一切正常,升级3.0之后报如下错误:

Error:Cannot choose between the following configurations of project :android_sdk:
 - 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.api.attributes.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.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
   - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required.
   - Found org.gradle.api.attributes.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.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
   - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required.
   - Found org.gradle.api.attributes.Usage 'java-runtime' but wasn't required.

2.解决办法:

project的build.gradle文件中删除

classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

module的build.gradle文件中删除

apply plugin: 'com.neenbedankt.android-apt'

module的build.gradle文件中替换

//apt 'com.jakewharton:butterknife-compiler:8.0.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.0.1'

ps:下面再给大家补充介绍android studio更新到3.0后,不支持apt问题

android studio更新到3.0后,不支持apt了,适配仅需要修改以下两点:

1.移除module目录下的build.gradle中的 apply plugin: 'android-apt' 

2.将apt改成annotationProcessor

例如:

apt 'com.google.dagger:dagger-compiler:2.0.2'

改成

annotationProcessor 'com.google.dagger:dagger-compiler:2.0.2'

总结

以上所述是小编给大家介绍的解决Android studio 2.3升级到Android studio 3.0 后apt报错问题,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对创新互联网站的支持!


标题名称:解决Androidstudio2.3升级到Androidstudio3.0后apt报错问题
文章起源:http://bjjierui.cn/article/gsdjcs.html

其他资讯