Android Studio从3.0版本新增了许多功能,当然首当其冲就是从3.0版本新增了对 Kotlin 开发语言的支持,除此之外还有其他一些新功能,例如:Android Profiler (其中包含了: CPU Profiler、Memory Profiler、Network Profiler ),APK Debugger,Device File Explorer,Java 8 Language Features等。

android studio 3.0版本升级问题修改:

===》 问题一

Error:Cannot choose between the following configurations of project :pickerview:

- 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.

===》解决方法:

Warning:android-apt plugin is incompatible with future version of Android Gradle plugin. Please use ‘annotationProcessor' configuration instead.

原因:更新Android studio 原来项目出现问题。

分析: 尤其是采用butterknife工具的,采用新的Android Studio都会出现这样的问题,本人根据提示最后猜测原因可能是Android studio更新,然后gradle更新了,这样的话可能使原来的android-apt 工具跟不上节奏了,所以让采用annotationProcessor工具。

解决: 把project下的build.gradle 当中的依赖

修改成如下:

buildscript {

repositories {

mavenCentral()

}

dependencies {

classpath ‘com.android.tools.build:gradle:2.4.0-alpha7'

//classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.8' //注释掉}

}

然后再把module下的build.gradle :

修改如下:

dependencies {

compile project(‘:roadvance-sdk')

compile ‘com.google.dagger:dagger:2.10'

//apt ‘com.google.dagger:dagger-compiler:2.10'

annotationProcessor ‘com.google.dagger:dagger-compiler:2.10'

compile ‘com.android.support:appcompat-v7:25.3.1'

compile ‘com.jakewharton:butterknife:8.5.1'

//apt ‘com.jakewharton:butterknife-compiler:8.5.1'

annotationProcessor ‘com.jakewharton:butterknife-compiler:8.5.1'

}

再把 apply plugin: ‘com.neenbedankt.android-apt ' 这个引用给删除。

重新reBuild的一下

===》 问题二

Error:Execution failed for task ':wigetlib: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.

- butterknife-7.0.1.jar (com.jakewharton:butterknife:7.0.1)

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.

解决方法:

在app的build中

android {

...

defaultConfig {

...

//添加如下配置就OK了

javaCompileOptions {

annotationProcessorOptions {

includeCompileClasspath = true

}

}

...

}

...

}

=====》 问题三

Information:Gradle tasks [:pickerview:generateDebugSources, :pickerview:generateDebugAndroidTestSources, :pickerview:mockableAndroidJar, :zhxflib:generateDebugSources, :zhxflib:generateDebugAndroidTestSources, :zhxflib:mockableAndroidJar, :wigetlib:generateDebugSources, :wigetlib:generateDebugAndroidTestSources, :wigetlib:mockableAndroidJar, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]

D:\zhihuixinfanWorkerSpace\ZhiHuiXinFan\app\build\intermediates\manifests\full\debug\AndroidManifest.xml

Error:(12) error: unknown element found.

Error:(12) unknown element found.

Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

Error:Execution failed for task ':app:processDebugResources'.

> Failed to execute aapt

Information:BUILD FAILED in 8s

Information:6 errors

Information:0 warnings

Information:See complete output in console

解决方法:

在项目的gradle.properties中:

android.enableAapt2=false

修改了以上问题,我的项目可以正常运行了!!!

总结

以上所述是小编给大家介绍的android studio 3.0 升级 项目遇到的问题及更改思路(问题小结),希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!

android studio项目总结,android studio 3.0 升级 项目遇到的问题及更改思路(问题小结)...相关推荐

  1. android人脸解锁亮屏,EMUI 8.0升级加入全新人脸解锁 抬腕亮屏功能:快来看看如何开启...

    作为华为高端机型,华为mate10以及mate10 pro终于在近日收到了基于安卓8.0 的EMUI 8.0升级,升级之后EMUI的系统版本号为8.0.0.128SP2. 华为mate10系统更新 除 ...

  2. vue2.0 项目搭建 和vue 2.0 electron 项目搭建

    1.关于electron vue 项目的搭建 全局或者局部安装项目vue:脚手架指令生成: npm install -g vue-cli vue init simulatedgreg/electron ...

  3. android 如何完全卸载Android Studio

    今天,继续简单讲讲Android 如何完全卸载Android Studio. 由于导入了3.0的项目,所以需要将Android studio升级到3.0,必须卸载之前的Android studio2. ...

  4. 将 Web 项目从 Visual Studio .Net 2002/2003 转换到 Visual Studio 2005 的分步指南

    本页内容 转换注意事项 第一部分:准备要转换的 Visual Studio .Net 2002/2003 Web 项目 第二部分:迁移您的 Web 项目 第三部分:完成迁移的迁移后步骤 第四部分:其他 ...

  5. 初次Android 6.0升级Android 8.0的心酸总结

    前置条件 1.需要先确定你要升级的Android版本(这里我是从6.0升级到8.0,也就是compileSdkVersion从23升级到26),无论是升级到什么版本,你的AS都至少需要升级到3.0以上 ...

  6. Android Studio 4.0.+NDK项目开发详细教学

    JNI开发系列目录 JNI开发必学C++基础 JNI开发必学C++使用实践 Android Studio 4.0.+NDK项目开发详细教学 Android NDK与JNI的区别有何不同? Androi ...

  7. android studio zlib,在Android Studio 3.1中构建项目时出现“压缩执行失败”错误

    我正在尝试在Android Studio 3.1预览版中构建https://github.com/neural-nuts/Cam2Caption,但是我使用的是很旧的build.gradle,或者它死 ...

  8. android studio导入eclipse项目各种问题,eclipse项目导入android studio 各类问题及解决方法...

    随着时间的推移,技术的推进,开发android的IDE,逐渐由 eclipse转移到android studio,但-  我们的拖延症是很严重的,只要eclipse能用一天就绝不迁移 ,只到有一天,项 ...

  9. android studio抛出,Android Studio中新的项目不能运行,抛出错误(Android Studio new pr

    刚才我已经安装,并开始在Android Studio中工作,并配置我需要开始上项目的工作一切之后创建的新项目. 在新创建的项目,我没有改变任何东西,然后试图运行项目. 但它不工作,抛出一些相关性错误, ...

最新文章

  1. 码云、coding拉取项目代码
  2. kafka数据 落盘_终于知道Kafka为什么这么快了!
  3. iOS9 开发新特性 Spotlight使用
  4. python爬虫案例典型:爬取大学排名(亲测有效)
  5. 开源 ASP.NET CMS
  6. 暨南大学人文社科a类期刊_暨南大学A类期刊目录.pdf
  7. 关于计算机上使用的光盘,电脑中使用Windows DVD Maker制作光盘的方法
  8. BI报表工具FineReport的使用2【帆软聚合报表设计,最常用功能】
  9. php里style标签,style标签怎么用?
  10. 舰r最新服务器,战舰少女R官方网站—战舰少女-与心爱的舰娘一起守护这片海域...
  11. 5、流程变量Variables
  12. 跑步时戴什么耳机好、推荐几款专业跑步的耳机
  13. 字体设计中什么是断笔设计啊
  14. next.js引入图片404问题
  15. ubuntu14.04搜狗输入法中文无法切换英文
  16. Business Unit---业务单元
  17. list序列化为string存入数据库
  18. Linux强大监控工具--dstat
  19. ubuntunbsp;16.04安装smba服务
  20. hive学习-问题解答一

热门文章

  1. 安卓tinyalsa源码,可使用makefile直接编译
  2. 【工具】WPS安卓电脑无广告版
  3. upc组队赛1 小C的数学问题【单调栈】(POJ2796)
  4. debian下编译安装poco
  5. 高通暂时不会针对物联网打造专属处理器
  6. Swift 3.0 beta 6权限访问修改
  7. 【面试系列】之一:关于Cmd和Amd
  8. js——页面回到顶部
  9. .htm .html .shtml的区别
  10. phpstorm8 license key