因此,在从
升级build.gradle(Project)之后运行项目时出现以下错误dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
到
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
我刚刚将gradle从2.0.0-alpha2
更改为2.0.0-alpha3
,然后尝试构建项目。
错误日志:
Information:Gradle tasks [:app:assembleDebug]
:app:incrementalDebugBuildInfoGenerator
:app:preBuild UP-TO-DATE
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportCustomtabs2311Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2311Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE
:app:prepareComDigitsSdkAndroidDigits192Library UP-TO-DATE
:app:prepareComTwitterSdkAndroidTweetComposer102Library UP-TO-DATE
:app:prepareComTwitterSdkAndroidTweetUi180Library UP-TO-DATE
:app:prepareComTwitterSdkAndroidTwitter1110Library UP-TO-DATE
:app:prepareComTwitterSdkAndroidTwitterCore162Library UP-TO-DATE
:app:prepareIoFabricSdkAndroidFabric1310Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:injectDebugBootstrap
Instrumented app with a fast deploy bootstrapping application
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:fabricGenerateResourcesDebug
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugResources
:app:generateDebugSources
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:fastDeployDebugExtractor
:app:generateDebugInstantRunAppInfo
:app:transformClassesWithExtractJarsForDebug
:app:transformClassesWithInstantRunVerifierForDebug
:app:transformClassesWithInstantRunForDebug
IncrementalSupportVisitor Visiting com/waysay/R$color
IncrementalSupportVisitor Visiting com/waysay/R$style
IncrementalSupportVisitor Visiting com/waysay/R$attr
IncrementalSupportVisitor Visiting com/waysay/R$dimen
IncrementalSupportVisitor Visiting com/waysay/R$integer
IncrementalSupportVisitor Visiting com/waysay/R$anim
IncrementalSupportVisitor Visiting com/waysay/BuildConfig
IncrementalSupportVisitor Visiting com/waysay/R$mipmap
IncrementalSupportVisitor Visiting com/waysay/R$menu
IncrementalSupportVisitor Visiting com/waysay/R
IncrementalSupportVisitor Visiting com/waysay/R$drawable
IncrementalSupportVisitor Visiting com/waysay/R$raw
IncrementalSupportVisitor Visiting com/waysay/R$layout
IncrementalSupportVisitor Visiting com/waysay/R$plurals
IncrementalSupportVisitor Visiting com/waysay/R$styleable
IncrementalSupportVisitor Visiting com/waysay/R$id
IncrementalSupportVisitor Visiting com/waysay/R$string
IncrementalSupportVisitor Visiting com/waysay/R$bool
IncrementalSupportVisitor Visiting com/waysay/models/WsModelPreference
IncrementalSupportVisitor Visiting com/waysay/models/WsModelMessage
IncrementalSupportVisitor Visiting com/waysay/models/ModelPreference$1
IncrementalSupportVisitor Visiting com/waysay/models/WsModelComment
IncrementalSupportVisitor Visiting com/waysay/models/ModelGetAnonymousJWT
IncrementalSupportVisitor Visiting com/waysay/models/ModelInboxFeed
IncrementalSupportVisitor Visiting com/waysay/models/ModelGetAnonymousJWT$1
IncrementalSupportVisitor Visiting com/waysay/models/ModelPreference
IncrementalSupportVisitor Visiting com/waysay/adapters/RecyclerAdapterMessage$1
IncrementalSupportVisitor Visiting com/waysay/adapters/RecyclerAdapterComment$CommentViewHolder
IncrementalSupportVisitor Visiting com/waysay/adapters/RecyclerAdapterMessage$MessagesViewHolder$1
IncrementalSupportVisitor Visiting com/waysay/adapters/AdapterPreference$1
IncrementalSupportVisitor Visiting com/waysay/adapters/RecyclerAdapterMessage$MessagesViewHolder
IncrementalSupportVisitor Visiting com/waysay/adapters/RecyclerAdapterComment
IncrementalSupportVisitor Visiting com/waysay/adapters/RecyclerAdapterMessage
IncrementalSupportVisitor Visiting com/waysay/adapters/AdapterPreference
IncrementalSupportVisitor Visiting com/waysay/adapters/RecyclerAdapterMessage$MessagesViewHolder$2
IncrementalSupportVisitor Visiting com/waysay/fragments/DummyFragment$1
IncrementalSupportVisitor Visiting com/waysay/fragments/DialogFragmentUserProfile$2
IncrementalSupportVisitor Visiting com/waysay/fragments/FragmentPlaceholder$2
IncrementalSupportVisitor Visiting com/waysay/fragments/DialogFragmentUserProfile$4
IncrementalSupportVisitor Visiting com/waysay/fragments/FragmentPlaceholder
IncrementalSupportVisitor Visiting com/waysay/fragments/DialogFragmentComment
IncrementalSupportVisitor Visiting com/waysay/fragments/DialogFragmentUserProfile$5
IncrementalSupportVisitor Visiting com/waysay/fragments/FragmentPlaceholder$1
IncrementalSupportVisitor Visiting com/waysay/fragments/DialogFragmentUserProfile$6
IncrementalSupportVisitor Visiting com/waysay/fragments/DialogFragmentUserProfile$1
IncrementalSupportVisitor Visiting com/waysay/fragments/DialogFragmentUserProfile
IncrementalSupportVisitor Visiting com/waysay/fragments/DialogFragmentUserProfile$3
IncrementalSupportVisitor Visiting com/waysay/fragments/FragmentPlaceholder$VerticalSpaceItemDecoration
IncrementalSupportVisitor Visiting com/waysay/fragments/DummyFragment
IncrementalSupportVisitor Visiting com/waysay/fragments/FragmentPlaceholder$3
IncrementalSupportVisitor Visiting com/waysay/constants/WsConstant
IncrementalSupportVisitor Visiting com/waysay/constants/ToolBarCustom$1
IncrementalSupportVisitor Visiting com/waysay/constants/ToolBarCustom
IncrementalSupportVisitor Visiting com/waysay/app/MainActivity$5
IncrementalSupportVisitor Visiting com/waysay/app/MainActivity$2
IncrementalSupportVisitor Visiting com/waysay/app/SplashActivity
IncrementalSupportVisitor Visiting com/waysay/app/MainActivity
IncrementalSupportVisitor Visiting com/waysay/app/MainActivity$1
IncrementalSupportVisitor Visiting com/waysay/app/MainActivity$4
IncrementalSupportVisitor Visiting com/waysay/app/MainActivity$6
IncrementalSupportVisitor Visiting com/waysay/app/MainActivity$3
IncrementalSupportVisitor Visiting com/waysay/app/MainActivity$SectionsPagerAdapter
IncrementalSupportVisitor Visiting com/waysay/helpers/ServiceConnection
IncrementalSupportVisitor Visiting com/waysay/helpers/WebviewFallback
IncrementalSupportVisitor Visiting com/waysay/helpers/KeepAliveService
IncrementalSupportVisitor Visiting com/waysay/helpers/HelperVolley$1
IncrementalSupportVisitor Visiting com/waysay/helpers/CustomTabsHelper
IncrementalSupportVisitor Visiting com/waysay/helpers/HelperVolley
IncrementalSupportVisitor Visiting com/waysay/helpers/HelperPreferences
IncrementalSupportVisitor Visiting com/waysay/helpers/CustomTabActivityHelper
IncrementalSupportVisitor Visiting com/waysay/helpers/WebviewActivity
IncrementalSupportVisitor Visiting android/support/design/R$color
IncrementalSupportVisitor Visiting android/support/design/R$style
IncrementalSupportVisitor Visiting android/support/design/R$attr
IncrementalSupportVisitor Visiting android/support/design/R$dimen
IncrementalSupportVisitor Visiting android/support/design/R$integer
IncrementalSupportVisitor Visiting android/support/design/R$anim
IncrementalSupportVisitor Visiting android/support/design/R
IncrementalSupportVisitor Visiting android/support/design/R$drawable
IncrementalSupportVisitor Visiting android/support/design/R$layout
IncrementalSupportVisitor Visiting android/support/design/R$styleable
IncrementalSupportVisitor Visiting android/support/design/R$id
IncrementalSupportVisitor Visiting android/support/design/R$string
IncrementalSupportVisitor Visiting android/support/design/R$bool
IncrementalSupportVisitor Visiting com/twitter/sdk/android/R$color
IncrementalSupportVisitor Visiting com/twitter/sdk/android/R$style
IncrementalSupportVisitor Visiting com/twitter/sdk/android/R$attr
IncrementalSupportVisitor Visiting com/twitter/sdk/android/R$dimen
IncrementalSupportVisitor Visiting com/twitter/sdk/android/R$integer
IncrementalSupportVisitor Visiting com/twitter/sdk/android/R$anim
IncrementalSupportVisitor Visiting com/twitter/sdk/android/R
IncrementalSupportVisitor Visiting com/twitter/sdk/android/R$drawable
IncrementalSupportVisitor Visiting com/twitter/sdk/android/R$raw
IncrementalSupportVisitor Visiting com/twitter/sdk/android/R$layout
IncrementalSupportVisitor Visiting com/twitter/sdk/android/R$plurals
IncrementalSupportVisitor Visiting com/twitter/sdk/android/R$styleable
IncrementalSupportVisitor Visiting com/twitter/sdk/android/R$id
IncrementalSupportVisitor Visiting com/twitter/sdk/android/R$string
IncrementalSupportVisitor Visiting com/twitter/sdk/android/R$bool
IncrementalSupportVisitor Visiting com/digits/sdk/android/R$color
IncrementalSupportVisitor Visiting com/digits/sdk/android/R$style
IncrementalSupportVisitor Visiting com/digits/sdk/android/R$attr
IncrementalSupportVisitor Visiting com/digits/sdk/android/R$dimen
IncrementalSupportVisitor Visiting com/digits/sdk/android/R$integer
IncrementalSupportVisitor Visiting com/digits/sdk/android/R$anim
IncrementalSupportVisitor Visiting com/digits/sdk/android/R
IncrementalSupportVisitor Visiting com/digits/sdk/android/R$drawable
IncrementalSupportVisitor Visiting com/digits/sdk/android/R$raw
IncrementalSupportVisitor Visiting com/digits/sdk/android/R$layout
IncrementalSupportVisitor Visiting com/digits/sdk/android/R$styleable
IncrementalSupportVisitor Visiting com/digits/sdk/android/R$id
IncrementalSupportVisitor Visiting com/digits/sdk/android/R$string
IncrementalSupportVisitor Visiting com/digits/sdk/android/R$bool
IncrementalSupportVisitor Visiting android/support/v7/cardview/R$color
IncrementalSupportVisitor Visiting android/support/v7/cardview/R$style
IncrementalSupportVisitor Visiting android/support/v7/cardview/R$attr
IncrementalSupportVisitor Visiting android/support/v7/cardview/R$dimen
IncrementalSupportVisitor Visiting android/support/v7/cardview/R
IncrementalSupportVisitor Visiting android/support/v7/cardview/R$styleable
IncrementalSupportVisitor Visiting android/support/v7/appcompat/R$color
IncrementalSupportVisitor Visiting android/support/v7/appcompat/R$style
IncrementalSupportVisitor Visiting android/support/v7/appcompat/R$attr
IncrementalSupportVisitor Visiting android/support/v7/appcompat/R$dimen
IncrementalSupportVisitor Visiting android/support/v7/appcompat/R$integer
IncrementalSupportVisitor Visiting android/support/v7/appcompat/R$anim
IncrementalSupportVisitor Visiting android/support/v7/appcompat/R
IncrementalSupportVisitor Visiting android/support/v7/appcompat/R$drawable
IncrementalSupportVisitor Visiting android/support/v7/appcompat/R$layout
IncrementalSupportVisitor Visiting android/support/v7/appcompat/R$styleable
IncrementalSupportVisitor Visiting android/support/v7/appcompat/R$id
IncrementalSupportVisitor Visiting android/support/v7/appcompat/R$string
IncrementalSupportVisitor Visiting android/support/v7/appcompat/R$bool
IncrementalSupportVisitor Visiting android/support/v7/recyclerview/R$attr
IncrementalSupportVisitor Visiting android/support/v7/recyclerview/R$dimen
IncrementalSupportVisitor Visiting android/support/v7/recyclerview/R
IncrementalSupportVisitor Visiting android/support/v7/recyclerview/R$styleable
IncrementalSupportVisitor Visiting android/support/v7/recyclerview/R$id
IncrementalSupportVisitor Visiting com/twitter/sdk/android/core/R$color
IncrementalSupportVisitor Visiting com/twitter/sdk/android/core/R$style
IncrementalSupportVisitor Visiting com/twitter/sdk/android/core/R$attr
IncrementalSupportVisitor Visiting com/twitter/sdk/android/core/R$dimen
IncrementalSupportVisitor Visiting com/twitter/sdk/android/core/R
IncrementalSupportVisitor Visiting com/twitter/sdk/android/core/R$drawable
IncrementalSupportVisitor Visiting com/twitter/sdk/android/core/R$raw
IncrementalSupportVisitor Visiting com/twitter/sdk/android/core/R$layout
IncrementalSupportVisitor Visiting com/twitter/sdk/android/core/R$styleable
IncrementalSupportVisitor Visiting com/twitter/sdk/android/core/R$id
IncrementalSupportVisitor Visiting com/twitter/sdk/android/core/R$string
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetcomposer/R$color
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetcomposer/R$style
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetcomposer/R$attr
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetcomposer/R$dimen
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetcomposer/R
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetcomposer/R$drawable
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetcomposer/R$raw
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetcomposer/R$layout
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetcomposer/R$styleable
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetcomposer/R$id
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetcomposer/R$string
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetui/R$color
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetui/R$style
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetui/R$attr
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetui/R$dimen
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetui/R
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetui/R$drawable
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetui/R$raw
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetui/R$layout
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetui/R$plurals
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetui/R$styleable
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetui/R$id
IncrementalSupportVisitor Visiting com/twitter/sdk/android/tweetui/R$string
:app:transformClassesWithInstant+restartDexForDebug
:app:transformClasses_enhancedWithInstant+reloadDexForDebug
:app:incrementalDebugSupportDex
:app:transformClassesWithDexForDebug
Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Landroid/support/design/R$anim;
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-oracle/bin/java'' finished with non-zero exit value 2
Information:BUILD FAILED
Information:Total time: 1 mins 22.84 secs
Information:2 errors
Information:0 warnings
Information:See complete output in console
任何帮助都将不胜感激。
答案 0 :(得分:133)
好。我不知道这是怎么回事。
首先我清理了项目然后,运行项目使一切顺利。
Inshort,首先是Clean
,然后是Run
。
修改首先Clean
然后Make Project
也有效。
答案 1 :(得分:33)
答案 2 :(得分:15)
在我的情况下,我把
apply plugin: 'com.google.gms.google-services'
位于build.gradle
文件的底部,并在 defaultConfig 中设置multiDexEnabled true
。然后运行就可以了。
答案 3 :(得分:14)
答案 4 :(得分:10)
我遇到了同样的问题,我清理项目,其他一些问题导致无法清理,所以我手动删除dir'build',这样就可以清理好了,然后运行就好了。
答案 5 :(得分:8)
我发现在我的情况下,这个问题是由build.gradle的不正确配置引起的。我有两个不同版本的com.google.firebase。一旦版本相同,问题就解决了
答案 6 :(得分:6)
我遇到了同样的问题。
首先从项目位置删除 build
文件夹(您可以通过android studio或使用资源管理器访问它),然后build
项目。
答案 7 :(得分:5)
在我的情况下,问题是由于某些包裹中的大写字母。
答案 8 :(得分:4)
只需restart
您的AS,然后Rebuild
您的应用!
答案 9 :(得分:3)
升级到Android Studio 2.1后,下次重新启动时,我被要求升级到JDK 1.8。在我升级到JDK 1.8之后,当我的AS项目编译时出现问题。我按照本页面中的所有建议,但无济于事。最后,我决定检查我的项目正在使用的JDK版本,令我惊讶的是,它以某种方式指向了JDK 1.8!
故事的道德:如果compileSdkVersion< = 23,请仔细检查您的项目是否使用JDK1.7,如下所示:
答案 10 :(得分:2)
检查build.gradle(模块:您的应用)。
所有com.google.android.gms库必须使用完全相同的版本规范(混合版本可能会导致运行时崩溃)。
例如: 如果您有com.google.firebase:firebase-ads: 9.6.1 和com.google.android.gms:play-services-basement: 10.0.1
您必须将firebase版本更改为: 10.0.1
答案 11 :(得分:2)
这个问题主要发生在gradle或misversioned库中,包括来自库的,当它们定义同一个类时。展开并检查导入的外部库......
您不能将两个相同的类导出到一个地方或代码,因此,dexer不知道应该使用哪个类...
答案 12 :(得分:2)
在:
if let timeStampToDate = merchant.post["timestamp"] { print(timeStampToDate) let timeSt = Date(jsonDate:"/Date(\(timeStampToDate)))/") merchantOpenLbl.text = Date().onlyTimee(date: timeSt!) }
后:
compile 'com.google.android.gms:play-services-location:10.0.1' compile 'com.google.android.gms:play-services-auth:10.0.1' compile 'com.google.firebase:firebase-database:10.2.0' compile 'com.google.firebase:firebase-core:10.2.0' compile 'com.google.firebase:firebase-messaging:10.2.0'
终于得到了解决。
答案 13 :(得分:2)
请在build.gradle
中的android中添加此块 dexOptions {
preDexLibraries = false
}
答案 14 :(得分:2)
在我的情况下,这是由于我的库未被配置为'android'。
例如。 apply plugin:'java'
代替apply plugin:'com.android.library'
答案 15 :(得分:1)
对我有用的东西。
答案 16 :(得分:1)
干净并重试为我解决。
答案 17 :(得分:1)
首先,构建->清理项目->再次重建它。
如果它不起作用,则在您的build.gradle
中,将multiDexEnabled
设置为true
例如:
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 21
targetSdkVersion 27
multiDexEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner"android.support.test.runner.AndroidJUnitRunner"
}
答案 18 :(得分:1)
如果它对某人有帮助,在我的情况下,我在发布模式而不是在调试模式下使用自定义包。
我刚刚更改了#34;发布"到"调试"它起作用了。
答案 19 :(得分:1)
我注意到在Android Studio构建时编辑java文件时(有时)会发生这种情况。
我通过手动删除build
文件夹并运行agin来解决这个问题。
答案 20 :(得分:1)
我遇到了同样的问题,并意识到我在app / libs文件夹中的两个独立的jar文件与子依赖项具有相同的包,这导致了冲突。
答案 21 :(得分:1)
这个问题有很多答案但是,如果你还没有解决你的错误,这可能会有效:
有时我们会从google产品/ API导入不同的版本,所以, 尝试组织您的gradle文件来解决:
Mixing versions
警告
答案 22 :(得分:1)
如果从2个不同来源引入代码相同的库,则会导致错误。
答案 23 :(得分:1)
我遇到了同样的问题,这是由不同版本的Google Analytics和firebase造成的。我使用'com.google.gms:google-services:3.1.0'
然后添加这些依赖项:
compile 'com.google.android.gms:play-services-gcm:10.2.6'
compile 'com.google.firebase:firebase-crash:10.0.1'
因此将firebase版本更改为10.2.6可以解决此问题。
compile 'com.google.android.gms:play-services-gcm:10.2.6'
compile 'com.google.firebase:firebase-crash:10.2.6'
答案 24 :(得分:1)
对我来说很容易。只需添加:
// noinspection GradleDependency,GradleCompatible 实施'com.google.android.gms:play-services-auth:11.0.4'
......魔法发生了。
答案 25 :(得分:1)
尝试通过:app:installDebug
安装。如果它有效,那么它与Android Studio的缓存有关。我删除了项目中的.gradle/
文件夹,但它确实有效。
答案 26 :(得分:1)
我的项目在我的build.gradle
文件(1.7和1.8)中使用了具有异构Java兼容版本的外部库。
我通过使用lib和app项目的相同版本来修复它。就我而言:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
答案 27 :(得分:1)
如果您有多个项目,请确保您没有多次添加依赖项,我需要排除其他项目的依赖项,如下所示:
compile(project(':OtherProject-SDK')) {
compile.exclude module: 'play-services-gcm'
compile.exclude module: 'play-services-location'
compile.exclude module: 'support-v4'
compile.exclude module: 'okhttp'
}
答案 28 :(得分:1)
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile fileTree(include: 'Parse-*.jar', dir: 'libs')
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:cardview-v7:23.2.0'
compile 'com.android.support:design:24.0.0-alpha1'
compile "com.google.firebase:firebase-invites:9.2.0"
compile "com.google.firebase:firebase-ads:9.2.0"
compile 'com.google.firebase:firebase-database:9.2.0'
compile 'com.google.firebase:firebase-core:9.2.0'
}
我添加com.google.firebase:firebase-core:9.2.0
行并为所有firebase库选择相同的版本(9.2.0),问题就解决了。
答案 29 :(得分:0)
就我而言,使用:
当Gradle守护程序的最大堆大小优于4Go时,我在transformClassesWithDexFor期间遇到问题。 通过使用org.gradle.jvmargs = -Xmx2048m更改〜/ gradle.properties(这意味着我将堆大小减小为2Go而不是4Go),该dex然后在单独的进程中运行,而我不再遇到问题。
14:52:26.412 [WARN] [org.gradle.api.Project]
将dex作为单独的进程运行。
要在进程中运行dex,Gradle守护程序需要更大的堆。
当前有2048 MB。
为了更快的构建,请增加最大堆 Gradle守护程序的大小至少为4608 MB(基于 dexOptions.javaMaxHeapSize = 4g)。
为此,请在项目gradle.properties中设置org.gradle.jvmargs = -Xmx4608M。