1、

Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-oracle/bin/java'' finished with non-zero exit value 3

解决:

在build.gradle中添加:

dexOptions {
javaMaxHeapSize "4g" //specify the heap size for the dex process
preDexLibraries = false //delete the already predexed libraries
}

如下:
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1" defaultConfig {
applicationId "com.myapplicationname.app"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
//====================Add below two line=============
dexOptions {
javaMaxHeapSize "4g" //specify the heap size for the dex process
preDexLibraries = false //delete the already predexed libraries
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
useLibrary 'org.apache.http.legacy' } dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.google.android.gms:play-services:8.3.0'
compile files('libs/gcm.jar')
compile 'com.android.support:multidex:1.0.1'
compile 'org.apache.httpcomponents:httpcore:4.4.4'
compile('org.apache.httpcomponents:httpmime:4.3.6') {
exclude module: "httpclient"
}
//facebook sdk
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile 'org.apache.httpcomponents:httpcore:4.4.3' compile 'com.paypal.sdk:paypal-android-sdk:2.12.4'
//facebook sdk
compile 'com.facebook.android:facebook-android-sdk:4.7.0' }

android studio 使用问题 解决方法的更多相关文章

  1. 安装Android studio出现'tools.jar' seems to be not in Android Studio classpath......的解决方法

    安装Android studio出现'tools.jar' seems to be not in Android Studio classpath......的解决方法 原创 2015年07月31日 ...

  2. Android Studio 常见问题及解决方法

    一.Error:All flavors must now belong to a named flavor dimension 问题描述: Error:All flavors must now bel ...

  3. android studio提示信息乱码解决方法

    在build.gradle文件中加上 android {compileOptions.encoding = "GBK"}就好了

  4. Android开发-Android Studio问题以及解决记录

    [Android开发] Android Studio问题以及解决记录   http://blog.csdn.net/niubitianping/article/details/51400721 1.真 ...

  5. android studio 添加get,set方法快捷方式

    android studio 添加get,set方法快捷方式

  6. Android Studio 2.3.3 出现Error:(26.13) Fail to resole: com.android.support.appcompat永久解决方法

    Android Studio 出现Error(26.13):Fail to resole:com.android.support.appcompat-v7.28_ Install Repository ...

  7. 安装android studio时候弹出unable to access android sdk add-on list解决方法

    本文转载自:http://www.cnblogs.com/rancvl/p/6081791.html Android Studio First Run 检测 Android SDK 及更新,由于众所周 ...

  8. Android Studio INSTALL_FAILED_UID_CHANGED的解决办法

    使用Android Studio开发Android应用,把Android应用调试安装在手机上时,出现了安装失败的提示:INSTALL_FAILED_UID_CHANGED. 上网找了很多资料: 1.说 ...

  9. android studio 更新Gradle版本方法

    在导入其他项目时,经常由于gradle版本不一致而导致不能编译 解决方法: 第一步: 按提示点击让它下载,其实目的并不是要它下载,因为这样速度会很慢,这样做只是为了让它在本地创建相应的目录结构 第二步 ...

随机推荐

  1. iOS 学习 - 9.Block 入门

    来自李明杰的视频. block 用来保存一段代码 block 的标志:^ block  跟函数很像: 1).可以保存代码  2).有返回值  3). 有形参 temp1:没有返回值.没有形参的 blo ...

  2. Struts

    Struts是基于MVC的框架,它进一步的对MVC进行了封装. MVC 概念 MVC全名是Model View Controller,是模型(model)—视图(view)—控制器(controlle ...

  3. Jmeter教程索引贴

    新的一年即将到来,不知不觉2015年自己在Jmeter方面总结的文章有十几篇,在此汇总一下,顺便也算是个总结吧.2016年,继续学习技术,总结,写文章. 一.基础部分: 使用Jmeter进行http接 ...

  4. Unknown tag

    <c:forEach items="" var="" varStatus="s">缺少<%@ taglib uri=&qu ...

  5. 开启Tomcat 源码调试

    开启Tomcat 源码调试 因为工作的原因,需要了解Tomcat整个架构是如何设计的,正如要使用Spring MVC进行Web开发,需要了解Spring是如何设计的一样,有哪些主要的类,分别是用于干什 ...

  6. PHP代码规范

    PHP编码规范 1. 标识符命名规范 标识符的命名力求做到统一.达意和简洁. 1.1 统一 统一是指,对于同一个概念,在程序中用同一种表示方法,比如对于供应商,既可以用supplier,也可以用pro ...

  7. my_strstr()

    const char* my_strstr(const char* S1,const char* S2){ int i=0,flag=0; while('\0'!=*(S1+i)){ if(*(S1+ ...

  8. tools:context=".MainActivity的作用(转)

    android:layout_width="match_parent" android:layout_height="match_parent" android ...

  9. mysql级联更新

    MySQL  各种级联查询后更新(update select). CREATE TABLE `tb1` (  `id` int(11) NOT NULL,  `A` varchar(100) defa ...

  10. 如何更改nginx网站根目录 以及解析php

    nginx默认网站根目录为/usr/local/nginx/html,如果想要将它改成/data/www 需配置 vim /usr/local/nginx/conf/nginx.conf 将其中的字段 ...