简体   繁体   English

android错误:任务':app:mergeDebugResources'的执行失败。 > java.lang.OutOfMemoryError:无法创建新的本机线程

[英]android Error:Execution failed for task ':app:mergeDebugResources'. > java.lang.OutOfMemoryError: unable to create new native thread

I'm getting the following error : 我收到以下错误:

Error:Execution failed for task ':app:mergeDebugResources'. 错误:任务':app:mergeDebugResources'的执行失败。 java.lang.OutOfMemoryError: unable to create new native thread java.lang.OutOfMemoryError:无法创建新的本机线程

This is my project gradle file 这是我的项目gradle文件

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2+'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

This is the app build gradle file 这是app build gradle文件

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion '21.1'

    defaultConfig {
        applicationId "my.app.id"
        minSdkVersion 15
        targetSdkVersion 19
        versionCode 7
        versionName "7.00"
//        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        pickFirst 'META-INF/license.txt'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/MANIFEST.MF'
    }
    lintOptions {
        checkReleaseBuilds false
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:support-v4:21.0'
    compile 'com.github.chrisbanes:PhotoView:1.3.0'
    compile 'com.google.android.gms:play-services-maps:9.4.0'
    // compile 'com.android.support:multidex:1.0.0'
    compile files('libs/acra-4.5.0.jar')
    compile files('libs/commons-io-2.4.jar')
    compile files('libs/IDTuniMagSDKAndroid.jar')
    compile files('libs/maps.jar')
    compile files('libs/picasso-2.5.2.jar')
    compile files('libs/numberpickerlib.jar')
    compile files('libs/PdfViewer.jar')
//    compile files('libs/httpmime-4.0.jar')
    compile files('libs/apache-mime4j-0.6.jar')
    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.squareup.okhttp3:okhttp:3.4.1'
    compile 'com.squareup.okio:okio:1.10.0'
    compile 'com.leo.simplearcloader:simplearcloader:1.0.+'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
    compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
    compile 'io.reactivex:rxandroid:1.0.1'
    compile 'com.akexorcist:RoundCornerProgressBar:2.0.3'
    compile 'com.github.jakob-grabner:Circle-Progress-View:v1.2.9'
}

I'm getting this error when i am building the project. 我正在构建项目时遇到此错误。 Because of this, I can't run the project either. 因此,我也无法运行该项目。 This occurs even before installing the APK in the emulator. 甚至在模拟器中安装APK之前就会发生这种情况。

Thanks in advance. 提前致谢。

It seems you clean your project.try adding this in your build.gradle 看来你清理你的project.try在build.gradle添加它

dexOptions {
        javaMaxHeapSize "4g"
    }

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

相关问题 jWebSocket java.lang.OutOfMemoryError:无法创建新的本机线程 - jWebSocket java.lang.OutOfMemoryError: unable to create new native thread java.lang.OutOfMemoryError:无法创建新的本机线程 - java.lang.OutOfMemoryError: unable to create new native thread java.lang.OutOfMemoryError:无法创建新的本机线程 - java.lang.OutOfMemoryError: unable to create new native thread 异常:java.lang.OutOfMemoryError,无法创建新的本机线程 - Exception: java.lang.OutOfMemoryError, unable to create a new native thread java.lang.OutOfMemoryError: 无法创建新的原生线程 - java.lang.OutOfMemoryError : unable to create new native Thread Kubernetes - java.lang.OutOfMemoryError:无法创建新的本机线程 - Kubernetes - java.lang.OutOfMemoryError: unable to create new native thread java.lang.OutOfMemoryError: 遇到无法创建新的本机线程 - java.lang.OutOfMemoryError: unable to create new native thread encountered PlayFramework java.lang.OutOfMemoryError:无法创建新的本地线程 - PlayFramework java.lang.OutOfMemoryError: unable to create new native thread java.lang.OutOfMemoryError无法创建新的本机线程 - java.lang.OutOfMemoryError Unable to create new native thread Java.lang.OutOfMemoryError:无法创建新的本机线程-Linux - Java.lang.OutOfMemoryError: unable to create new native thread -Linux
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM