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' }

最新文章

  1. VMware中解决ubuntu不能连接网络问题。(亲测有效)
  2. Leetcode Permutations
  3. 一个关于Random算法的问题
  4. 【Spring】简单的Spring AOP注解示例
  5. Metronic 与 VS2013/2015 合作开发
  6. SDRAM 学习(三)之command
  7. 从HashMap透析哈希表
  8. jquery ajax跨域的完美解决方法(jsonp方式)
  9. 剑指OFFER之从1到n中出现1的次数(九度OJ1373)
  10. Learning WCF Chapter1 Generating a Service and Client Proxy
  11. 如何恢复未释放租约的HDFS文件
  12. 基于SwiperJs的H5/移动端下拉刷新上拉加载更多的效果
  13. Mysql隔离级别,锁与MVCC
  14. 博弈论进阶之SG函数
  15. 从零开始学习微信小程序
  16. 使用scss为css样式自动添加浏览器前缀
  17. vsftpd虚拟账户配置
  18. 基于结构化平均感知机的分词器Java实现
  19. 国内Maven仓库 - 2018年5月2日15:54:10
  20. async.waterfall

热门文章

  1. Android开机广播
  2. ThinkPHP 空方法 显示
  3. 利用iframe实现无刷新上传处理
  4. DOS命令:IIS安装与卸载
  5. iNeedle产品介绍
  6. WIN 下的超动态菜单(一)
  7. ASP.NET Core 1.0 安装并发布到Centos 7.2 使用jexus 5.8.2
  8. MySQL版本介绍
  9. CentOS下mysql默认安装位置
  10. COM中的线程模式