简体   繁体   English

Build.gradle文件设置

[英]Build.gradle file setup

I am hitting the following issue. 我遇到了以下问题。 I am new to editing the guild.gradle or the proguard files. 我是第一次编辑guild.gradle或proguard文件。

Unable to execute dex: method ID not in [0, 0xffff]: 65536

Following are list of features I need from google play services. 以下是我需要Google Play服务提供的功能列表。 I have the google play version version 7571000. 我有Google Play版本7571000。

  1. Admob Ads Admob广告
  2. Analytics 分析工具
  3. IAP 行动计划

Could you please let me know the setup I need to have in build.gradle and proguard files ? 您能否让我知道我需要在build.gradle和proguard文件中进行的设置? Also Please throw some light on build.gradle and proguard files 还请注意build.gradle和proguard文件

I have added this in my build.gradle. 我已经在build.gradle中添加了它。 I still have the same issue: 我仍然有同样的问题:

Unable to execute dex: method ID not in [0, 0xffff]: 65536

Here are my libs dependencies: 这是我的库依赖项:

dependencies {
  compile 'com.google.android.gms:play-services-ads:7.5.+' 
  compile 'com.google.android.gms:play-services-analytics:7.5.+' 
  compile 'com.google.android.gms:play-services-appindexing:7.5.+' 
  compile 'com.google.android.gms:play-services-appinvite:7.5.+' 
  compile 'com.google.android.gms:play-services-auth:7.5.+' 
  compile 'com.google.android.gms:play-services-common:7.5.+' 
  compile 'com.google.android.gms:play-services-games:7.5.+' 
  compile 'com.google.android.gms:play-services-plus:7.5.+' 
}

It is seems like you have over 65K methods to do in your app. 看来您的应用程式中有超过65K的方法要做。 In this case you need to use MultiDex . 在这种情况下,您需要使用MultiDex

You can read about using MulltiDex in your app here Building Apps with Over 65K Methods 您可以在此处阅读有关在应用程序中使用MulltiDex方法是使用超过65K的方法构建应用程序

Also you can separate your GPS , like this 您也可以像这样分开GPS

compile 'com.google.android.gms:play-services-base:7.5.0'
compile 'com.google.android.gms:play-services-ads:7.5.0'
compile 'com.google.android.gms:play-services-gcm:7.5.0'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM