gpt4 book ai didi

java - android 错误 :Execution failed for task ':app:mergeDebugResources' . > java.lang.OutOfMemoryError: 无法创建新的 native 线程

转载 作者:太空宇宙 更新时间:2023-11-04 12:05:54 30 4
gpt4 key购买 nike

我收到以下错误:

Error:Execution failed for task ':app:mergeDebugResources'. java.lang.OutOfMemoryError: unable to create new native thread

这是我的项目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
}

这是应用程序构建 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'
}

我在构建项目时遇到此错误。因此,我也无法运行该项目。即使在模拟器中安装 APK 之前也会发生这种情况。

提前致谢。

最佳答案

看来你清理了你的项目。尝试将其添加到你的 build.gradle

dexOptions {
javaMaxHeapSize "4g"
}

关于java - android 错误 :Execution failed for task ':app:mergeDebugResources' . > java.lang.OutOfMemoryError: 无法创建新的 native 线程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40365120/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com