android dex 64k,在. dex 文件超过 64K的情况下,android的方法引用数量_android_开发99编程知识库...

当前在我的项目中包括和firebase库之后,在我的android应用程序中进行操作,不能运行代码。

app: prepackagemarkerfordebug: transformclasseswithdexfordebug: 在进程中运行,Gradle守护进程需要更大的堆。 它目前有大约 910 MB 。 为了快速构建,将Gradle守护进程的最大堆大小增加到 2048 MB 。 要在项目 gradle.properties 中设置 org 。gradle 。jvmargs=-xmx2048m 。 有关更多信息,请参阅 https://docs.gradle.org/current/userguide/build_environment.html 在. dex 文件中的方法引用数量不能超过1 K 。 了解如何在 https://developer.android.com/tools/building/multidex.html: 应用程序中解决这里问题:任务': 应用程序:transformclasseswithdexfordebug'的transformclasseswithdexfordebug失败 Error:Execution 失败。 com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util. concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: 进程''/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java''完成了非零退出值 2

我的build.gradle 文件在这里:apply plugin: 'com.android.application'

android {

compileSdkVersion 23

buildToolsVersion"23.0.2"

defaultConfig {

applicationId"xyz.in.network"

minSdkVersion 16

targetSdkVersion 23

versionCode 1

versionName"1.0"

}

buildTypes {

release {

shrinkResources true

minifyEnabled true

proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

multiDexEnabled true

}

}

}

dependencies {

compile fileTree(dir: 'libs', include: ['*.jar'])

testCompile 'junit:junit:4.12'

compile project(':libs:ViewPagerIndicator')

compile 'com.google.android.gms:play-services:9.0.0'

compile 'com.android.support:appcompat-v7:23.4.0'

compile 'com.android.support:design:23.4.0'

compile 'com.google.android.gms:play-services-maps:9.0.0'

compile 'com.google.android.gms:play-services-location:9.0.0'

compile 'com.android.support:cardview-v7:23.4.0'

compile 'com.getbase:floatingactionbutton:1.10.1'

compile 'com.squareup.picasso:picasso:2.5.2'

compile 'com.android.volley:volley:1.0.0'

compile 'com.google.firebase:firebase-messaging:9.0.0'

compile 'com.android.support:multidex:1.0.1'

}

apply plugin: 'com.google.gms.google-services'

我的manifestfile在这儿

android:allowBackup="true"

android:icon="@mipmap/ic_launcher"

android:label="@string/app_name"

android:name="android.support.multidex.MultiDexApplication"

android:supportsRtl="true"

android:theme="@style/AppTheme">

android:screenOrientation="portrait"

android:theme="@style/Theme.Transparent">

android:name="com.google.android.gms.version"

android:value="@integer/google_play_services_version"/>

将堆大小增加到 2048 M 之后。 Gradle给出这里错误

Error:Execution 对任务': 应用程序:transformclasseswithdexfordebug'失败。 com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util. concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: 方法ID不在 [0, 0 xffff] 中: 65536

我遵循了android开发者站点提供的所有指导,但仍然有这个问题。 如何 解决 这个 问题?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值