android studio 使用问题 解决方法
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 使用问题 解决方法的更多相关文章
- 安装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日 ...
- Android Studio 常见问题及解决方法
一.Error:All flavors must now belong to a named flavor dimension 问题描述: Error:All flavors must now bel ...
- android studio提示信息乱码解决方法
在build.gradle文件中加上 android {compileOptions.encoding = "GBK"}就好了
- Android开发-Android Studio问题以及解决记录
[Android开发] Android Studio问题以及解决记录 http://blog.csdn.net/niubitianping/article/details/51400721 1.真 ...
- android studio 添加get,set方法快捷方式
android studio 添加get,set方法快捷方式
- 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 ...
- 安装android studio时候弹出unable to access android sdk add-on list解决方法
本文转载自:http://www.cnblogs.com/rancvl/p/6081791.html Android Studio First Run 检测 Android SDK 及更新,由于众所周 ...
- Android Studio INSTALL_FAILED_UID_CHANGED的解决办法
使用Android Studio开发Android应用,把Android应用调试安装在手机上时,出现了安装失败的提示:INSTALL_FAILED_UID_CHANGED. 上网找了很多资料: 1.说 ...
- android studio 更新Gradle版本方法
在导入其他项目时,经常由于gradle版本不一致而导致不能编译 解决方法: 第一步: 按提示点击让它下载,其实目的并不是要它下载,因为这样速度会很慢,这样做只是为了让它在本地创建相应的目录结构 第二步 ...
随机推荐
- 如何开启win7端口的图文教程
Windows 7/Vista/XP/2003等系统中的远程终端服务是一项功能非常强大的服务,下面来教教大家如何开启端口:打开“控制面板”中的“Windows防火墙”,点击左侧的“高级设置” 右击“入 ...
- .net C# 图片转Base64 Base64转图片
//图片 转为 base64编码的文本 private void button1_Click(object sender, EventArgs e) { OpenFileDialog dlg = ne ...
- 关于SQLSERVER2012版本远程登录问题
最近公司新配置了一台服务器,安装的数据库版本为sqlserver2012企业版本,一切安装正常,本地登录也正常 需要远程客户端登录,防火墙也开放的端口,路由器也做了端口映射,因为我们有两台服务器,14 ...
- 安装centos 7后恢复windows 2008R2 (Windows7)启动项
安装CentOS 7,安装之后发现Win2008R2的启动项不见了(Windows7同理).一般安装Linux过程中会自动识别windows系统并添加引导项,centos的问题在于默认不支持ntfs分 ...
- js技术发展
将.NET代码编译为JavaScript 你可以使用如下工具将C#.F#以及其他.NET代码编译为JavaScript代码. Apps in Motion:允许使用C#来构建可以运行在任何设备上的We ...
- sqlalchemy多表联合查询(join)
使用outerjoin instances = db.session.query(Instance.name, Instance.sep_status, User.email).outerjoin( ...
- asp.net之treeview无法显示树结点图标(IP与域名的表现竟不一样)
背景 今天接到客户的电话,说部署上去的项目树型的treeview无法正常显示,显示成了好几个大红叉.如: 排查 于是我通过远程登录到服务器,在本地测试了一会发现没有这个问题存在,无论是通过IP ...
- 创建一个Point类,有成员变量x,y,方法getX(),setX(),还有一个构造方 法初始化x和y。创建类主类A来测试它
package com.hanqi.test; public class Point { private int x; private int y; Point(int xx,int yy) { x= ...
- 多年前写的DataTable与实体类的转换,已放github
本文版权归mephisto和博客园共有,欢迎转载,但须保留此段声明,并给出原文链接,谢谢合作. 文章是哥(mephisto)写的,SourceLink 阅读目录 介绍 起因 代码 UnitTest G ...
- Windows Azure IP地址详解
Windows Azure上的IP地址有以下几种: 公网IP地址 VIP ILPIP Reserved IP 内网IP地址 DIP Static IP VIP是动态分配的公网IP,VIP可以被分配到云 ...