1、Failed to import new Gradle project: Could not install Gradle distribution from'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.

问题原因:中国连接gradle的地址被强了

解决方案:修改android studio设置Http Proxy->Auto-detect proxy settings

2、编译时报错“Compilation completed with 2 errors and 0 warnings in 9 sec
Gradle: 
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':teston:packageDebug'.
> org.bouncycastle.asn1.ASN1Integer.<init>(J)V

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.”

问题原因:引用了第三方包,未导入

解决方案:在build.gradle的

dependencies {
compile files('libs/android-support-v4.jar')}

中导入既可;

问题原因:代码中包涵了中文,导致编译时出现不可映射字符

解决方案:在build.gradle中加入

tasks.withType(Compile){
options.encoding='UTF-8'
}

编码定义即可;

android studio常见错误的更多相关文章

  1. Android studio 常见错误修改

    一,依赖冲突 All com.android.support libraries must use the exact same version specification (mixing versi ...

  2. Android Studio那些错误的问题们

    本片博客会记录关于Android开发工具Android Studio出错的那些问题,包括导入项目编译失败.时间过长,莫名其妙的歇菜等等... 问题 3facets cannot be loaded.Y ...

  3. Android Studio常见对话框(普通对话框、单选对话框、多选对话框、进度条对话框、消息对话框、自定义对话框)

    Android Studio常见对话框(普通对话框.单选对话框.多选对话框.进度条对话框.消息对话框.自定义对话框) 1.普通对话框 2.单选对话框 3.多选对话框 4.进度条对话框 5.消息对话框 ...

  4. Android studio 相关错误处理

    1.android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"  -->  在Activity中设置,表 ...

  5. Android开发常见错误类型一览表

    这是我的第一个博客,我会一直添加我在Android开发中遇到的错误,用来记录我开发中踩过的那些坑 ------------------------分割线------------------------ ...

  6. android studio 程序错误

    一.错误类型: com.android.tools.fd.runtime.BootstrapApplication cannot be cast to 成功修改方式 File --> Setti ...

  7. Android studio的错误:radle sync failed: Cause: failed to find target android-21 :

    这个错误在Android studio中经常出现,特别是你在编译不同的app的时候,到底是什么原因会导致该错误产生呢? 首先看错误信息,是找不到目标android版本-21导致的,这就很明显了,你的目 ...

  8. Android Studio 编译错误 Error:Execution failed for task ':app:buildInfoDebugLoader'.

    今天来到打开昨天的项目运行正常,然后改动了一点代码编译报错: Error:Execution failed for task ':app:buildInfoDebugLoader'. > Exc ...

  9. [转]编译Android源代码常见错误解决办法

    1. 编译时出现/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libz.so when ...

随机推荐

  1. AFNetworking 2.5.0版本的使用

    http://www.mamicode.com/info-detail-477899.html AFNetworking 2.5.0版本的使用 http://afnetworking.com/ htt ...

  2. ubuntu 安装 phpmyadmin

    安装步骤 1 apt-get install phpmyadmin 2 安装完后默认的安装位置是在/usr/share 而不是在/var/www 所以 需要将其链接到/var/www来,复制的话貌似需 ...

  3. nova 虚拟机迁移

    ref: 官方文档很给力: nova 迁移有以下类型: Non-live migration (sometimes referred to simply as ‘migration’). The in ...

  4. c#.net Excel中的数据导入到SQL数据库中

    /// <summary>        /// 从Excel 导入学生        /// </summary>        /// <param name=&qu ...

  5. JS添加删除DIV

    function addDiv(w,h){     //如果原来有“divCell”这个图层,先删除这个图层    deleteDiv();    //创建一个div       var my = d ...

  6. oracle11g 连接问题

    一.The Network Adapter could not establish the connection  状态: 失败 -测试失败: IO 错误: The Network Adapter c ...

  7. ACM/ICPC 之 暴力打表(求解欧拉回路)-编码(POJ1780)

    ///找到一个数字序列包含所有n位数(连续)一次且仅一次 ///暴力打表 ///Time:141Ms Memory:2260K #include<iostream> #include< ...

  8. MySQL 主键范围查找问题

    背景: 今天遇到一个主键范围查找的情况: id是主键,每次取10000.上面的这个查询id范围越往后面消耗的时间越久.通过id自增主键去查找数据应该不会出现这个现象的.以前都没有注意这个奇怪的现象,现 ...

  9. google 语音api

    mdeia.Source = new Uri("http://translate.google.cn/translate_tts?ie=UTF-8&q=你好&tl=zh-CN ...

  10. 从json传递数据显示表格实例

    @interface ViewController ()<UITableViewDataSource,UITableViewDelegate> { UITableView* table; ...