错误:未捕获的转换错误:java.util.concurrent.ExecutionException:java.lang.OutOfMemoryError:GC开销限制超出

时间:2016-12-06 18:52:33

标签: android

请帮帮我。我在项目中得到了这些问题:

错误:未捕获的转换错误:java.util.concurrent.ExecutionException:java.lang.OutOfMemoryError:超出GC开销限制

错误:任务':app:transformClassesWithDexForDebug'执行失败。

  

com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:java.util.concurrent.ExecutionException:java.lang.UnsupportedOperationException

Android Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="phonelocation.trouverphone.asuss550c.phonelocation" >

    <uses-permission android:name="phonelocation.example.asuss550c.phonelocation.permission.MAPS_RECEIVE" />

    <permission
        android:name="phonelocation.trouverphone.asuss550c.phonelocation.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />


    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.READ_SMS" />
    <uses-permission android:name="android.permission.SEND_SMS" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <!--<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />-->
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <!--<uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
   <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.VIBRATE" />

   <uses-feature
       android:glEsVersion="0x00020000"
       android:required="true" />


   <application

       android:allowBackup="true"
       android:icon="@drawable/cover"
       android:label="@string/app_name"
       android:theme="@style/AppTheme" >
       <meta-data
           android:name="com.google.android.gms.version"
           android:value="@integer/google_play_services_version" />
       <meta-data
           android:name="com.google.android.maps.v2.API_KEY"
           android:value="MAP_API_CODE" />

       <activity
           android:name="phonelocation.trouverphone.asuss550c.phonelocation.MainActivity"
           android:excludeFromRecents="true"
           android:label="@string/app_name"
           android:screenOrientation="portrait" >
           <intent-filter>
               <action android:name="android.intent.action.MAIN" />

               <category android:name="android.intent.category.LAUNCHER" />
           </intent-filter>
       </activity>

       <receiver android:name="phonelocation.trouverphone.asuss550c.phonelocation.IncomingSms"
           android:permission="android.permission.BROADCAST_SMS"
           tools:ignore="UnprotectedSMSBroadcastReceiver">
           <intent-filter android:priority="2147483647">
               <action android:name="android.provider.Telephony.SMS_RECEIVED" />
               <action android:name="android.intent.action.BOOT_COMPLETED" />
               <category android:name="android.intent.category.DEFAULT" />
           </intent-filter>
       </receiver>

       <activity
           android:name="phonelocation.trouverphone.asuss550c.phonelocation.SubSetting"
           android:excludeFromRecents="true"
           android:label=" " >
       </activity>
       <activity
           android:name="phonelocation.trouverphone.asuss550c.phonelocation.MapDisplay"
           android:excludeFromRecents="true"
           android:label="@string/title_activity_map_display" >
       </activity>
       <activity
           android:name="phonelocation.trouverphone.asuss550c.phonelocation.VisitLocations"
           android:label=" " >
       </activity>
       <activity
           android:name="phonelocation.trouverphone.asuss550c.phonelocation.FindMyphone"
           android:label="@string/ListIFind" >
       </activity>
       <activity
           android:name="phonelocation.trouverphone.asuss550c.phonelocation.ContactList"
           android:label="@string/title_activity_find_myphone" >
       </activity>
       <activity
           android:name="phonelocation.trouverphone.asuss550c.phonelocation.PhoneVerify"
           android:label="@string/title_activity_phone_verify" >
       </activity>
       <activity
           android:name="com.google.android.gms.ads.AdActivity"
           android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
           android:theme="@android:style/Theme.Translucent" />
   </application>

</manifest>

的build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

    defaultConfig {
        multiDexEnabled true
        applicationId "phonelocation.trouverphone.asuss550c.phonelocationphone"
        minSdkVersion 12
        targetSdkVersion 23
        versionCode 26
        versionName "1.0.4"


    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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

    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:support-v4:23.1.0'
    compile 'com.android.support:design:23.1.0'
    compile 'com.google.android.gms:play-services:9.2.0'
    // compile 'com.google.android.gms:play-services:9.0.2'
    //compile 'com.google.firebase:firebase-core:9.2.0'
    //compile 'com.google.firebase:firebase-ads:9.2.0'
  //  compile 'com.google.firebase:firebase-crash:9.0.2'
}
  //apply plugin: 'com.google.gms.google-services'

1 个答案:

答案 0 :(得分:0)

gradle守护进程根本没有足够的内存来完成你的构建,导致它永远被垃圾收集卡住,直到它放弃。

有关如何增加分配的内存的信息,请参阅To run dex in process, the Gradle daemon needs a larger heap. It currently has approximately 910 MB